rmf_demos_fleet_adapter.RobotClientAPI module
The RobotAPI class is a wrapper for API calls to the robot.
Here users are expected to fill up the implementations of functions which will be used by the RobotCommandHandle. For example, if your robot has a REST API, you will need to make http request calls to the appropriate endpoints within these functions.
- class rmf_demos_fleet_adapter.RobotClientAPI.RobotAPI(prefix: str, user: str, password: str)
Bases:
object
- check_connection()
Return True if connection to the robot API server is successful.
- get_data(robot_name: str | None = None)
Return a RobotUpdateData for one robot if a name is given.
Otherwise return a list of RobotUpdateData for all robots.
Request the robot to navigate to pose:[x,y,theta].
Where x, y and theta are in the robot’s coordinate convention. This function should return True if the robot has accepted the request, else False.
- start_activity(robot_name: str, cmd_id: int, activity: str, label: str)
Request the robot to begin a process.
This is specific to the robot and the use case. For example, load/unload a cart for Deliverybot or begin cleaning a zone for a cleaning robot.
- stop(robot_name: str, cmd_id: int)
Command the robot to stop.
Return True if robot has successfully stopped. Else False
- toggle_attach(robot_name: str, attach: bool, cmd_id: int)
Request to attach or detach robot to/from cart.
Return True if the attach request is successful
- toggle_teleop(robot_name: str, toggle: bool)
Request to toggle the robot’s mode_teleop parameter.
Return True if the toggle request is successful