Class RobotUpdateHandle::ActionExecution
Defined in File RobotUpdateHandle.hpp
Nested Relationships
This class is a nested type of Class RobotUpdateHandle.
Class Documentation
-
class ActionExecution
The ActionExecution class should be used to manage the execution of and provide updates on ongoing actions.
Public Functions
-
void update_remaining_time(rmf_traffic::Duration remaining_time_estimate)
Update the amount of time remaining for this action. This does not need to be used for navigation requests.
-
void underway(std::optional<std::string> text)
Set task status to underway and optionally log a message (info tier)
-
void error(std::optional<std::string> text)
Set task status to error and optionally log a message (error tier)
-
void delayed(std::optional<std::string> text)
Set the task status to delayed and optionally log a message (warning tier)
-
void blocked(std::optional<std::string> text)
Set the task status to blocked and optionally log a message (warning tier)
-
Stubbornness override_schedule(std::string map, std::vector<Eigen::Vector3d> path, rmf_traffic::Duration hold = rmf_traffic::Duration(0))
Use this to override the traffic schedule for the agent while it performs this command.
If the given trajectory results in a traffic conflict then a negotiation will be triggered. Hold onto the
Stubbornnessreturned by this function to ask other agents to plan around your trajectory, otherwise the negotiation may result in a replan for this agent and a new command will be issued.Note
Using this will function always trigger a replan once the agent finishes the command.
Warning
Too many overridden/stubborn agents can cause a deadlock. It’s recommended to use this API sparingly and only over short distances or small deviations.
- Parameters:
map – [in] Name of the map where the trajectory will take place
path – [in] The path of the agent
hold – [in] How long the agent will wait at the end of the path
- Returns:
a Stubbornness handle that tells the fleet adapter to not let the overridden path be negotiated. The returned handle will stop having an effect after this command execution is finished.
-
void finished()
Trigger this when the action is successfully finished. No other functions in this ActionExecution instance will be usable after this.
-
bool okay() const
Returns false if the Action has been killed or cancelled.
-
void set_automatic_cancel(bool on)
Set whether automatic cancellation is turned on for this action.
When automatic cancellation is on, the task system will believe that the action is successfully cancelled immediately upon receiving a cancel signal. By default, automatic cancellation is on (true).
If your action needs to perform some kind of wind-down or cleanup after being cancelled, then you should set this to false. At that point you must ensure that your action implementation is watching okay() to know if it has been cancelled, and you must trigger finished() when your wind-down or cleanup is finished.
-
ConstActivityIdentifierPtr identifier() const
Activity identifier for this action. Used by the EasyFullControl API.
-
void update_remaining_time(rmf_traffic::Duration remaining_time_estimate)