Update IR intensity sensor frame ID handling#246
Open
tanjammvo wants to merge 1 commit into
Open
Conversation
Author
|
I think also that the fix can be applied to other branches/ROS distributions. |
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.
Description
The topic /ir_intensity publishes a vector containing a single intensity message instead of 7, even though there are 7 IR sensors.
The node that publishes the intensity value of each IR sensor individually publishes the message
without a frame_id . Therefore, the readings from all IR sensors share the "same" frame_id .
create3_sim/irobot_create_ignition/irobot_create_ignition_toolbox/src/sensors/ir_intensity.cpp
Lines 56 to 77 in 6a8bc44
Subsequently, the node that aggregates these individual intensity values into a vector stores them in a map using the frame_id as the key. Consequently, every time this node receives a new reading from any of the IR sensors, it overwrites the same position in the map. The vector publisher node then periodically iterates through this map, builds a vector from its contents (resulting in only one intensity message), and publishes it to /ir_intensity .
create3_sim/irobot_create_common/irobot_create_nodes/src/ir_intensity_vector_publisher.cpp
Lines 54 to 65 in 6a8bc44
Fixes #209
The node publishing intensity values uses now frame_id according the TF tree.
Correct also the world name inside maze.sdf. maze instead of default. Otherwise /ir_intensity will not work with the world maze.
create3_sim/irobot_create_ignition/irobot_create_ignition_bringup/worlds/maze.sdf
Line 2 in 6a8bc44
Type of change
How Has This Been Tested?
Tests were conducted by launching the simulation as described in the documentation, and the verification of IR intensity values was done using PlotJuggler to ensure the correct structure of the intensity vector and the correctness of the range values.
Checklist