Gazebo | Ignition | Community
Ask Your Question

SDF: How to fix a model to the world?

asked 2018-07-23 15:55:15 -0500

pbelanger gravatar image


So I've set up an arm model in an SDF file and have input correct values for mass, CoM, and inertia tensor, but am having trouble figuring out how to fix the arm to the world. I have tried giving the base of the arm an arbitrarily high mass, but this does not seem to work well. I figure that there must be a method to hold the base of the arm static relative to the default ground_plane in the gazebo world but can't seem to figure it out. All solutions seem to be using URDF, which I am not.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-07-24 09:18:54 -0500

pbelanger gravatar image

I figured out what I was doing wrong here. When I tried to specify a link to the world, I didn't specify the model name.

A link like the following will prevent the link named base of a model named arm from moving relative to the world:

<link name="world_fix">

Placing this in the root of your <model> will then prevent the base from moving.

edit flag offensive delete link more


Shouldn't it rather be a fixed type joint, as described in this tutorial?

maksymczech gravatar imagemaksymczech ( 2018-09-11 05:45:55 -0500 )edit

answered 2022-04-18 09:43:46 -0500

weirdcookie gravatar image

for me, what worked was adding this inside the <model> in the .sdf file

<link name="world_fix"> 
    </link> <!-- I needed to close the link tag -->
    <joint name ="weld" type="fixed">
        <child>base</child> <!-- put here the name of the base link -->
    </joint> <!-- close the joint tag -->

Ps: Using noetic and gazebo 11 and sdf version 1.7

edit flag offensive delete link more

Question Tools



Asked: 2018-07-23 15:51:35 -0500

Seen: 3,290 times

Last updated: Apr 18 '22