Ask Your Question

Possible to declare static object in urdf file?

asked 2012-03-09 04:54:40 -0500

Robert Krug gravatar image

updated 2012-03-09 04:58:18 -0500


I have a bunch of objects as urdf files which I use for simulation in Gazebo and visualization in Rviz. Now I would like some of them to be fixed in the environment. As stated here this is possible with Gazebo xml model files by putting following tag in the model.


However, simply putting the same tag in the gazebo extension of the urdf file like so:

<gazebo reference="my_object">

does not work, it simply gets ignored. I would like to use urdf files instead of Gazebo model xml's since urdf's can be easily visualized in Rviz by reading the description from the parameter server which does not seem to work for Gazebo model xml's. So, the question is whether there is a way to literally fix objects in their urdf file description opposed to simply making them very heavy.

Thanks, -Robert-

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-03-11 19:07:40 -0500

hsu gravatar image

just add extension without the reference attribute to your model:

edit flag offensive delete link more


Perfect, thank you!

Robert Krug gravatar image Robert Krug  ( 2012-03-12 01:48:24 -0500 )edit

Is it possible to make only a specific link static? I want only the base_link of my robot arm to be static (i.e. welded in place) while other links and joints can be actuated.

Rufus gravatar image Rufus  ( 2020-04-16 03:21:58 -0500 )edit

@Rufus, did you ever find a solution to this question? I am having the same issue.

matthewmarkey gravatar image matthewmarkey  ( 2020-05-12 11:52:05 -0500 )edit

@matthewmarkey My conclusion was that I don't believe it is possible. The only way to achieve something similar is to explicitly specify in the urdf file a fixed joint between the world and the base_link

 <link name="world" />

 <joint name="world_joint" type="fixed">
    <parent link="world" />
    <child link = "base_link" />
    <origin xyz="0.0 0.0 0.1" rpy="0.0 0.0 0.0" />

I think it's unfortunate that changing where to spawn the arm (base link) requires changing the urdf. I would hope this can be done similar to spawning static objects in gazebo, just changing some parameters in the launch file.

Rufus gravatar image Rufus  ( 2020-05-15 02:29:36 -0500 )edit

Ok thank you @Rufus. When you change this in the URDF, should you also run the MSA again now that you have changed the URDF?

matthewmarkey gravatar image matthewmarkey  ( 2020-05-18 04:03:10 -0500 )edit

@matthewmarkey what is MSA??

Rufus gravatar image Rufus  ( 2020-05-19 21:07:44 -0500 )edit

The Moveit Setup Assistant.

matthewmarkey gravatar image matthewmarkey  ( 2020-05-20 02:12:49 -0500 )edit

I've never used Moveit Setup Assistant before so I'm not sure

Rufus gravatar image Rufus  ( 2020-05-20 03:53:38 -0500 )edit

answered 2012-03-09 05:17:16 -0500

Kai Bublitz gravatar image

Hi Robert,

you can fix a model to the world by adding the following lines to your URDF file:

<link name="world" />
<joint name="world_joint"  type="fixed">
    <origin xyz="2 0 1.5" rpy="0 0 0" />
    <parent link="world"/>
    <child link="your_models_root_link"/>

Note that the object is fixed to the world at the position you specify in the joint, not the parameters you give to spawn_model.

edit flag offensive delete link more


Thanks, that works but I'm still wondering if it's possible to set Gazebo`s static tag so that the physics engine doesn't try to recompute the fixed object's state at every iteration.

Robert Krug gravatar image Robert Krug  ( 2012-03-09 05:37:32 -0500 )edit

Hm for me it does not work... If I start the simulation my object (here: your_models_root_link) just falls down..... even with:

<gazebo reference="your_models_root_link">
Markus gravatar image Markus  ( 2018-08-29 03:37:05 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-03-09 04:54:40 -0500

Seen: 4,726 times

Last updated: Mar 11 '12