Skip to content
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

Fix left/right reversal in odometry update #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Roger-random
Copy link

SYMPTOM: When robot turns right, /odom pose orientation turns left.
(And vice versa.) However, the odom->base_link transform is correct.

CAUSE: Encoder odometry entry point update_publish(enc_left,enc_right)
is invoked with update_publish(enc1, enc2). But this is backwards. As
per cmd_vel_callback, motor 1 is the right-hand side motor and motor 2
the left-hand side.

Why does the odom->base_link transform look OK? An earlier change
added a negative sign in front of the published transform angle. This
only masked the error without fixing the underlying cause, resulting in
reversed /odom data and leaving variables like self.last_enc_right
holding the wrong values.

FIX: Reverse the parameters when calling update_publish so they are
correct. And now that the underlying problem is addressed, the negative
sign must be removed from the angle when publishing transform.

SYMPTOM: When robot turns right, /odom pose orientation turns left.
(And vice versa.) However, the odom->base_link transform is correct.

CAUSE: Encoder odometry entry point update_publish(enc_left,enc_right)
is invoked with update_publish(enc1, enc2). But this is backwards. As
per cmd_vel_callback, motor 1 is the right-hand side motor and motor 2
the left-hand side. As a result odometry calculations are reversed.

Why does the odom->base_link transform look OK? An earlier change
added a negative sign in front of the published transform angle. This
only masked the error without fixing the underlying cause, resulting in
reversed /odom data and leaving variables like self.last_enc_right
holding the wrong values.

FIX: Reverse the parameters when calling update_publish so they are
correct. And now that the underlying problem is addressed, the negative
sign must be removed from the angle when publishing transform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant