Main Content

Monitor Action Goal

Monitor action goal in ROS 2 network

Since R2024a

  • ROS 2 Monitor Action Goal block icon

Libraries:
ROS Toolbox / ROS 2

Description

The Monitor Action Goal block enables you to monitor the status, feedback and result of an active action goal in a ROS 2 network. This block accepts the UUID input as a Simulink non-virtual bus of unique_identifier_msgs/UUID message type.

To use this block, you must have a paired Send Action Goal block of a matching action name and type. Selections made in the Send Action Goal block are automatically synchronized with the Monitor Action Goal block.

You can use this block to monitor these states of the action goal after it is accepted by an action server.

ROS 2 Action Client Monitor Goal State

Ports

Input

expand all

Unique ID dedicated to any goal message, specified as a non-virtual bus of message type unique_identifier_msgs/UUID.

Data Types: bus

Output

expand all

Execution status of action goal corresponding to the UUID input, specified as an integer.

Error CodeCondition
-1The action server rejected the goal.
0The action server accepted the goal but failed to set the status properly. This implies unknown status of the goal message.
1The action server accepted the goal and is awaiting execution. This implies the accepted status of the goal message.
2The action server accepted the goal and is currently in the process of execution. This implies the executing status of the accepted goal message.
3The action server has accepted the cancel goal request initiated by the action client. This implies the canceling status of the accepted goal message.
4The action server completed the goal successfully. This implies the succeeded status of the accepted goal message.
5The action server canceled the goal based on an external request sent by the action client. This implies the canceled status of the accepted goal message.
6The action server terminated the goal without an external request sent by the action client. This implies the aborted status of the accepted goal message.

Data Types: int8

Result message associated with a particular action goal, specified as a non-virtual bus.

Data Types: bus

Feedback message associated with a particular action goal, specified as a non-virtual bus.

  • When a feedback message is available at a particular time step, the Feedback port outputs the latest feedback.

  • When a feedback message is not available at a particular time step, the Feedback port outputs the last known feedback.

Dependencies

This output is enabled when the Show Feedback output port is checked.

Data Types: bus

Error conditions while monitoring an action goal, specified as an integer.

Error CodeCondition
0The action client sent the goal successfully and the action server accepted the goal.
1The action client sent the goal but the action server rejected the goal.
2The UUID input is invalid but the action server is available.
3The action client failed to send the goal because the action server is not available.

Dependencies

This output is enabled when the Show ErrorCode output port is checked.

Data Types: uint8

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Action name inherited from paired Send Action Goal block, specified as a character vector.

Action type inherited from paired Send Action Goal block, specified as a character vector.

Path to the Send Action Goal block paired with this Monitor Action Goal block. To create a paired Send Action Goal for the first time, click Create paired Send Action Goal block.

After you create a paired Send Action Goal block, clicking the path displays and highlights the Send Action Goal block in your model.

Tips

  • For correct action client implementation, use only Create paired Send Action Goal block to create the Send Action Goal associated with this Monitor Action Goal block. Adding a Send Action Goal block from the library is not recommended.

Check this box to enable the Feedback output.

Check this box to enable the ErrorCode output. If an error condition occurs, the Result port outputs a blank message.

Extended Capabilities

Version History

Introduced in R2024a