Class RobotCommandHandle

Class Documentation

class RobotCommandHandle

Implement this class to receive robot commands from RMF.

Public Types

using Duration = rmf_traffic::Duration
using ArrivalEstimator = std::function<void(std::size_t path_index, Duration remaining_time)>

Use this callback function to update the fleet adapter on how long the robot will take to reach its next destination.

Param path_index:

[in] The index of the path element that the robot is currently heading towards.

Param remaining_time:

[in] An estimate of how much longer the robot will take to arrive at path_index.

using RequestCompleted = std::function<void()>

Trigger this callback function when the follow_new_path request has been completed. It should only be triggered that one time and then discarded.

Public Functions

virtual void follow_new_path(const std::vector<rmf_traffic::agv::Plan::Waypoint> &waypoints, ArrivalEstimator next_arrival_estimator, RequestCompleted path_finished_callback) = 0

Have the robot follow a new path. If it was already following a path, then it should immediately switch over to this one.

Parameters:
  • waypoints[in] The sequence of waypoints to follow. When the robot arrives at a waypoint in this sequence, it should wait at that waypoint until the clock reaches the time() field of the waypoint. This is important because the waypoint timing is used to avoid traffic conflicts with other vehicles.

  • next_arrival_estimator[in] Use this callback to give estimates for how long the robot will take to reach the path element of the specified index. You should still be calling RobotUpdateHandle::update_position() even as you call this function.

  • path_finished_callback[in] Trigger this callback when the robot is done following the new path. You do not need to trigger waypoint_arrival_callback when triggering this one.

virtual void stop() = 0

Have the robot come to an immediate stop.

virtual void dock(const std::string &dock_name, RequestCompleted docking_finished_callback) = 0

Have the robot begin a pre-defined docking procedure. Implement this function as a no-op if your robots do not perform docking procedures.

Parameters:
  • dock_name[in] The predefined name of the docking procedure to use.

  • docking_finished_callback[in] Trigger this callback when the docking is finished.

virtual ~RobotCommandHandle() = default