I have problem when rosrun xacro xacro demo05.urdf.xacro>demo05.urdf
xacro:macro: unknown attribute(s): param when processing file: demo05_car_base.urdf.xacro Invalid parameter "wheel_name" when instantiating macro: wheel_func (demo05_car_base.urdf.xacro) in file: demo05_car_base.urdf.xacro
I am running this xacro
<robot name="car" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:property name="footprint_radius" value="0.001"/>
<link name="base_footprint">
<visual>
<geometry>
<sphere radius="${footprint_radius}"/>
</geometry>
</visual>
</link>
<xacro:property name="base_radius" value="0.1"/>
<xacro:property name="base_length" value="0.08"/>
<xacro:property name="lidi" value="0.015"/>
<xacro:property name="base_joint_z" value="${base_length/2+lidi}"/>
<link name="base_link">
<visual>
<geometry>
<cylinder radius="0.1" length="0.08"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
<material name="color">
<color rgba="1 0.2 0.2 1"/>
</material>
</visual>
</link>
<joint name="link2footprint" type="fixed" >
<parent link="base_footprint"/>
<child link="base_link"/>
<origin xyz="0 0 0.055" rpy="0 0 0"/>
</joint>
<xacro:property name="wheel_radius" value="0.035"/>
<xacro:property name="wheel_length" value="0.015"/>
<xacro:property name="PI" value="3.1415927"/>
<xacro:property name="wheel_joint_z" value="${-base_length/2-lidi+wheel_radius}"/>
<xacro:macro name="wheel_func" param="wheel_name flag">
<link name="${wheel_name}_wheel">
<visual>
<geometry>
<cylinder radius="${wheel_radius}" length="${wheel_length}"/>
</geometry>
<origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
<material name="wheel_color">
<color rgba="0 0 0 1"/>
</material>
</visual>
</link>
<joint name="${wheel_name}2link" type="continuous" >
<parent link="base_link"/>
<child link="${wheel_name}_wheel"/>
<origin xyz="0 ${0.1*flag} ${base_joint_z}" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
</joint>
</xacro:macro>
<xacro:wheel_func wheel_name="left" flag="1"/>
<xacro:wheel_func wheel_name="right" flag="-1"/>
</robot>
Hi @yikai what distribution of ROS are you running? Also can you explain what have you tried so far or show the file that is giving the error
Hi @yikai pls delete the answer and add the code to your question. Otherwise it will looked like it’s already answered
@yikai You can edit your description using the "edit" button at the end of the text.
Thank you. The problem is solved.
I have moved your xacro file content into your description.