Class AvaWebsocketAPI

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

public class AvaWebsocketAPI extends Object implements AvaAPIInterface
  • Field Details

    • client

      public static AvaWebsocketClient client
    • resolved

      public static boolean resolved
    • message

      public static String message
  • Constructor Details

    • AvaWebsocketAPI

      public AvaWebsocketAPI(URI avaUri, String token, String mapNameString)
  • Method Details

    • end

      public void end()
      Terminates a session. After 30 seconds the robot will return to home base.
      Specified by:
      end 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 a given position on the map.
      Specified by:
      goToArbitrary in interface AvaAPIInterface
      Parameters:
      x - The x coordinates on the map (in pixels)
      y - The y coordinates on the map (in pixels)
    • goToArbitrary

      public RMSResponse goToArbitrary(double x, double y, double theta)
      Send the robot to a given pose on the map.
      Specified by:
      goToArbitrary in interface AvaAPIInterface
      Parameters:
      x - The x coordinates on the map (in pixels)
      y - The y coordinates on the map (in pixels)
      theta - The desired orientation of the robot on the map
    • goToLocation

      public RMSResponse goToLocation(String room)
      Send the robot to a room waypoint on the map.
      Parameters:
      room - Name of room in map to navigate to
    • goToLocation

      public RMSResponse goToLocation(String room, int waypointId)
      Send the robot to a waypoint within a room on the map.
      Parameters:
      room - Name of room waypoint is in
      waypointId - Unique id of the waypoint
    • dock

      public RMSResponse dock()
      Send the robot to the dock after waiting 30 seconds.
      Specified by:
      dock in interface AvaAPIInterface
      Returns:
      object from RMS containing success or error
    • stop

      public RMSResponse stop()
      Stop any go to navigation action for named or arbitrary locations.
      Specified by:
      stop in interface AvaAPIInterface
      Returns:
      object from RMS with error or status
    • getGoToStatus

      public RMSGoToStatusResponse getGoToStatus()
      Get the status of the robot while going to a tagged/named location within RMS.
      Specified by:
      getGoToStatus in interface AvaAPIInterface
      Returns:
      status object from RMS
    • getPosition

      public RMSPositionResponse getPosition()
      Get the current position of the robot on the map (in pixels).
      Specified by:
      getPosition in interface AvaAPIInterface
      Returns:
      Object containing position and orientation data
    • getMapLocations

      public RMSMapResponse getMapLocations()
      Gets a list of all rooms and waypoints available for navigation.
      Returns:
      Object containing all rooms and waypoints in map TODO: Add room representation to RMSMapInfoResponse, currently just waypoints
    • getMapMetadata

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

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

      public List<RMSMapMetadataResponse> getMapMetadatas()
      Specified by:
      getMapMetadatas in interface AvaAPIInterface
    • 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 health of the robot.
      Specified by:
      getZLiftCameraTilt in interface AvaAPIInterface
      Returns:
      Object containing robot health metadata
    • getRuntime

      public RMSRuntimeResponse getRuntime()
      Get the estimated runtime of the robot.
      Specified by:
      getRuntime in interface AvaAPIInterface
      Returns:
      Object containing robot runtume metadata
    • getLidar

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

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

      public RMSDockStatusResponse getDockStatus()
      Get status of robot docking from the robot.
      Specified by:
      getDockStatus in interface AvaAPIInterface
      Returns:
      Object containing dock status
    • setZLift

      public RMSResponse setZLift(double position)
      Set the Z lift position of the robot.
      Specified by:
      setZLift in interface AvaAPIInterface
      Parameters:
      position - Z lift position
      Returns:
      object from RMS with error or status
    • setCameraTilt

      public RMSResponse setCameraTilt(double position)
      Set the Z lift position of the robot.
      Specified by:
      setCameraTilt in interface AvaAPIInterface
      Parameters:
      position - Z lift position
      Returns:
      object from RMS with error or status
    • 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
    • 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 session status.
      Specified by:
      hasSession in interface AvaAPIInterface
      Returns:
      whether robot has active session with client
    • isMoving

      public boolean isMoving()
      Determine if robot is moving.
      Specified by:
      isMoving in interface AvaAPIInterface
      Returns:
      whether robot is moving
    • 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
    • getDriveStatus

      public RMSDriveStatusResponse getDriveStatus()
      Get status of robot driving from the robot.
      Specified by:
      getDriveStatus in interface AvaAPIInterface
      Returns:
      Object containing dock status