ROS Action Client/Server

../../../../_images/ros_action_client_server.png

Within a ROS Node GenericDomainModel, a ROS Action Client or Server is represented by a GenericDomainModelPort with the following Attributes.

Attributes Value Description
Type action  
Attribute 0 force_name Use the GenericDomainModelPort’s name as the ROS Action name
Attribute 1 arg / arg_1_hyphen / arg_2_hyphen / param / remap Method used to map ROS Action names into ROS Node
Attribute 2 [msg type] ROS Action Type - e.g. Trajectory
Attribute 7 ros  

If the CyPhy Master Interpreter is run, these Attributes will be used to populate the parent ROS Node Model’s corresponding node element in the generated ROS .launch file.

For each netlist of connected ports, the Interpreter will check that the the port types all match (e.g. a ROS Topic Publisher cannot broadcast to a ROS Service Server) and that the Action Msg types (if specified) all match.

If a port’s Attribute 0 Value is force_name, then all ports on that netlist will be assigned the forcing GenericDomainModelPort’s name. If two or more ports have their Attribute 0 Value set to force_name, then one of their names will be picked at random and assigned to all ports on that netlist. Be careful using force_name.

Otherwise, a unique ROS Action name will be generated and assigned to ports in that netlist.

The ROS Action mapping method is determined by Attribute 1’s Value:

arg or [empty]

<node name=... pkg=... type=...
  args="[GenericDomainModelPort name] [action_name] ..."
/>

Unless the [GenericDomainModelPort name] ends with an underscore - e.g. count_, then the [GenericDomainModelPort name] is ommitted.

<node name=... pkg=... type=...
  args="[action_name] ..."
/>

Note

ROS Node args passed in will be sorted by [GenericDomainModelPort name] in alphanumerical order.


arg_1_hypen

<node name=... pkg=... type=...
  args="-[GenericDomainModelPort name] [action_name] ..."
/>

arg_2_hypen

<node name=... pkg=... type=...
  args="--[GenericDomainModelPort name] [action_name] ..."
/>

param

<node name=... pkg=... type=... >
  <param name="[GenericDomainModelPort name]" value="[action_name]" />
</node>

remap

<node name=... pkg=... type=... >
  <remap from="[GenericDomainModelPort name]" to="[action_name]" />
</node>