Package edu.tufts.hrilab.map
Class MapComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.map.MapComponent
- All Implemented Interfaces:
GuiProvider
-
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.String[]Provide the class names of this component's GUI adapter classes.intget the current floor the robot is onList<javax.vecmath.Point2d>getDoorEdges(Symbol door) Get the two end points of a doorjavax.vecmath.Matrix4dgetElevatorButtonPose(Symbol elevatorDoor, double padding) Get the pose needed to press the up/down button for the elevator door.List<javax.vecmath.Matrix4d>getElevatorEnterPosePath(Symbol elevatorDoor, double padding) javax.vecmath.Matrix4dgetElevatorExitPose(Symbol elevatorDoor, double padding) Get the pose needed to exit the elevator into the elevator lobby.List<javax.vecmath.Matrix4d>getElevatorExitPosePath(Symbol elevatorDoor, double padding) javax.vecmath.Matrix4dgetElevatorPanelPose(Symbol elevatorDoor, double padding) Gets pose of robot on the elevator facing the inside button panel.gets a list of the symbolic representations of the nearest elevator doorsGet the path from the curr pose to the destination refId.getRefs()Gets all stored map locations as a map of refId -> (position,orientation)TODO: HACK: remove this method once we use the planner for multi-floor navigationprotected voidinit()Perform any component initialization.voidMarks a portal between two rooms as either closed or open.protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Override this method to parse command line args in the sub-class.voidrecordLocation(javax.vecmath.Point3d meterPosition) Records a new location using a 3D point and a default orientation quaternion.voidsetCurrentFloor(int newFloor) switches the state information to match the new floorprotected voidAny component that needs particular shutdown logic needs to override this method andvoidGets the pose of the robot and sets the local pose .Methods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
createInstance, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, shutdown
-
Constructor Details
-
MapComponent
public MapComponent()
-
-
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
-
setCurrentFloor
public void setCurrentFloor(int newFloor) switches the state information to match the new floor- Parameters:
newFloor-
-
getCurrFloor
public int getCurrFloor()get the current floor the robot is on- Returns:
- the current floor of the robot
-
getPath
public List<PathAction> getPath(javax.vecmath.Matrix4d curr, Symbol dest, double padding, boolean canOpenDoors) Get the path from the curr pose to the destination refId. This assumes that both curr and dest are on the same floor.- Parameters:
curr- - current pose (meters)dest- - destination pose (meters)padding- - padding away from doors (meters)canOpenDoors- - whether the robot can open doors- Returns:
-
markDoor
Marks a portal between two rooms as either closed or open.- Parameters:
portal- ref id of portal to mark as open/closedclosed- boolean specifying if door is open or closed; true is closed, false is open
-
updateRobotPose
public void updateRobotPose()Gets the pose of the robot and sets the local pose . -
getDoorEdges
Get the two end points of a door- Parameters:
door- Name of door- Returns:
- A list with index 0 being one side of the door, and index 1 the other
-
goToNearestElevator
TODO: HACK: remove this method once we use the planner for multi-floor navigation- Returns:
-
getElevatorEnterPosePath
-
getElevatorExitPosePath
-
getElevatorPanelPose
Gets pose of robot on the elevator facing the inside button panel.- Parameters:
elevatorDoor- reference of elevator doorpadding- how far pose should be from panel- Returns:
- Pose of robot if it were to be standing in front the elevator panel.
-
getElevatorExitPose
Get the pose needed to exit the elevator into the elevator lobby.- Parameters:
elevatorDoor- reference to elevator door- Returns:
-
getElevatorButtonPose
Get the pose needed to press the up/down button for the elevator door.- Parameters:
elevatorDoor- reference to elevator door- Returns:
-
getNearestElevatorDoors
gets a list of the symbolic representations of the nearest elevator doors- Returns:
- a list of Symbols representing the elevator doors
-
shutdownComponent
protected void shutdownComponent()Description copied from class:DiarcComponentAny component that needs particular shutdown logic needs to override this method and- Overrides:
shutdownComponentin classDiarcComponent
-
getCurrRobotPose
-
getFloorMaps
-
getCurrFloorMap
-
recordLocation
public void recordLocation(javax.vecmath.Point3d meterPosition) Records a new location using a 3D point and a default orientation quaternion. Stores the pose in `storedPoses` with a reference created by the TRADE consultant.- Parameters:
meterPosition- The 3D coordinate of the new location.
-
getStoredPoses
public Map<Symbol,org.apache.commons.lang3.tuple.Pair<javax.vecmath.Point3d, getStoredPoses()javax.vecmath.Quat4d>> Gets all stored map locations as a map of refId -> (position,orientation)- Returns:
- an unmodifiable map of stored poses keyed by Symbol.
-
getRefs
-
getAdapterClassNames
Provide the class names of this component's GUI adapter classes.- Specified by:
getAdapterClassNamesin interfaceGuiProvider- Returns:
-