trial.py
Go to the documentation of this file.
00001 #!/usr/bin/python
00002 
00003 import roslib; roslib.load_manifest('kingfisher_node')
00004 import rospy
00005 
00006 from kingfisher_msgs.msg import Drive
00007 
00008 steps = [ 0, 0.2, 0.4, 0.6, 0.8, 1.0, 0.0 ]
00009 step_length = 150
00010 
00011 
00012 class KingfisherTrial(object):
00013     def __init__(self):
00014         rospy.init_node('kingfisher_trial')
00015         self.pub = rospy.Publisher('cmd_drive', Drive)
00016 
00017     def spin(self):
00018         r = rospy.Rate(10)
00019         step = 0
00020         count = step_length
00021         while not rospy.is_shutdown():
00022             self.pub.publish(left=steps[step], right=steps[step])
00023             count-=1
00024             if count <= 0:
00025                 count = step_length
00026                 step+=1
00027                 if step > len(steps):
00028                     return
00029             r.sleep()
00030 
00031 if __name__ == "__main__":
00032   KingfisherTrial().spin()


kingfisher_node
Author(s): Mike Purvis
autogenerated on Sat Dec 28 2013 17:08:10