Skip to content

Commit 5eff78d

Browse files
authored
Shift inertia to base_footprint (#646)
Signed-off-by: Aarav Gupta <[email protected]>
1 parent 1022789 commit 5eff78d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

setup_guides/sdf/setup_sdf.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,12 @@ Here is the SDF version of the URDF code:
118118
</size></box>
119119
</geometry>
120120
</collision>
121-
122-
<xacro:box_inertia m="15" w="${base_width}" d="${base_length}" h="${base_height}"/>
123121
</link>
124122
125123
<!-- Robot Footprint -->
126124
<link name='base_footprint'>
127125
<pose relative_to="base_joint"/>
128-
<xacro:box_inertia m="0" w="0" d="0" h="0"/>
126+
<xacro:box_inertia m="15" w="${base_width}" d="${base_length}" h="${base_height}"/>
129127
</link>
130128
131129
<joint name='base_joint' type='fixed'>
@@ -234,6 +232,8 @@ Now build and source your package and launch ``display.launch.py``:
234232
source install/setup.bash
235233
ros2 launch sam_bot_description display.launch.py
236234
235+
.. note:: You may get a warning like ``[kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.`` This warning can be safely ignored as it is just a quirk of the conversion from SDF to URDF.
236+
237237
.. image:: ../urdf/images/base-bot_3.png
238238

239239
Conclusion

setup_guides/urdf/setup_urdf.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ Let us first define macros containing the inertial properties of the geometric p
398398
</inertial>
399399
</xacro:macro>
400400
401-
Let us start by adding collision areas to our ``base_link`` using the ``<collision>`` tag. We will also be using the box_inertia macro we defined before to add some inertial properties to our ``base_link``. Include the following code snippet within ``<link name="base_link">`` tag of base_link in our URDF.
401+
Let us start by adding collision areas to our ``base_link`` using the ``<collision>`` tag. Include the following code snippet within ``<link name="base_link">`` tag of ``base_link`` in our URDF.
402402

403403
.. code-block:: xml
404404
:lineno-start: 52
@@ -409,7 +409,14 @@ Let us start by adding collision areas to our ``base_link`` using the ``<collisi
409409
</geometry>
410410
</collision>
411411
412-
<xacro:box_inertia m="15" w="${base_width}" d="${base_length}" h="${base_height}"/>
412+
We will also be using the box_inertia macro we defined before to add some inertial properties to our ``base_link``.
413+
The ``kdl_parser`` package used in ``robot_state_publisher`` doesn't like inertial properties being specified in the root link, in this case the ``base_link``, to combat this we will be including them in the ``base_footprint`` instead.
414+
Include the following code snippet within ``<link name="base_footprint">`` tag of ``base_footprint`` in our URDF.
415+
416+
.. code-block:: xml
417+
:lineno-start: 62
418+
419+
<xacro:box_inertia m="15" w="${base_width}" d="${base_length}" h="${base_height}"/>
413420
414421
Next, let us do the same for our wheel macros. Include the following code snippet within the ``<link name="${prefix}_link">`` tag of our wheel macros in our URDF.
415422

0 commit comments

Comments
 (0)