rpos::core::Action Class
Header File
rpos/core/action.h
Applies to
- Slamware
Methods
ActionStatus getStatus()
Get the current action working status. Refer to ActionStatus for details.
void cancel()
Cancel the action to let it stop working
ActionStatus waitUntilDone()
Wait the action to stop (ether finish working, been cancelled or stopped by some error). Returns the action execution result via the ActionStatus Enum.
bool isEmpty()
Check whether the current Action is an empty action. If the current action is empty, it means the SLAMWARE system is in idle state.
rpos::core::ActionID getActionId()
Retrieves the ActionID of the action.
std::string Action::getReason()
Retrieves the detailed error description text message once the Action::getStatus() method returns ActionStatusError.
| Reason Text | Available Actions | Descriptions |
|---|---|---|
"failed" |
all actions | the action just fails |
"aborted" |
all actions | the action has been aborted (been cancelled or aborted by a new action ) |
"unreachable" |
actions returned by moveTo() | there is no valid path to the destination point |
"blocked[X]"e.g. "blocked[lidar;contact]" |
actions returned by moveTo() with MoveOptionFlagKeyPoints set | action failed due to there exists obstacles in front of the robot when following virtual tracks. The X can be any combination of the following items: "lidar" : obstacle is detected by LIDAR(s) "wall" : obstacle is a virtual wall "contact" : obstacle is detected by bump sensors "depth_camera" : obstacle is detected by depth camera(s) "sonar" : obstacle is detected by ultrasonic sensor(s). If more than one above items should be included in the X, a semi-colons (;) symbol is used to join these items. |
template<class ActionT> ActionT cast()
cast a rpos::core::Action to its child class object
Example
rpos::core::Action someAction = robotPlatform.startSomeAction();
rpos::actions::MoveAction moveAction = someAction.cast<rpos::actions::MoveAction>();