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.

navigate(robot_name: str, cmd_id: int, pose, map_name: str, speed_limit=0.0)

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_teleop(robot_name: str, toggle: bool)

Request to toggle the robot’s mode_teleop parameter.

Return True if the toggle request is successful

class rmf_demos_fleet_adapter.RobotClientAPI.RobotAPIResult(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

IMPOSSIBLE = 2

The client connected but something about the request is impossible

RETRY = 1

The client failed to connect but might succeed if you try again

SUCCESS = 0

The request was successful

class rmf_demos_fleet_adapter.RobotClientAPI.RobotUpdateData(data)

Bases: object

Update data for a single robot.

is_command_completed(cmd_id)