Gazebo | Ignition | Community
Ask Your Question

Actor related information in gazebo::physics::WorldPtr and collision of actors

asked 2019-03-18 16:46:45 -0600

rayvburn gravatar image

Hello, I'm working on extending the ActorPlugin features with some reasonable movement around the simulated world. I have got a few questions which may expose some bugs in the ActorPlugin not known before. All cases described below appear with Gazebo 8 under Ubuntu 16.04.

First thing is that I use gazebo::physics::WorldPtr to lookup world objects data. The issue is that despite I set linear velocity with the SetLinearVel() method inside the ActorPlugin class - the velocity always remains (0, 0, 0) in the WorldPtr object. I noticed the same behavior with acceleration and angular velocity setters.

I acquire the world pointer with such a statement:

this->world = this->actor->GetWorld();

And try to set velocity different ways (each time with no luck):

this->actor->SetLinearVel(ignition::math::Vector3d(1.0, 2.0, 0.0));
this->model->SetLinearVel(ignition::math::Vector3d(1.0, 2.0, 0.0));
this->world->ModelByName(this->actor->GetName())->SetLinearVel(ignition::math::Vector3d(1.0, 2.0, 0.0));

Second problem is similar to the first but it's connected with actor's model pointer (gazebo::physics::ModelPtr) and its method CollisionBoundingBox() which produces immediate segfault. I know that actors are animated but is described issue could be explained by that?

ignition::math::Box bb = this->model->CollisionBoundingBox();   // segfault

Third thing applies to BoundingBox() method of the model. Bounding box's center is always located in (0,0,0) and its Min() and Max() methods return (inf, inf, inf), no matter what I tried to set in place of these values.

ignition::math::Box bb = this->model->BoundingBox(); // inf and 0 values

I know that there could be many workarounds created but why is some info connected with actors not changeable in the gazebo::physics::WorldPtr object? Is there a simple solution for that I'm not aware of? I have to say that SetWorldPose() method of ActorPlugin class works properly.

The last question I wanted to ask is - is the Gazebo team planning to further develop ActorPlugin in the future? Or maybe is there somebody who developed and published some extension with collisions working? Some time ago I read about working collisions but this version seemed to work only with hard-coded scripted trajectories and now I can't find the link to the repository.

Any answers and hints will be very appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-06-07 04:25:53 -0600

tartaglia gravatar image

updated 2019-06-07 04:26:27 -0600

Hi, regarding the collision for the ActorPlaugin there is a pull request that should solve the bug that allowed collisions only for scripted trajectory,

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-03-18 16:46:45 -0600

Seen: 799 times

Last updated: Jun 07 '19