ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I decided to use an xml configuration file to build SMACH trees.
Here is an example:

<tasks>
  <task label="movetest">
    <sequence loops="10">
      <subtask label="gohome" />
      <concurrent>
        <action node="AxisX1" cmd="Goto" pos="0.2"/>
        <action node="AxisX2" cmd="Goto" pos="-0.3"/>
      </concurrent>
      <sequence>
        <action node="AxisX1" cmd="Goto" pos="0.5"/>
        <delay seconds="1.2"/>
        <action node="AxisX2" cmd="Goto" pos="-0.1"/>
      </sequence>
    </sequence>
  </task>
  <task label="gohome">
    <concurrent>
      <action node="AxisX1" cmd="Goto" pos="0.0"/>
      <action node="AxisX2" cmd="Goto" pos="0.0"/>
    </concurrent>
  </task>
</tasks>

Comments:

  • the "gohome" and "movetest" tasks becomes toplevel states in a SMACH state machine. These tasks can be executed by referring to their name,
  • a task may reference another task (subtask)
  • action tags translate to a SimpleActionState with conventions on what action server to call based on attributes "node" and "cmd"
  • sequence and concurrent tags translate into SMACH sequence and concurrence containers