Repository navigation
Fix Obj_DistLat decode offset (-204.8 m to -204.6 m) - #10
Open
jayden1711 wants to merge 1 commit into
Open
jayden1711 wants to merge 1 commit into
jayden1711 wants to merge 1 commit into
Conversation
Author
|
The Build and test workflow is waiting on maintainer approval to run. Main also fails in its ROS 2 lyrical job, unrelated to this change. Is anything else needed for review? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Obj_DistLat decode macro used an offset of -1024 * 0.2 = -204.8 m. The ARS408 DBC says -204.6 m, and so do
START_(1023) andOFF_(-1023) for the same signal in this header. This changes theCALC_Obj_1_General_Obj_DistLatmacro to -1023, so raw 1023 decodes to 0 m and every object's lateral distance moves up by 0.2 m.Replay before the change: with the node built at e451f4d, raw 1023 was published as y = -0.200 where the DBC expects 0.000. The same -0.200 m bias was there at raw 0, 1013, 1033, 1523 and 2047.
Replay after the change: I did not rebuild the whole node. I compiled the new test below against the patched header and it passes. Before the patch the same test fails with -0.2 for raw 1023, -204.8 for raw 0 and 204.6 for raw 2047.
The test is
test/test_can_defines.cpp. It sets raw values with the header's SET_ macro and checks that the decoded values are 0, -204.6 and 204.8 m for raw 1023, 0 and 2047. It does not need vcan or ROS, so it also runs whenCIis set. I ran it with g++ and Catch2 v3.4.0 in a ROS jazzy container. I did not run it through colcon.I only touched the Obj_DistLat macro. The Cluster_DistLat macro has a similar mismatch with its
OFF_value, but the node does not decode clusters, so I left it alone.Fixes #9 (fill in the number of the issue)
I can adjust this if you'd prefer a different approach.