(!) 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
   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

Wiki: rcommander_core/tutorials/Using a Saved State Machine in Your Code (last edited 2012-04-12 21:50:39 by HaiDNguyen)