Open osrf-migration opened 10 years ago
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
Does the model have multiple links? I'm asking because I see different Entity::SetWorldPose*
functions used for models, canonical links, and everything else
(see end of Entity::Load).
So I'm wondering if SetWorldPoseDefault is broken, in which case non-canonical links should have a static world pose as well.
Original comment by Andrei Haidu (Bitbucket: ahaidu).
I first noticed it with a model with multiple links, and then tested it as well on a model with one link one collision. Both had the same issue.
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
I can confirm that Collision::GetWorldPose()
is not returning an updated value.
Maybe Entity::UpdatePhysicsPose is where it should happen? There would be a performance impact, though, to cache the pose of all collisions and visuals in a model.
@nkoenig what do you recommend?
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
I think the Entity::UpdatePhysicsPose
is broken. I'll try writing a test, and then a solution.
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
Resolved in pull request #1049
Original comment by Andrei Haidu (Bitbucket: ahaidu).
The issue still appears for models with multiple links. I have installed gazebo from default (currently version 4.0.0).
I am using for testing a model with 2 links. First link has 2 collision, second link 1 collision:
The second collision doesn't get updated. Only when manually moving it with the mouse, and then only for one iteration.
Testing code:
#!c++
// DEBUG collision issue
physics::ModelPtr box = this->world->GetModel("box");
std::cout << "model name: '" << box2->GetName()
<< "' --> world pos: " << box2->GetWorldPose().pos << std::endl;
// get all links from the model
physics::Link_V _links = box2->GetLinks();
// iterate through all the links
for (physics::Link_V::iterator l_iter = _links.begin();
l_iter != _links.end(); ++l_iter)
{
// get all collisions of the link
physics::Collision_V _collisions = l_iter->get()->GetCollisions();
std::cout << "\t link name: '" << l_iter->get()->GetName()
<< "' --> world pos: " << l_iter->get()->GetWorldPose().pos << std::endl;
// iterate through all the collisions
for (physics::Collision_V::iterator c_iter = _collisions.begin();
c_iter != _collisions.end(); ++c_iter)
{
std::cout << "\t\t collision name: '" << c_iter->get()->GetName()
<< "' --> world pos: " << c_iter->get()->GetWorldPose().pos << std::endl;
}
}
Screenshot with the terminal output:
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
Can you suggest a patch for our regression test? That will make it easier to reproduce. Thanks for the report.
Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).
and reuse issue_1124 branch if possible
Your test world will go into this world folder
Original comment by Roxana Leontie (Bitbucket: rleontie).
Issue #1415 was marked as a duplicate of this issue.
Original report (archived issue) by Andrei Haidu (Bitbucket: ahaidu).
During simulation Collision::GetWolrdPose does not get updated.
Here is a testing piece of code:
During the simulation while the object is moving the link poses change, and the collisions maintain their original position.
Testing works with a simple box model.