Turtlebot moving around and ROS one cycle timer

asked 2016-03-24 11:01:12 -0500

mkorkmaz gravatar image

Hi All!

I am not sure how to move Turtlebot around it. Normally, it is possible to use keyboard_teleop launch file and pressing the button like "L" etc. I want to do this by publishing my own twist messages.

I try to use code such as self.twist.angular.z = 0.5 self.cmd_vel_pub.publish(self.twist) but it is moving around and going forward. But I dont want it to go forward and I want it to do the job like a keyboard_teleop.launch file "L" keyboard input.

My second question is can I meausere the time of one cycle of ROS. For example, in Matlab it is easy to do it by putting tic-toc commands on the top and bottom. So is there similar a command for ROS?

My third question is should I use to rospy.get_time() for keeping the rostime from start to end. For example, I want to say to my robot to go forward in the time range 0-10 after that between 10 and 20 time ranges to move its around like keyboard_teleop.launch "L" keystroke.

(I am using indigo and python.)

Thank you very much in advance

edit retag flag offensive close merge delete