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

Collision WorldPose does not get updated. #1124

Open
osrf-migration opened this issue Mar 22, 2014 · 14 comments
Open

Collision WorldPose does not get updated. #1124

osrf-migration opened this issue Mar 22, 2014 · 14 comments
Labels
all bug Something isn't working critical

Comments

@osrf-migration
Copy link

Original report (archived issue) by Andrei Haidu (Bitbucket: ahaidu).


During simulation Collision::GetWolrdPose does not get updated.

Here is a testing piece of code:

#!c++
		physics::Link_V _links = this->world->GetModel("box")->GetLinks();

		for (unsigned int i = 0; i < _links.size(); i++)
		{
			std::cout << "link name: " << _links.at(i)->GetName() << " pose: " << _links.at(i)->GetWorldPose().pos << std::endl;

			physics::Collision_V _colls = _links.at(i)->GetCollisions();

			for (unsigned int i = 0; i < _colls.size(); i++)
			{
				std::cout << "coll name: " << _colls.at(i)->GetName() << " pose: " << _colls.at(i)->GetWorldPose().pos << std::endl;
			}
		}

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.

@osrf-migration
Copy link
Author

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.

@osrf-migration
Copy link
Author

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.

@osrf-migration
Copy link
Author

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?

@osrf-migration
Copy link
Author

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.

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


See pull request #1049

@osrf-migration
Copy link
Author

Original comment by Jonathan Bohren (Bitbucket: jbohren).


I just ran into this, too.

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • changed state from "new" to "resolved"

Resolved in pull request #1049

@osrf-migration
Copy link
Author

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:

  • model: model_box
    • link1: link_green_blue
      • collision1: collision_green
      • collision2: collision_blue
    • link2: link_orange
      • collision1: collision_orange

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:
collision_issue.png

@osrf-migration
Copy link
Author

Original comment by Andrei Haidu (Bitbucket: ahaidu).


  • changed state from "resolved" to "open"

@osrf-migration
Copy link
Author

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.

@osrf-migration
Copy link
Author

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

@osrf-migration
Copy link
Author

Original comment by Roxana Leontie (Bitbucket: rleontie).


Issue #1415 was marked as a duplicate of this issue.

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • set version to "all"

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • changed state from "open" to "new"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all bug Something isn't working critical
Projects
None yet
Development

No branches or pull requests

1 participant