Main Content

rosaction

Retrieve information about ROS actions

Description

rosaction list returns a list of available ROS actions from the ROS network.

example

rosaction info actionname returns the action type, message types, action server, and action clients for the specified action name.

rosaction type actionname returns the action type for the specified action name.

actionlist = rosaction("list") returns a list of available ROS actions from the ROS network.

actioninfo = rosaction("info",actionname) returns a structure containing the action type, message types, action server, and action clients for the specified action name.

actiontype = rosaction("type",actionname) returns the action type for the specified action name.

Examples

collapse all

Get information about ROS actions that are available from the ROS network. You must be connected to a ROS network using rosinit.

Action types must be set up beforehand with a ROS action server running on the network. You must have the set up '/fibonacci' action type. To run this action server, use the following command on the ROS system:

rosrun actionlib_tutorials fibonacci_server

Connect to a ROS network. You must be connected to a ROS network to gather information about what actions are available. Replace ipaddress with your network address.

ipaddress = '192.168.17.129';
rosinit(ipaddress,11311)
Initializing global node /matlab_global_node_04165 with NodeURI http://192.168.17.1:60617/

List the actions available on the network. The only action set up on this network is the '/fibonacci' action.

rosaction list
/fibonacci

Get information about a specific ROS action type. The action type, message types, action server, and clients are displayed.

rosaction info /fibonacci
Action Type: actionlib_tutorials/Fibonacci

Goal Message Type: actionlib_tutorials/FibonacciGoal
Feedback Message Type: actionlib_tutorials/FibonacciFeedback
Result Message Type: actionlib_tutorials/FibonacciResult

Action Server:
* /fibonacci (http://192.168.17.129:34793/)

Action Clients: None

Disconnect from the ROS network.

rosshutdown
Shutting down global node /matlab_global_node_04165 with NodeURI http://192.168.17.1:60617/

Input Arguments

collapse all

ROS action name, specified as a string scalar or character vector. The action name must match one of the topics that rosaction("list") outputs.

Output Arguments

collapse all

List of actions available on the ROS network, returned as a cell array of character vectors.

Information about a ROS action, returned as a structure. actioninfo, which contains the following fields:

  • ActionType

  • GoalMessageType

  • FeedbackMessageType

  • ResultMessageType

  • ActionServer

  • ActionClients

For more information about ROS actions, see ROS Actions Overview.

Type of ROS action, returned as a character vector.

Version History

Introduced in R2019b