XACRO Macro Noetic not working
Hi,
I'm facing issues with xacro macros in ROS noetic. I have the following robot description (or a simplified version) containing one xacro macro. After the definition of the macro it is called by <robot_macro/>
Normally i have this macro defined in an other file and include it in a main xacro file, where i include a lot of macros and then build up the robot using those macros.
<?xml version="1.0"?>
<robot name="robot1" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="robot_macro">
<link name="robot1_base_link"/>
<link name="beam_link">
<inertial>
<origin xyz="0.40 0 0.02" rpy="0 0 0" />
<mass value="2" />
<inertia ixx="0.003" ixy="0" ixz="0" iyy="0.09" iyz="0" izz="0.09" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<cylinder length="0.6" radius="0.2"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<collision>
<origin xyz="0.4 0 0.02" rpy="0 0 0" />
<geometry>
<cylinder length="0.6" radius="0.2"/>
</geometry>
</collision>
</link>
<joint name="beam_joint" type="fixed">
<origin xyz="0 0 0" rpy="0 0 0" />
<parent link="robot1_base_link" />
<child link="beam_link" />
<axis xyz="0 0 0" />
</joint>
</xacro:macro>
<robot_macro/>
</robot>
If i load the robot description in Gazebo, i get the error message No link elements found in urdf.
At first i thought it could be that the mesh files can not be found. So i decided to switch to a simple conversion from xacro to urdf for debugging my problem. But if i convert this xacro file to a urdf file using rosrun xacro xacro -o model.urdf model.xacro
the resulting urdf contains no links and joint:
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from mira3d.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="robot1">
<robot_macro/>
</robot>
If i remove the two xacro macro lines around the links and joint (and the call of the macro), its working as expected. I am pretty sure, i used the xacro description like it is in Kinetic and Melodic before and had no problems with it. I also think the macro looks like the example on http://wiki.ros.org/urdf/Tutorials/Us...
Can you see any issue with it or is there any change in xacro macros in noetic?