How to move a turtle bot with specifc velocity
I am using gazibo simulator to simulate multiple turtlebots, I have three robots, all the robots have to move to one goal point but with different velocities. Please suggest me how to set a velocity and move the robot to the point. I am using Twist() function to set the velocity Twist().linear.x = 0.5 but its not accurate.
And more over if I increase the velocity greater than 1, the robot is not going to the target. Below is my code, please let me know what is the problem in my code:
speed = Twist()
while abs(goal1.x-x) > 0.15 and abs(goal1.y-y) > 0.2:
if abs(angle_to_goal-theta) > 0.15:
speed.linear.x = 0.0
speed.angular.z = 0.5
else:
speed.linear.x = 1.5
speed.angular.z = 0.0
pub.publish(speed)
r.sleep()
Thank you