Gazebo | Ignition | Community
Ask Your Question

How to get pose of other model from another model plugin

asked 2020-05-15 15:05:24 -0500

altineller gravatar image


How can I get pose of an object from another model plugin? In my model plugin I can get properties of the model I am at easily, but how can pose info of another model except subscring to /gazebo/default/pose/info [which is what I am currenltly doing?

Best regards, C.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-05-18 04:58:04 -0500

kumpakri gravatar image

updated 2020-05-18 07:32:36 -0500

Use following lines to get the pointer to the other model.

physics::WorldPtr world_ptr = model_ptr->GetWorld();

physics::ModelPtr other_model_ptr = world_ptr->ModelByName("other_model_name")

Now you can work with the other model the same way as with the model to which the plugin is attached.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-05-15 15:05:24 -0500

Seen: 72 times

Last updated: May 18 '20