st_topic_publisher.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import roslib; roslib.load_manifest('iri_common_smach')
00004 import rospy
00005 import smach
00006 import smach_ros
00007 
00008 class TopicPublisher(smach.State):
00009     def __init__(self, topic, msg_type):
00010         smach.State.__init__(self, outcomes=['finish'],
00011                                    input_keys=['msg'])
00012         self.topic    = topic
00013         self.msg_type = msg_type
00014 
00015     def execute(self, userdata):
00016         # Log the PCL
00017         pub = rospy.Publisher(self.topic, self.msg_type,  None, False, True)
00018         pub.publish(userdata.msg)
00019         return 'finish'


iri_common_smach
Author(s): Jose Luis Rivero
autogenerated on Fri Dec 6 2013 21:05:19