simple_publisher.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 """
00004  usage: %(progname)s <track_file1.txt> .. 
00005 """
00006 
00007 import roslib; roslib.load_manifest('articulation_models')
00008 import rospy
00009 from articulation_models.track_utils import *
00010 
00011 def main():
00012   rospy.init_node('simple_publisher')
00013   pub = rospy.Publisher('track', TrackMsg)
00014 
00015   for id,filename in enumerate(rospy.myargv()[1:]):
00016     track = readtrack(filename)
00017 
00018     loop = rospy.get_param("~loop",False)
00019     while True:    
00020       rospy.sleep(2)
00021       for i in range(1,len(track.pose)):
00022         print filename,i
00023         msg = sub_track(track, 0, i)
00024         msg.pose = zero_start(msg.pose)
00025         msg.id = id
00026         pub.publish(msg)
00027         rospy.sleep(0.05)
00028         if rospy.is_shutdown():
00029           exit(0)
00030       if not loop:
00031          break
00032 
00033 if __name__ == '__main__':
00034   main()
00035 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


articulation_models
Author(s): Juergen Sturm
autogenerated on Wed Dec 26 2012 15:35:18