12 from geometry_msgs.msg
import Twist
13 from std_msgs.msg
import String
20 implements a rotating motion. 45 def init(self, yaw_rate, number_of_turns=-1):
53 self.cmd_vel_publisher.unregister()
60 Drop this into threading.Thread or QThread for execution 63 rospy.logerr(
"Kobuki TestSuite: already executing a motion, ignoring the request")
67 start = rospy.get_rostime()
72 rotate_count = max_rotate_count
74 while not self.
_stop and not rospy.is_shutdown():
75 if rotate_count == max_rotate_count:
76 if twist.angular.z > 0:
82 while math.fabs(twist.angular.z) <= self.
_yaw_rate:
83 twist.angular.z = twist.angular.z + update
85 self.cmd_vel_publisher.publish(twist)
93 now = rospy.get_rostime()
94 msg =
"Rotate: " + str(now.secs - start.secs)
95 self.cmd_vel_publisher.publish(twist)
97 if not rospy.is_shutdown():
100 self.cmd_vel_publisher.publish(cmd)
def __init__(self, cmd_vel_topic)
def init(self, yaw_rate, number_of_turns=-1)