Robotics StackExchange | Archived questions

How to move a differential drive robot to target Co-ordinates?

I want to move a differential drive robot to a target co-ordinate(X = 50, Y = -50 ) from home position (X=0, Y=0) and return back to home position. The max distance the robot has to move is 20 meters.

I don't want to complicate it using navigation stack because it is very simple application. How to accomplish this in ROS using odometry feedback.

Asked by Kishore Kumar on 2016-11-02 15:30:09 UTC

Comments

Answers

Every update step you could find the transform of the target frame in your robot vehicle frame, and then extract the x linear distance to the target, and the yaw rotation (see http://answers.ros.org/question/246991/get-rotation-between-two-frames/ for a recent example), and give your differential drive a linear x command proportional to the x distance and an angular z command proportional to the yaw. Ideally your differential drive accepts a cmd_vel Twist message and that linear x and angular z go straight into it.

Asked by lucasw on 2016-11-03 10:38:12 UTC

Comments

If your drive doesn't take Twist messages but rather individual wheel values, you can use the code from my cmd_vel linear and angular relationship post.

Asked by kramer on 2016-11-04 07:38:37 UTC