This repository was archived by the owner on Feb 3, 2025. It is now read-only.
Fix sensor update rate throttling when new sensors are spawned#2784
Merged
Fix sensor update rate throttling when new sensors are spawned#2784
Conversation
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
ahcorde
reviewed
Jul 10, 2020
ahcorde
approved these changes
Jul 10, 2020
Contributor
ahcorde
left a comment
There was a problem hiding this comment.
LGTM, just remove the changes in gazebo/rendering/Visual.cc. i will open a PR to fix it separately
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
ahcorde
approved these changes
Jul 13, 2020
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
There is an issue with sensor manager's update loop throttling. When a world is loaded, the sensor manager figures out the max update rate from all the sensors in the world. However, when a new sensor is spawned after the world is loaded, this max update rate is never updated. This causes a problem for example when later spawning a sensor with an update rate higher than all the existing sensors in the world, this new sensor would never hit its target update rate.
This PR adds a flag (global variable,
g_sensorsDirty, to avoid breaking ABI) to detect when sensors are added or removed, and recalcuates the sensor manager's max update rate when the flag is dirty.The bug only affects non-rendering sensors, e.g. imu, ray sensor, etc
To manually test this, you can:
hokuyomodel from gazebo model database, e.g. by inserting it from gazebo's Insert tab on the left~/.gazebo/models/hokuyoto~/.gazebo/models/hokuyo_newand change the update rate inmodel.sdfand also remember to give it a new name inmodel.configLaserStampedmsg typeSigned-off-by: Ian Chen ichen@osrfoundation.org