Class MapComponent

java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.map.MapComponent

public class MapComponent extends DiarcComponent
  • Constructor Details

    • MapComponent

      public MapComponent()
  • Method Details

    • additionalUsageInfo

      protected List<org.apache.commons.cli.Option> additionalUsageInfo()
      Description copied from class: DiarcComponent
      Command line options available in sub-class. This should be paired with a parseArgs implementation.
      Overrides:
      additionalUsageInfo in class DiarcComponent
      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 class DiarcComponent
    • 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 class DiarcComponent
    • 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

      public void markDoor(Symbol portal, boolean closed)
      Marks a portal between two rooms as either closed or open.
      Parameters:
      portal - ref id of portal to mark as open/closed
      closed - 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

      public List<javax.vecmath.Point2d> getDoorEdges(Symbol door)
      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

      public Justification goToNearestElevator()
      TODO: HACK: remove this method once we use the planner for multi-floor navigation
      Returns:
    • getElevatorEnterPosePath

      public List<javax.vecmath.Matrix4d> getElevatorEnterPosePath(Symbol elevatorDoor, double padding)
    • getElevatorExitPosePath

      public List<javax.vecmath.Matrix4d> getElevatorExitPosePath(Symbol elevatorDoor, double padding)
    • getElevatorPanelPose

      public javax.vecmath.Matrix4d getElevatorPanelPose(Symbol elevatorDoor, double padding)
      Gets pose of robot on the elevator facing the inside button panel.
      Parameters:
      elevatorDoor - reference of elevator door
      padding - how far pose should be from panel
      Returns:
      Pose of robot if it were to be standing in front the elevator panel.
    • getElevatorExitPose

      public javax.vecmath.Matrix4d getElevatorExitPose(Symbol elevatorDoor, double padding)
      Get the pose needed to exit the elevator into the elevator lobby.
      Parameters:
      elevatorDoor - reference to elevator door
      Returns:
    • getElevatorButtonPose

      public javax.vecmath.Matrix4d getElevatorButtonPose(Symbol elevatorDoor, double padding)
      Get the pose needed to press the up/down button for the elevator door.
      Parameters:
      elevatorDoor - reference to elevator door
      Returns:
    • getNearestElevatorDoors

      public List<Symbol> 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 class DiarcComponent