No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.
No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 0.0.4
License Apache 2.0
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ipa320/airbus_coop.git
VCS Type git
VCS Version master
Last Updated 2017-10-17
Dev Status MAINTAINED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

The airbus_ssm_core package

Additional Links

No additional links.

Maintainers

  • Ludovic Delval

Authors

  • Ludovic Delval

airbus_ssm_core : Smart State Machine (SSM)

This repository holds a SMACH overhaul including an interpretor of SCXML files.(SCXML standard). It creates a finite state machine (based on SMACH) using the data on the scxml. It can be usefull if you want to create a state machine using a GUI that generate a SCXML file like : * QT SCXML Editor Plugin * SCXMLGui

Contents

  1. Basic creation of a SCXML file
  2. Execution

1. Basic creation of a SCXML file:

This is the SCXML file from the ssm_tutorial1

<?xml version="1.0" encoding="UTF-8"?>
<scxml initial="Input Number">
    <datamodel>
        <data id="skill_file" expr="${airbus_ssm_tutorial}/resources/skills.xml"/>
    </datamodel>
    <state id="Input Number">
        <datamodel>
            <data id="skill" expr="Input"/>
        </datamodel>
        <transition event="Out" target="Primes"/>
        <transition event="Test" target="IsPrime"/>
        <transition event="Retry" target="Input Number"/>
    </state>
    <state id="Primes">
        <datamodel>
            <data id="skill" expr="Primes"/>
        </datamodel>
        <transition event="Off" target="End"/>
        <transition event="Reset" target="Input Number"/>
        <transition event="Continue" target="Input Number"/>
    </state>
    <state id="IsPrime">
        <transition type="external" event="Return" target="Input Number"/>
        <datamodel>
            <data id="skill" expr="isPrime"/>
        </datamodel>
    </state>
    <final id="End"/>
</scxml>

If you want to learn more about the SCXML format, check : SCXML standard.

To link a SCXML State to a Python SSM State (an overhaul of the SMACH State) there is two things to do :

  1. Give a skill register file in the datamodel at the root level.
<?xml version="1.0" encoding="UTF-8"?>
<scxml initial="Input Number">
     <datamodel>
        <data id="skill_file" expr="${airbus_ssm_tutorial}/resources/skills.xml"/>
    </datamodel>
    ...
</scxml>

The skill register file contains informations to find the Python SSM State classes you want to use inside the SCXML.

For example the skill.xml of the ssm_tutorial :

<?xml version="1.0"?>
<skills>
    <skill name="Input"     pkg="airbus_ssm_tutorial"   module="airbus_ssm_tutorial1.skills"    class="Input"/>
    <skill name="isPrime"   pkg="airbus_ssm_tutorial"   module="airbus_ssm_tutorial1.skills"    class="isPrime"/>
    <skill name="Primes"    pkg="airbus_ssm_tutorial"   module="airbus_ssm_tutorial1.skills"    class="Primes"/>
</skills>

Content of a skill in the skill.xml file : * 'name' : The name you want to use inside the SCXML. It can be different from the class name. * 'pkg' : The python package where the python file containing the class is located. * 'module' : The python path to the file containing the class. * 'class' : The class name of the SSMState.

  1. Set a SSMState on your SCXML state using a data in the datanodel of the SCXML state.
<state id="IsPrime">
    <datamodel>
        <data id="skill" expr="isPrime"/>
    </datamodel>
    ...
</state>

Using the 'id' "skill" and set the 'expr' value to the name of the skill you want to use. You create a link between the python SSMState and the SCXML state. This also mean that you have to link every outcome of this SSMState inside the SCXML. If you forget to link one, them the State Machine Constitency check will fail.

To help you know every outcomes of each SSMState, you can run the 'ssm_descriptor'. This will scan all the skill inside a skill.xml file and will give you a text file with every outcomes and user defined data key used in each skill of the file.

roslaunch airbus_ssm_core ssm_descriptor.launch skill_xml_file:=empty_register.xml output_file:=/tmp/descriptor.txt

Input parameter are: - skill_xml_file: the skill.xml file you want to scan. It should be located in the airbus_ssm_core/resources folder. If you want to put the skill.xml file in a different folder/pkg, use this syntax ${pkg_name}/directory/file.scxml - output_file: the absolute path for the outout text file.

2. Execution:

To execute a SCXML file you can use :

roslaunch airbus_ssm_core ssm.launch scxml_file:=default

Input parameter is: - scxml_file: the scxml file you want to execute. It should be located in the airbus_ssm_core/resources folder. If you want to put scxml files in a different folder, use this syntax ${pkg_name}/directory/file.scxml or you can give the pull path to the file.

For example :

roslaunch airbus_ssm_core ssm.launch scxml_file:=${airbus_ssm_core}/resources/defaulf.scxml

There is a service to 'load' a new SCXML file : - server_name + '/srv/init' (default : '/ssm/srv/init')

You can also use topics : - server_name + '/start' (default : '/ssm/start'), std_msgs/Empty. Trigger the execution of the state machine. - server_name + '/preempt' (default : '/ssm/preempt'), std_msgs/Empty. Trigger the interruption (premption) of the state machine. - server_name + '/pause' (default : '/ssm/pause'), std_msgs/Bool. If True, pause the execution of the state machine. If False, resume the execution.

To launch the SSM Simple Action Server you can use :

roslaunch airbus_ssm_core ssm_action_server.launch 

The goal are the SCXML file you want to execute using the same restriction of the input parameter scxml_file. The result is the outcome of the last executed state.

The following topics works as well during execution : - server_name + '/preempt' (default : '/ssm/preempt'), std_msgs/Empty. Trigger the interruption (premption) of the state machine. - server_name + '/pause' (default : '/ssm/pause'), std_msgs/Bool. If True, pause the execution of the state machine. If False, resume the execution.

top

CHANGELOG

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Changelog for package airbus_ssm_core ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.0.4 (2017-09-13)

  • Merge pull request #36 from ipa-led/master Added dotgraph viewer to ssm_plugin
  • removed a debug print
  • Added the dot graph viewer in the ssm plugin
  • first version not working
  • Merge remote-tracking branch \'origin/dot\'
  • Better closing of opened container (limit error risk)
  • Merge pull request #35 from ipa-led/master Improvements on the ssm_core packages
  • Added a reload of the skills during execution and a better view of syntax error in the python files
  • Merge branch \'master\' of https://github.com/ipa-led/airbus_coop into dot
  • Added line to the descriptor to be more readable
  • added ssm_descriptor into the CMakeLists
  • Added the other possible way to give a path to a file
  • add dot create to ssm_core
  • fixed the launch file for the descriptor
  • Change the tabulations by spaces
  • Changed the markdown (again)
  • changed the markdown for the name
  • Upgraded the README file
  • added a skill.xml description generator to ease the use of an SCXML Gui
  • Bug fixes for the when a state fail at the creation level.
  • Contributors: Nadia Hammoudeh Garc

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

Messages

No message files found.

Services

Plugins

No plugins found.

Recent questions tagged airbus_ssm_core at Robotics Stack Exchange

No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.