osrf / rosbook

Example code to accompany the book Programming Robots with ROS
Apache License 2.0
484 stars 236 forks source link

Possibly incorrect wheel arrangement on Tortoisebot #25

Closed gbiggs closed 7 years ago

gbiggs commented 8 years ago

This assumes that the front of the Tortoisebot robot is the end with the caster (based on Figures 17-7 and 17-9).

Code sample 16-10, in chapter 16, adds a differential drive controller to the simulated tortoisebot. But when the reader controls the robot, it turns left when told to turn right and vice versa. This leads on to the navigation system getting very confused and the examples towards the end of chapter 17 failing.

This is caused by the following two lines in the URDF file (from the differential_drive_controller plugin part):

<leftJoint>left_wheel_joint</leftJoint> <rightJoint>right_wheel_joint</rightJoint>

It looks like the differential_drive_controller counter-intuititvely expects the left and right wheel joints to be around the other way:

http://gazebosim.org/tutorials?tut=ros_gzplugins#DifferentialDrive

Changing the above two lines accordingly makes the robot steer correctly, and allows the navigation examples to work.

<leftJoint>right_wheel_joint</leftJoint> <rightJoint>left_wheel_joint</rightJoint>

gerkey commented 7 years ago

Yeah, this was a bug in the diff drive plugin. I couldn't bear to have the text be backward, so I made it look right (but be wrong), while the code in the repo was right (but looked wrong).

This is all being addressed in the reprint that we're working on now, thanks to the fact that that plugin in Kinetic has a legacyMode tag that you can set to false to disable the old backward behavior!