rosaction

Retrieve information about ROS actions

Syntax

rosaction list
rosaction info actionname
rosaction type actionname
actionlist = rosaction("list")
actioninfo = rosaction("info",actionname)
actiontype = rosaction("type",actionname)

Description

example

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

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.

Connect to a ROS network. You must be connected to a ROS network to gather information about what actions are available. Action types must be set up beforehand with a ROS action server running on the network. Replace ipaddress with your network address.

ipaddress = '192.168.154.131';
rosinit(ipaddress)
Initializing global node /matlab_global_node_87036 with NodeURI http://192.168.154.1:62768/

List the actions available on the network. The only action setup 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.154.131:38213/)

Action Clients: None

Disconnect from the ROS network.

rosshutdown
Shutting down global node /matlab_global_node_87036 with NodeURI http://192.168.154.1:62768/

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 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.

Introduced in R2016b