Package edu.tufts.hrilab.map
Class MapComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.map.MapComponent
-
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>
Command line options available in sub-class.int
get the current floor the robot is onList<javax.vecmath.Point2d>
getDoorEdges
(Symbol door) Get the two end points of a doorjavax.vecmath.Matrix4d
getElevatorButtonPose
(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.Matrix4d
getElevatorExitPose
(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.Matrix4d
getElevatorPanelPose
(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.TODO: HACK: remove this method once we use the planner for multi-floor navigationprotected void
init()
Perform any component initialization.void
Marks a portal between two rooms as either closed or open.protected void
parseArgs
(org.apache.commons.cli.CommandLine cmdLine) Called directly after construction to pass runtime values that will override default values.void
setCurrentFloor
(int newFloor) switches the state information to match the new floorprotected void
Any component that needs particular shutdown logic needs to override this method andvoid
Gets 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:DiarcComponent
Command line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfo
in classDiarcComponent
- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Description copied from class:DiarcComponent
Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs- Overrides:
parseArgs
in classDiarcComponent
-
init
protected void init()Description copied from class:DiarcComponent
Perform 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:
init
in 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:DiarcComponent
Any component that needs particular shutdown logic needs to override this method and- Overrides:
shutdownComponent
in classDiarcComponent
-