Package edu.tufts.hrilab.ava
Class AvaComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.ava.AvaComponent
- All Implemented Interfaces:
AvaInterface,LidarInterface,MoveBaseInterface
- Direct Known Subclasses:
FakeMockAvaComponent
Represents the Ava robot navigation functionality.
-
Field Summary
Fields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.commons.cli.Option>Override this method to define command line options available in sub-class.approachLocation(Symbol desiredLocation) go to the location and then move forward until certain distance from object in frontapproachLocation(Symbol desiredLocation, Symbol initialLocation) go to the location and then move forward until certain distance from object in frontvoidChecks to see if the robot is within atOffset distance from goal posevoidvoidvoiddisplayRobot(ai.thinkingrobots.trade.TRADEServiceInfo displayService) Calls the displayRobot TRADE service on the AvaDisplayComponent if available.Dock to a specific dock by reference ID.voidvoidClose an RMS session with the robot.protected JustificationfollowPath(List<PathAction> path) doubleGet the battery level of the Ava robot in percentage.doubleGet the current camera tilt position of the robot.Get a list of dynamic obstacles that the robot detects.floatGet the angle increment between scans.float[]Get the ranges of the laser scan.List<byte[]>org.apache.commons.lang3.tuple.Pair<javax.vecmath.Point3d,javax.vecmath.Quat4d> getPose()javax.vecmath.Matrix4dRetrieves the current robot position and rotation and returns a converted Matrix4d.double[]javax.vecmath.Point3dUsed to updated Firebase GUI TODO: is this method needed?doubleGet the estimated remaining runtime of the robot in seconds.doublegetZLift()Get the current Z lift position of the robot.Send the robot dock location and then dock it.goToDock()Send the Ava robot to dock.goToLocation(double xdest, double ydest, double quat_x, double quat_y, double quat_z, double quat_w, boolean wait) go to the point and orientationgoToLocation(Symbol location) go to the location and then move forward until certain distance from object in frontgoToLocation(Symbol location, boolean wait) Go to a known location in the world.goToLocation(Symbol desiredLocation, Symbol initialLocation) go to the location and then move forward until certain distance from object in frontgoToLocation(javax.vecmath.Point3d location, javax.vecmath.Quat4d orientation, boolean wait) protected voidinit()Perform any component initialization.voidvoidvoidvoidinterruptWaitForLearningGoalSubmissionOrQuestionAnswer(Symbol agent, Predicate learnedActionPredicate) voidbooleanisDocked()Return true if robot is dockedisMoving()Return whether or not robot is in motion.voidlocationRefToName(Symbol ref) lookAt(double x, double y, double duration) Look at a vector.lookAtObstacle(Obstacle obs) moveForward(double distance) Drive straight forward along the robot's current heading using direct velocity commands until odometry shows the requested distance has been covered.protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Override this method to parse command line args in the sub-class.voidplayAudioClip(String fileName) voidplayAudioFile(String fileName) voidregisterForAvaStatisticsNotifications(ai.thinkingrobots.trade.TRADEServiceInfo callback) rssiQualityLabel(Symbol rssi) saveLocationTag(Symbol location) voidvoidsetCameraTilt(double tilt) Set the Z lift of the robot.voidsetPose(javax.vecmath.Point3d location, javax.vecmath.Quat4d orientation) Deprecated.voidsetPoseGlobal(double x, double y, double z) setRotation(double theta) Set the rotation of the robot.setRotation(javax.vecmath.Quat4d orientation) Set the rotation of the robot.setZLift(double lift) Set the Z lift of the robot.stop()Stop the robot by interrupting a goToLocation or goToArbitrary action.voidvoidvoidvoidunregisterForAvaStatisticsNotifications(ai.thinkingrobots.trade.TRADEServiceInfo callback) voidwaitForDuration(long seconds) waitForLearningGoalSubmissionOrQuestionAnswer(Symbol agent, String questionString, List<Term> responseForms, Predicate learnedActionPredicate) voidMethods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
attachShutdownHook, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, postRegistrationInit, shutdown, shutdownComponent
-
Constructor Details
-
AvaComponent
public AvaComponent()
-
-
Method Details
-
additionalUsageInfo
Description copied from class:DiarcComponentOverride this method to define command line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfoin classDiarcComponent- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Description copied from class:DiarcComponentOverride this method to parse command line args in the sub-class. Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.- Overrides:
parseArgsin classDiarcComponent
-
init
protected void init()Description copied from class:DiarcComponentPerform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.- Overrides:
initin classDiarcComponent
-
registerForAvaStatisticsNotifications
public void registerForAvaStatisticsNotifications(ai.thinkingrobots.trade.TRADEServiceInfo callback) -
unregisterForAvaStatisticsNotifications
public void unregisterForAvaStatisticsNotifications(ai.thinkingrobots.trade.TRADEServiceInfo callback) -
setAtPrimaryDock
public void setAtPrimaryDock() -
setAtSecondaryDock
public void setAtSecondaryDock() -
getDockRefId
- Specified by:
getDockRefIdin interfaceAvaInterface
-
displayRobot
public void displayRobot(ai.thinkingrobots.trade.TRADEServiceInfo displayService) Calls the displayRobot TRADE service on the AvaDisplayComponent if available.- Specified by:
displayRobotin interfaceAvaInterface
-
getPosition
public javax.vecmath.Point3d getPosition()Used to updated Firebase GUI TODO: is this method needed?- Returns:
- Point3d of robot position
-
setPose
public void setPose(javax.vecmath.Point3d location, javax.vecmath.Quat4d orientation) Deprecated. Cannot set pose of Ava robot without moving to location.- Parameters:
location- robot locationorientation- robot orientation
-
setPoseGlobal
public void setPoseGlobal(double x, double y, double z) - Specified by:
setPoseGlobalin interfaceMoveBaseInterface
-
getPoseGlobalQuat
public double[] getPoseGlobalQuat()- Specified by:
getPoseGlobalQuatin interfaceMoveBaseInterface
-
getPose
public org.apache.commons.lang3.tuple.Pair<javax.vecmath.Point3d,javax.vecmath.Quat4d> getPose() -
getPoseGlobalMatrix4d
public javax.vecmath.Matrix4d getPoseGlobalMatrix4d()Retrieves the current robot position and rotation and returns a converted Matrix4d.- Returns:
- robot pose as Matrix4d
-
goToLocation
Go to a known location in the world.- Specified by:
goToLocationin interfaceMoveBaseInterface- Parameters:
location- a known location.wait- should wait until movement is complete
-
goToLocation
Description copied from interface:MoveBaseInterfacego to the location and then move forward until certain distance from object in front- Specified by:
goToLocationin interfaceMoveBaseInterface- Parameters:
location- name of the desired location to navigate to- Returns:
- justification specifying if the robot navigated to the location
-
goToLocation
Description copied from interface:MoveBaseInterfacego to the location and then move forward until certain distance from object in front- Specified by:
goToLocationin interfaceMoveBaseInterface- Parameters:
desiredLocation- name of the desired location to navigate toinitialLocation- name of the initial location to navigate from -- used for conditions and effects- Returns:
- justification specifying if the robot navigated to the location
-
goToLocation
public Justification goToLocation(javax.vecmath.Point3d location, javax.vecmath.Quat4d orientation, boolean wait) -
goToLocation
public Justification goToLocation(double xdest, double ydest, double quat_x, double quat_y, double quat_z, double quat_w, boolean wait) Description copied from interface:MoveBaseInterfacego to the point and orientation- Specified by:
goToLocationin interfaceMoveBaseInterface- Parameters:
xdest- x pointydest- y pointquat_x- x quaternion valuequat_y- y quaternion valuequat_z- z quaternion valuequat_w- w quaternion valuewait- should robot wait until reached desired point and orientation- Returns:
- justification if the robot reach the desired point and orientation
-
approachLocation
Description copied from interface:MoveBaseInterfacego to the location and then move forward until certain distance from object in front- Specified by:
approachLocationin interfaceMoveBaseInterface- Parameters:
desiredLocation- name of the desired location to navigate to- Returns:
- justification specifying if the robot navigated to the location
-
approachLocation
Description copied from interface:MoveBaseInterfacego to the location and then move forward until certain distance from object in front- Specified by:
approachLocationin interfaceMoveBaseInterface- Parameters:
desiredLocation- name of the desired location to navigate toinitialLocation- name of the initial location to navigate from -- used for conditions and effects- Returns:
- justification specifying if the robot navigated to the location
-
stop
Stop the robot by interrupting a goToLocation or goToArbitrary action.- Specified by:
stopin interfaceMoveBaseInterface- Returns:
- true
-
isMoving
Return whether or not robot is in motion.- Specified by:
isMovingin interfaceMoveBaseInterface- Returns:
- Justification true if moving
-
checkAt
Checks to see if the robot is within atOffset distance from goal pose- Specified by:
checkAtin interfaceMoveBaseInterface- Parameters:
locationTerm- the predicate to observe at(?actor, ?location)- Returns:
- list of argument bindings empty list is failure to observe list with empty hashmap means actor is within atOffset of goal pose
-
followPath
-
goToDock
Send the Ava robot to dock. Automatically determines which dock is closer and forces localization to that dock after docking completes.- Specified by:
goToDockin interfaceAvaInterface
-
dock
Dock to a specific dock by reference ID.- Parameters:
dockRefId- the Symbol reference for the target dock (dockLocation or altDockLocation)- Returns:
- justification of success/failure
-
getMapImages
-
getMapMetadatas
-
goHomePrimitive
Description copied from interface:AvaInterfaceSend the robot dock location and then dock it.- Specified by:
goHomePrimitivein interfaceAvaInterface- Returns:
- success or error
-
endSession
Description copied from interface:AvaInterfaceClose an RMS session with the robot.- Specified by:
endSessionin interfaceAvaInterface- Returns:
- Justification true if successful
-
getBatteryLevel
public double getBatteryLevel()Description copied from interface:AvaInterfaceGet the battery level of the Ava robot in percentage.- Specified by:
getBatteryLevelin interfaceAvaInterface- Returns:
- double 0-100
-
getZLift
public double getZLift()Description copied from interface:AvaInterfaceGet the current Z lift position of the robot.- Specified by:
getZLiftin interfaceAvaInterface- Returns:
- double percentage of lift 0-100
-
setZLift
Description copied from interface:AvaInterfaceSet the Z lift of the robot.- Specified by:
setZLiftin interfaceAvaInterface- Parameters:
lift- percentage to set z lift to 0-100
-
getCameraTilt
public double getCameraTilt()Description copied from interface:AvaInterfaceGet the current camera tilt position of the robot.- Specified by:
getCameraTiltin interfaceAvaInterface- Returns:
- double percentage of tilt 0-100
-
setCameraTilt
Description copied from interface:AvaInterfaceSet the Z lift of the robot.- Specified by:
setCameraTiltin interfaceAvaInterface- Parameters:
tilt- percentage to set z lift to 0-100
-
setRotation
Set the rotation of the robot.- Parameters:
orientation- Quat4d representing goal robot rotation
-
setRotation
Set the rotation of the robot.- Parameters:
theta- goal Z rotation of the robot
-
getRuntime
public double getRuntime()Description copied from interface:AvaInterfaceGet the estimated remaining runtime of the robot in seconds.- Specified by:
getRuntimein interfaceAvaInterface- Returns:
- runtime seconds
-
getLaserScan
public float[] getLaserScan()Get the ranges of the laser scan.- Specified by:
getLaserScanin interfaceLidarInterface- Returns:
- float array of laser scans in meters
-
getLaserAngleIncrement
public float getLaserAngleIncrement()Get the angle increment between scans. Uses difference between the first two.- Specified by:
getLaserAngleIncrementin interfaceLidarInterface- Returns:
- angle increment as float
-
getDynamicObstacles
Description copied from interface:AvaInterfaceGet a list of dynamic obstacles that the robot detects.- Specified by:
getDynamicObstaclesin interfaceAvaInterface- Returns:
- Object containing obstacles list
-
isDocked
public boolean isDocked()Description copied from interface:AvaInterfaceReturn true if robot is docked- Specified by:
isDockedin interfaceAvaInterface- Returns:
- boolean
-
lookAtObstacle
- Specified by:
lookAtObstaclein interfaceAvaInterface
-
lookAt
Description copied from interface:AvaInterfaceLook at a vector.- Specified by:
lookAtin interfaceAvaInterface- Parameters:
x- position xy- position yduration- length of look at event
-
saveLocationTag
-
stopFollowing
- Specified by:
stopFollowingin interfaceAvaInterface
-
avaFollow
- Specified by:
avaFollowin interfaceAvaInterface
-
moveForward
Description copied from interface:AvaInterfaceDrive straight forward along the robot's current heading using direct velocity commands until odometry shows the requested distance has been covered.- Specified by:
moveForwardin interfaceAvaInterface- Parameters:
distance- meters to travel forward
-
parseTime
- Specified by:
parseTimein interfaceAvaInterface
-
getWifiSignalStrength
- Specified by:
getWifiSignalStrengthin interfaceAvaInterface
-
measureWifiRssi
- Specified by:
measureWifiRssiin interfaceAvaInterface
-
locationRefToName
- Specified by:
locationRefToNamein interfaceAvaInterface
-
rssiQualityLabel
- Specified by:
rssiQualityLabelin interfaceAvaInterface
-
measureTemperatureDegrees
- Specified by:
measureTemperatureDegreesin interfaceAvaInterface
-
blockToCharge
public void blockToCharge()- Specified by:
blockToChargein interfaceAvaInterface
-
interruptChargingBlock
public void interruptChargingBlock()- Specified by:
interruptChargingBlockin interfaceAvaInterface
-
disableMicrophone
public void disableMicrophone() -
enableMicrophone
public void enableMicrophone() -
triggerWW
public void triggerWW() -
playAudioFile
-
playAudioClip
-
interruptListenForWWandASR
public void interruptListenForWWandASR()- Specified by:
interruptListenForWWandASRin interfaceAvaInterface
-
listenForWWandASR
public void listenForWWandASR()- Specified by:
listenForWWandASRin interfaceAvaInterface
-
waitForReadyAck
public void waitForReadyAck()- Specified by:
waitForReadyAckin interfaceAvaInterface
-
interruptWaitForReadyAck
public void interruptWaitForReadyAck()- Specified by:
interruptWaitForReadyAckin interfaceAvaInterface
-
interruptWaitForLearningGoalSubmissionOrQuestionAnswer
-
waitForLearningGoalSubmissionOrQuestionAnswer
-
waitForDuration
public void waitForDuration(long seconds) - Specified by:
waitForDurationin interfaceAvaInterface
-
interruptWaitForDuration
public void interruptWaitForDuration()- Specified by:
interruptWaitForDurationin interfaceAvaInterface
-
enableAdminMode
public void enableAdminMode()- Specified by:
enableAdminModein interfaceAvaInterface
-
disableAdminMode
public void disableAdminMode()- Specified by:
disableAdminModein interfaceAvaInterface
-
switchDisplayToTRACS
public void switchDisplayToTRACS() -
switchDisplayToTelepresencePrimitive
public void switchDisplayToTelepresencePrimitive()
-