Go to the documentation of this file.00001
00002
00003 import roslib; roslib.load_manifest('people_velocity_tracker')
00004 import rospy
00005 import sys
00006 from people_msgs.msg import Person, People
00007
00008 class VelocityTracker:
00009 def __init__(self):
00010 self.ppub = rospy.Publisher('/people', People)
00011
00012 def spin(self):
00013 rate = rospy.Rate(10)
00014 while not rospy.is_shutdown():
00015 pv = Person()
00016 pl = People()
00017 pl.header.stamp = rospy.Time.now()
00018 pl.header.frame_id = '/base_link'
00019 pv.position.x = float(sys.argv[1])
00020 pv.position.y = float(sys.argv[2])
00021 pv.position.z = .5
00022 pv.velocity.x = float(sys.argv[3])
00023 pv.velocity.y = float(sys.argv[4])
00024 pv.name = 'asdf'
00025 pv.reliability = .90
00026 pl.people.append(pv)
00027
00028 self.ppub.publish(pl)
00029 rate.sleep()
00030
00031 rospy.init_node("people_velocity_tracker")
00032 vt = VelocityTracker()
00033 vt.spin()