Class AvaHTTPAPI

java.lang.Object
edu.tufts.hrilab.ava.AvaHTTPAPI
All Implemented Interfaces:
AvaAPIInterface

public class AvaHTTPAPI extends Object implements AvaAPIInterface
  • Constructor Details

    • AvaHTTPAPI

      public AvaHTTPAPI(URI avaUri)
  • Method Details

    • end

      public void end()
      Null method. Ends an RMS session. Not possible in HTTP client.
      Specified by:
      end in interface AvaAPIInterface
    • getMapMetadata

      public RMSMapMetadataResponse getMapMetadata()
      Get the metadata about the current map.
      Specified by:
      getMapMetadata in interface AvaAPIInterface
      Returns:
      object containing metadata about map dimensions and scale
    • getMapMetadata

      public RMSMapMetadataResponse getMapMetadata(String mapName)
      Specified by:
      getMapMetadata in interface AvaAPIInterface
    • getMapMetadatas

      public ArrayList<RMSMapMetadataResponse> getMapMetadatas()
      Specified by:
      getMapMetadatas in interface AvaAPIInterface
    • setVelocity

      public RMSResponse setVelocity(float translation, float rotation, float sidestep)
      Specified by:
      setVelocity in interface AvaAPIInterface
    • setVelocity

      public RMSResponse setVelocity(float translation, float rotation, float sidestep, boolean nudge)
      Specified by:
      setVelocity in interface AvaAPIInterface
    • goToArbitrary

      public RMSResponse goToArbitrary(double x, double y)
      Send the robot to an arbitrary position on the map.
      Specified by:
      goToArbitrary in interface AvaAPIInterface
      Parameters:
      x - position in x coordinates (meters)
      y - position along y coordinates (meters)
      Returns:
      status of the request
    • goToArbitrary

      public RMSResponse goToArbitrary(double x, double y, double theta)
      Send the robot to an arbitrary pose on the map.
      Specified by:
      goToArbitrary in interface AvaAPIInterface
      Parameters:
      x - position in x coordinates (meters)
      y - position along y coordinates (meters)
      theta - the z rotation of the robot (radians)
      Returns:
      status of the request
    • getPosition

      public RMSPositionResponse getPosition()
      Gets the position of the robot at time of request.
      Specified by:
      getPosition in interface AvaAPIInterface
      Returns:
      robot position information
    • getGoToStatus

      public RMSGoToStatusResponse getGoToStatus()
      Null method. Returns the status of the robot during a go to navigation action to a named or tagged location. Not currently in use.
      Specified by:
      getGoToStatus in interface AvaAPIInterface
      Returns:
      status of go to location action
    • getHealth

      public RMSHealthResponse getHealth()
      Get the health of the robot.
      Specified by:
      getHealth in interface AvaAPIInterface
      Returns:
      Object containing robot health metadata
    • getZLiftCameraTilt

      public RMSZLiftCameraTiltResponse getZLiftCameraTilt()
      Get the Z lift position and camera tilt positon of the robot.
      Specified by:
      getZLiftCameraTilt in interface AvaAPIInterface
      Returns:
      Object containing z lift and camera tilt
    • getRuntime

      public RMSRuntimeResponse getRuntime()
      Get the estimate remaining runtime of the robot in minutes
      Specified by:
      getRuntime in interface AvaAPIInterface
      Returns:
      Object containing runtime estimate
    • getLidar

      public RMSLidarResponse getLidar()
      Get the lidar scan from the robot
      Specified by:
      getLidar in interface AvaAPIInterface
      Returns:
      Object containing lidar scan
    • getDynamicObstacles

      public RMSDynamicObstaclesResponse getDynamicObstacles()
      Get list of dynamic obstacles
      Specified by:
      getDynamicObstacles in interface AvaAPIInterface
      Returns:
      Object containing list of dynamic obstacles
    • getDockStatus

      public RMSDockStatusResponse getDockStatus()
      Get dock status
      Specified by:
      getDockStatus in interface AvaAPIInterface
      Returns:
      Object containing dock status information
    • stop

      public RMSResponse stop()
      Stops the robot during any go to navigation action.
      Specified by:
      stop in interface AvaAPIInterface
      Returns:
      response object
    • dock

      public RMSResponse dock()
      Sends the robot to the dock after waiting 30s.
      Specified by:
      dock in interface AvaAPIInterface
      Returns:
      response object
    • setZLift

      public RMSResponse setZLift(double position)
      Set the robot Z lift position.
      Specified by:
      setZLift in interface AvaAPIInterface
      Parameters:
      position - Z lift height
      Returns:
      response object
    • setCameraTilt

      public RMSResponse setCameraTilt(double position)
      Set the robot camera tilt position.
      Specified by:
      setCameraTilt in interface AvaAPIInterface
      Parameters:
      position - camera tilt position
      Returns:
      response object
    • lookAt

      public RMSResponse lookAt(double x, double y, double z, double duration)
      Look at a vector by rotation to face it.
      Specified by:
      lookAt in interface AvaAPIInterface
      Parameters:
      x - double of x position
      y - double of y position
      z - double of z position
      duration - double of seconds to hold look
      Returns:
      response object
    • hasSession

      public boolean hasSession()
      Returns whether the client has an active session, which in the case of the HTTP client is always true.
      Specified by:
      hasSession in interface AvaAPIInterface
      Returns:
      whether client has session
    • isMoving

      public boolean isMoving()
      Returns whether the robot has any velocity values in the position object.
      Specified by:
      isMoving in interface AvaAPIInterface
      Returns:
      whether the robot is in motion
    • getBatteryLevel

      public double getBatteryLevel()
      Get the current battery level as a percentage.
      Specified by:
      getBatteryLevel in interface AvaAPIInterface
      Returns:
      double 0-100 representing battery level
    • setRotation

      public RMSResponse setRotation(double theta)
      Rotates the robot on the Z axis.
      Specified by:
      setRotation in interface AvaAPIInterface
      Parameters:
      theta - goal rotation
      Returns:
      response object
    • localize

      public RMSResponse localize(double x, double y)
      Set the localization information for the robot. Forces expected localization. Lets the robot figure out theta based on sensor information.
      Parameters:
      x - x position in global coordinates
      y - y position in global coordinates
      Returns:
      response object
    • localize

      public RMSResponse localize(double x, double y, double theta)
      Set the localization information for the robot with orientation.
      Parameters:
      x - x position in global coordinates
      y - y position in global coordinates
      theta - orientation in radians
      Returns:
      response object
    • getMap

      public BufferedImage getMap(String mapName)
      Get the map as image data (PNG). Only available on local HTTP API.
      Returns:
      map data as image
    • getMaps

      public ArrayList<BufferedImage> getMaps()
    • getAllTags

      public ArrayList<RMSListTagsResponse> getAllTags()
    • createTag

      public String createTag(String mapId, String name, double x, double y, double theta, Map<String,String> attributes)
    • updateTag

      public boolean updateTag(String mapId, String tagId, double x, double y, double theta)
    • getDriveStatus

      public RMSDriveStatusResponse getDriveStatus()
      Gets drive status
      Specified by:
      getDriveStatus in interface AvaAPIInterface
      Returns:
      Object containing various drive statuses