tool_template.py
Go to the documentation of this file.
00001 #import roslib; roslib.load_manifest('rcommander_core')
00002 import rospy
00003 from PyQt4.QtGui import *
00004 from PyQt4.QtCore import *
00005 import tool_utils as tu
00006 import smach
00007 
00008 
00009 class MyTool(tu.ToolBase):
00010 
00011     def __init__(self, rcommander):
00012         tu.ToolBase.__init__(self, rcommander, 'base_node_name', 'Button Name')
00013         pass
00014 
00015     def fill_property_box(self, pbox):
00016         pass
00017 
00018     def _create_node(self, name=None):
00019         if name == None:
00020             nname = self.name + str(self.counter)
00021         else:
00022             nname = name
00023         pass
00024 
00025     def _node_selected(self, my_node):
00026         pass
00027 
00028     def reset(self):
00029         pass
00030 
00031     def get_smach_class(self):
00032         pass
00033 
00034 class MyState(smach.State, tu.StateBase): 
00035 
00036     def __init__(self, name, sleep_time):
00037         self.name = name
00038         self.__init_unpicklables__()
00039         pass
00040 
00041     def execute(self, userdata):
00042         pass
00043 
00044     def __init_unpicklables__(self):
00045         tu.StateBase.__init__(self, self.name)
00046         smach.State.__init__(self, outcomes = ['done'], input_keys = [], output_keys = [])
00047 
00048     def __getstate__(self):
00049         state = tu.StateBase.__getstate__(self)
00050         my_state = [self.name] #Change this
00051         return {'state_base': state, 'self': my_state}
00052 
00053     def __setstate__(self, state):
00054         tu.StateBase.__setstate__(self, state['state_base'])
00055         self.name = state['self'][0] #Change this
00056         self.__init_unpicklables__()
00057 
00058 
00059 


rcommander
Author(s): Hai Nguyen (haidai@gmail.com)
autogenerated on Thu Nov 28 2013 11:46:34