13 from geometry_msgs.msg
import Twist
14 from std_msgs.msg
import String
21 implements a rotating motion. 25 def __init__(self,cmd_vel_topic,log_topic, freq, accl):
26 threading.Thread.__init__(self)
27 self.
pub_cmd = rospy.Publisher(cmd_vel_topic,Twist)
28 self.
pub_log = rospy.Publisher(log_topic,String)
50 start = rospy.get_rostime()
54 self.
rate = rospy.Rate(freq)
56 theta_dot_dot = self.
accl 57 msg =
"Time : " + str(rospy.get_rostime().secs) +
" Vel : " +str(twist.angular.z)
58 while not rospy.is_shutdown()
and not self.
_stop:
59 twist.angular.z = twist.angular.z + ( 1.0 / freq ) * theta_dot_dot
60 msg =
"Time : " + str(rospy.get_rostime().secs) +
" Vel : " +str(twist.angular.z)
62 self.pub_cmd.publish(twist)
65 self.pub_cmd.publish(twist)
70 self.pub_log.publish(t)
def __init__(self, cmd_vel_topic, log_topic, freq, accl)