Home | Tutorials | Wiki | Issues
Ask Your Question

attach model to link

asked 2013-02-20 08:30:10 -0500

Max Stähr gravatar image


I've been trying to attach a static model to a link of a mobile robot. Somehow this is completely ignored by gazebo and I don't know why. Please see the code below:

        physics::WorldPtr world = physics::get_world();
        physics::ModelPtr test_model = world->GetModel("test_model");

        physics::LinkPtr link = model->GetLink("link3");
        math::Pose pose;
edit retag flag offensive close merge delete


in what context are you doing this? in a plugin? maybe you could provide us with a file that we could test with.

ffurrer gravatar imageffurrer ( 2013-02-20 18:58:50 -0500 )edit

Hi, I cant upload a file because of my insufficient karma < 10.

Max Stähr gravatar imageMax Stähr ( 2013-02-21 04:13:07 -0500 )edit

The code is called within the ConnectWorldUpdateStart callback, so it should been updated in every simulation cycle. Is there another way to provide you the file?

Max Stähr gravatar imageMax Stähr ( 2013-02-21 04:15:11 -0500 )edit

yes, pastebin.com should work, in the case you can't put the link in directly just use some spaces in the link :S. Is there a reason why you're not using SDF for that matter? Do you want to change the attachment state during runtime? Otherwise you can use something like in this tutorial: http://gazebosim.org/wiki/Tutorials/1.4/build_robot/attach_gripper

ffurrer gravatar imageffurrer ( 2013-02-21 11:32:34 -0500 )edit

Hi, I've just added the file. Can you see the problem?


Max Stähr gravatar imageMax Stähr ( 2013-02-27 09:33:25 -0500 )edit

Hi, I've just added the file. Can you see the problem?

Max Stähr gravatar imageMax Stähr ( 2013-02-27 09:33:26 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-03-01 11:38:46 -0500

nkoenig gravatar image

A note about your pasted code: Pausing and unpausing the world within an update call does nothing.

Is camera_model a static model?

Make sure to detach a static model before attaching it to a different link.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2013-02-20 08:30:10 -0500

Seen: 757 times

Last updated: Mar 01 '13