Skip to content

Move turtlebot to a specific point using script.

Sakshi Kakde edited this page Dec 23, 2017 · 7 revisions

Refer the link:http://learn.turtlebot.com/2015/02/01/14/
The pose of the robot is given by (X, Y, theta).For simplicity, the script can take the robot to a specific point (X, Y) but the orientation of the robot is not controlled.The orientation of the robot at the start of mapping is considered as 0 degrees.Thus the pose of the robot with which we start the mapping is (0,0,0).
To control te orientation of the robot, refer:http://learn.turtlebot.com/2015/02/01/26/
Add the following lines to goforward_and_avoid_obstacle.py. turtlebot_orientation_in_degrees = 90
#convert euler to quaternion and save in new variable quat
quat = transformations.quaternion_from_euler(0, 0, math.radians(turtlebot_orientation_in_degrees))
position = {'x': -0.54, 'y' : -1.66}
quaternion = {'r1' : quat[0], 'r2' : quat[1], 'r3' : quat[2], 'r4' : quat[3]}

NOTE: Do not forget to include
from tf import transformations
import math