merose/diff_drive

Wrong formula of ''b''?

TrinhNC opened this issue · 5 comments

According to the Autonomous Mobile Robots book, the formula is:
b = - (cur.theta + a)
why in your code it is:
b = cur.theta + a - goal.theta

I understand the sign is changed for simpler Math but why minus the goal.theta?
By the way, I am trying to move the robot (R2D2 [http://wiki.ros.org/urdf/Tutorials/Building%20a%20Visual%20Robot%20Model%20with%20URDF%20from%20Scratch]) but the controlling part for angular velocity is really bad when the robot tries to move to a point behind it. It keeps rotating until it falls down. Do you have any suggestions?

Thanks for using the package. I threw this together to test parameter changes for navigation, so it's a bit rough. I'll look into both issues. I've known about the negative velocity problem but didn't need to fix it for my work. Now that I know someone is using this, I'll look into it.

I've augmented unit tests to include backward movement. Also, the formula for "b" matches that in Autonomous Mobile Robots. Note that the code allows G_theta to be nonzero, whereas Autonomous Mobile Robots assumes G_theta==0.

Should be fixed in commit a81b615.

Reopening because of more problems found.

Fixed in commit 61d1c92. Added a demo launch file for simulating a robot following navigation goals.

Found a new issue with reverse movement while testing for RoboGames 2018. Creating a new issue for that instead of this, since it's not related to the formula for "b", but commenting here so watchers will be notified.