Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if any entity actually has a ContactSensorData component before… #2474

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

shameekganguly
Copy link
Contributor

… calling GetContactsFromLastStep

GetContactsFromLastStep can be an expensive call if there are a lot of contact points in the scene. Currently we call this method in the Physics System when the ECM has the ContactSensorData component type. However, this will still be true if the ContactSensorData component has been removed for all entities.

I have updated the Physics System to additionally check if there is at least one entity with the ContactSensorData component before calling GetContactsFromLastStep. This enables consuming Systems to optimize their computational footprint by only adding the ContactSensorData for relevant entities when needed and remove it when not needed.

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

… calling GetContactsFromLastStep

Signed-off-by: Shameek Ganguly <[email protected]>
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Jul 12, 2024
Signed-off-by: Shameek Ganguly <[email protected]>
Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. Just one minor style comment

src/systems/physics/Physics.cc Outdated Show resolved Hide resolved
Signed-off-by: Shameek Ganguly <[email protected]>
@shameekganguly shameekganguly marked this pull request as ready for review July 12, 2024 04:52
@iche033 iche033 merged commit c4b55bd into gazebosim:gz-sim8 Jul 12, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants