[Documentation] [TitleIndex] [WordIndex

(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Using a Saved State Machine in Your Code

Description: Guides you through the process of loading a state machine saved to disk in your code.

Tutorial Level: INTERMEDIATE

RCommander includes a simple facility for integrating saved RCommander behaviors into existing code. To do this, simply call the load static method on the class GraphModel as illustrated below.

   1 import rcommander.graph_model as gm
   2 import sys
   3 
   4 filename = sys.argv[1]
   5 graph = gm.GraphModel.load(filename)
   6 state_machine = graph.create_state_machine(robot=None)
   7 #state_machine is now an instance of smach.StateMachine


2019-12-07 13:00