Home | Tutorials | Wiki | Issues
Ask Your Question
0

It's possible get a model link from other model?

asked 2018-03-22 12:33:58 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi there,

I'am writing a plugin for Gazebo and my question is if is possible get a model link from other model? With none relationship between them, no child or parent. Some thing like this:

hydrophone_pos = this->link->GetWorldPose().Ign().Pos();

beacon_pos = this->beacon_link->GetWorldPose().Ign().Pos();

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-03-22 17:58:41 -0500

First get the world:

auto world = this->GetWorld()

Then from the world get the other model:

auto beaconModel = world->GetModel("name_of_beacon_model")

Then get the link:

auto beaconLink = beaconModel->GetLink("name_of_beacon_link")

edit flag offensive delete link more

Comments

Thanks! It's works! :D

fredvaz gravatar imagefredvaz ( 2018-03-23 12:25:34 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-03-22 12:33:58 -0500

Seen: 65 times

Last updated: Mar 22 '18