I am encountering an issue in ROS2 Iron that wasn't present in ROS2 Galactic, related to the conversion of a URDF file (generated from XACRO) to SDF, specifically regarding the inertia elements. I am using ROS2 Iron on Ubuntu 22.04
Problem Description:
In ROS2 Galactic, the conversion of my URDF file (generated from a XACRO file with inertia calculations) to SDF was successful. However, after upgrading to ROS2 Iron, the same URDF to SDF conversion process leads to errors.
Steps Taken:
1- I created a simple XACRO file with basic inertia calculations and successfully converted it to a URDF file using the command:
xacro simple_wheel.xacro > simple_wheel.urdf
2 - When converting the generated URDF file to SDF using the following command:
gz sdf -p simple_wheel.urdf > simple_wheel.sdf
3- I received errors related to the inertia elements:
Error: Inertial: inertia element ixx is not a valid double
at line 334 in ./urdf_parser/src/link.cpp
Error: Could not parse inertial element for Link [simple_wheel]
at line 435 in ./urdf_parser/src/link.cpp
The URDF file includes correctly formatted inertia elements, but they seem to be misinterpreted during the SDF conversion.
Specific Questions:
- Are there known issues or changes in ROS2 Iron affecting the URDF to SDF conversion process, especially regarding inertia elements?
- Do I need to follow a different procedure or use specific tools in ROS2 Iron for accurate SDF conversion?
- Is there a recommended workaround or solution to ensure that inertia elements are correctly processed during the URDF to SDF conversion in ROS2 Iron?
XACRO File Snippet for Reference:
<?xml version="1.0"?>
<robot name="simple_robot" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:property name="wheel_mass" value="74"/>
<xacro:property name="wheel_radius" value="0.536"/>
<xacro:property name="ixx_iyy_inertia" value="0.5 * ${wheel_mass} * ${wheel_radius} * ${wheel_radius}"/>
<xacro:property name="izz_inertia" value="${wheel_mass} * ${wheel_radius} * ${wheel_radius}"/>
<!-- link definitions -->
</robot>
I appreciate any insights or suggestions