-
-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Description
Hi
Consider the following minimal example xacro file
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="firefighter">
<xacro:macro name="leg" params="prefix:=0_0_0">
<link name="${prefix}_leg">
</link>
</xacro:macro>
<xacro:leg prefix="1_2_3"/>
<xacro:leg prefix="'1_2_3'"/>
<xacro:leg prefix="a_1_2_3"/>
<xacro:leg />
</robot>
Output of rosrun xacro xacro test.urdf.xacro on noetic:
<robot name="firefighter">
<link name="123_leg">
</link>
<link name="1_2_3_leg">
</link>
<link name="a_1_2_3_leg">
</link>
<link name="0_leg">
</link>
</robot>
If I run the same on melodic, the output looks as expected:
<robot name="firefighter">
<link name="1_2_3_leg">
</link>
<link name="1_2_3_leg">
</link>
<link name="a_1_2_3_leg">
</link>
<link name="0_0_0_leg">
</link>
</robot>
It seems like that xacro treats values which only contain numbers and underscores as integers, omitting all leading 0's and removing all underscores. If I enforce it to treat it as string (by adding single quotes '), it also works as intended. I tried to check the xacro implementation, but was unable to find the cause so far. Any idea?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels