-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gazebo_plugins fix inverted left and right wheel #397
gazebo_plugins fix inverted left and right wheel #397
Conversation
Left and right wheel are inverted - if you put in the real right wheel in the previous state of the plugin the robot drives into the opposite direction. Also the formula in another book of the same author says sr-sl instead of sl-sr. (found online with Google). Did not find the one where it is on page 337 btw. I tested encoder and world for odometry - seems to work fine.
Guys, any comments? Guess that Travis Error is not my fault: Policy CMP0046 is not set: Error on non-existent dependency in My code does just change a few lines of the cpp. They compile for me without error. |
I think that warning is not related to this PR. |
This depends on coordinate frames and sign conventions. Has anyone else experienced this issue? |
It is related to #317 |
thanks, I hadn't noticed the link to that issue. |
You're welcome. ;-) |
We worked around this issue in our example code like so: https://github.com/osrf/rosbook/blob/master/code/tortoisebot/tortoisebot_nav.urdf#L155-L156. I'm pretty sure that it's just always been backward. I suppose that there's a risk of fixing this problem and then breaking everybody who's been working around it. |
That's what I'm worried about, that the "fix" will break everyone's code. |
Well we could put a invert wheels setting which is currently set on standard with a warning when you not set it ... |
Instead of calling it "invert wheels", perhaps we could just be explicit about the coordinate frame it's using. I think the current setting is "correct" if the coordinate frame has the Z axis pointing down, which is actually not uncommon for vehicles: |
More like z_axis_direction (up/down) then? But I wonder, I tried to rotate my wheels to whatever, it never worked for me ... Is there a working example somewhere where the right wheel is actually the right and left the left and it works correctly with cmd_vel message? |
Is there a canonical definition of the coordinate frame for the |
REP 105 defines the frames used with mobile platforms: http://www.ros.org/reps/rep-0105.html#coordinate-frames. And REP 103, referenced from 105, further specifies that Z should be up: http://www.ros.org/reps/rep-0103.html#coordinate-frame-conventions. |
So then I guess the question is more like how to call the parameter that everyone does not need to fix it in his code but gets a warning ...what about "legacy_mode" ? |
Would you agree on this:
|
@cyborg-x1 That approach seems to me like the best path forward. We'll have to decide how long to let this warning sit before switching the default behavior, and whenever we do that, we'll surely still break some systems where they didn't notice or care about the warning. But I don't see a better alternative. |
I changed my code and tested it with my robot model in Gazebo. Works for me in both ways. New and legacy mode (when swapping the wheels). |
Anything else I need to do? Otherwise it could be merged, I guess |
This looks good to me. Thanks. |
Can someone make sure that this change gets noted in the Migration guide? http://wiki.ros.org/kinetic/Migration |
Working on it now. |
migration guide updated. |
Left and right wheel are inverted - if you put in the real right wheel
in the previous state of the plugin the robot drives into the opposite direction.
Also the formula in another book of the same author says sr-sl instead of sl-sr.
(found online with Google). Did not find the one where it is on page 337 btw.
I tested encoder and world for odometry - seems to work fine.