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

Fix Actor collision if loop / auto_start false #2773

Merged
merged 3 commits into from
Sep 21, 2020

Conversation

vvasco
Copy link
Contributor

@vvasco vvasco commented Jul 1, 2020

As reported here, when using the Actor Collision Plugin with this example, if loop (or auto_start) is set to false, the boxes around the actor links representing the collisions start falling around.
The problem is that in such cases, the pose of the actor is not set.
This PR proposes a fix, by setting the pose of the actor based on the last animated frame when it stops.
This is the result:

actor-coll

@chapulina chapulina self-assigned this Jul 1, 2020
@chapulina chapulina added 11 Gazebo 11 bug Something isn't working labels Jul 1, 2020
@chapulina
Copy link
Contributor

Thank you for the pull request! The code looks reasonable. I'll give it a try in the coming weeks.

@chapulina chapulina self-requested a review July 13, 2020 18:24
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Thanks again for the PR. Works for me!

I'm just going to trigger CI one more time to make sure all tests are ok. If you're motivated, it would be good to add a test to Actor_TEST exercising the fixed functionality.

@chapulina
Copy link
Contributor

@osrf-jenkins run tests please

@vvasco
Copy link
Contributor Author

vvasco commented Jul 14, 2020

Sure, I will add the test.

@vvasco
Copy link
Contributor Author

vvasco commented Jul 15, 2020

I added a test to Actor_TEST, which loads the actor collision scenario with loop set to false and :

  • checks that collisions are enabled;
  • checks that collisions remain enabled when the actor is inactive;
  • checks that links poses do not change when the actor is inactive.

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Thank you for adding the test! Some changes are needed for it to work on all systems, see below.

gazebo/physics/Actor_TEST.cc Outdated Show resolved Hide resolved
gazebo/physics/Actor_TEST.cc Outdated Show resolved Hide resolved
gazebo/physics/Actor_TEST.cc Outdated Show resolved Hide resolved
@vvasco
Copy link
Contributor Author

vvasco commented Jul 16, 2020

I updated the new version of the test.

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Thank you for iterating, this is good to go!

@chapulina chapulina merged commit 521ca50 into gazebosim:gazebo11 Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11 Gazebo 11 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants