-
 

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 :

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ía, ipa-led

0.0.3 (2017-09-06)

  • Merge pull request #33 from ipa-nhg/Rename Rename packages
  • rename ssm_tutorial to airbus_ssm_tutorial
  • renamed ssm_core to airbus_ssm_core
  • Contributors: Nadia Hammoudeh García, ipa-nhg

0.0.2 (2017-09-05)

  • Changed error display to give the name of the state and the name of the problem Fixing a test if an attribute is given without is expr set.
  • add the feedback to the action server
  • changed some error messages
  • created a launch for the action server
  • fixed the cmakelists files and removed the executable file in the source
  • added an action server for scxml execution
  • added a test to make both way working
  • moved the empty state to the ssm_state file
  • re-organized the main function to be a bit more clear
  • Added license files
  • Changed order in the the licensing header
  • added Airbus to the licensing header
  • added licensing apache2.0 header
  • update and anify package.xml files
  • unnecessary re-declaration of param. gui_plugin should still work.
  • changed the launch file and the node / main to get the argument for the file you want to use
  • fixed a named changed
  • removed last reference to airbus_pyqt_extend
  • some changes to set the default log path to be at /tmp/ and removed the ssm_log dir
  • removed a dependacy to airbus_pyqt_extend
  • changed the skill provider so in doesn't depend on airbus_pyqt_extend lib
  • fixed launch files
  • fixed setup and CMakeLists / package.xml
  • removed executable parts of main and interpreter and tranfered it to a node file (good practice).
  • add install for ssm_main
  • added the readme on airbus_ssm_core
  • added the parameter to the launchs files
  • changed the syntax of the test
  • added a "ssm_enable_log" parameter to enable or disable the log
  • changed the default path for interpreter and main
  • changed the launch file to the default scxml
  • created a default scxml file and a empty skill register for test purposes
  • moved test skills and test.scxml from core to tutorial
  • Removed all hardware specific plugins and dashboard, cleaning up all the hardware specifics launchs / configs files
  • Review CMakelists and package files
  • added needed dependencies packages
  • Contributors: ipa-led, ipa-nhg

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

Launch files

Messages

No message files found.

Services

Plugins

No plugins found.

Recent questions tagged airbus_ssm_core at Robotics Stack Exchange