Fix left/right reversal in odometry update #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.