fix(vision): correct LCM serialization for detection class_id and results_length#1368
Open
jongmoon-konglabs wants to merge 3 commits intodimensionalOS:mainfrom
Open
Conversation
Contributor
Greptile SummaryFixed critical LCM serialization bugs that prevented detection data transmission. The PR correctly addresses three issues: converts Key Changes:
Minor Note: Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 1c0ff7d |
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.
Problem
The robot's detection data was not being correctly transmitted via LCM due to two primary serialization bugs:
ObjectHypothesis.class_idis defined as a string in the LCM schema, but we were passing an int. This caused anAttributeError: 'int' object has no attribute 'encode'during the lcm_encode() process.results_lengthin the Detection2D message was either hardcoded or incorrectly handled, leading to empty detection arrays or index errors during deserialization.Solution
ROSDetection2Dmessage creation to setresults_length=len(results)dynamically, ensuring the LCM library knows exactly how many objects to serialize.Breaking Changes
None
How to Test