I'm new to ROS and trying to learn from a book "ROS Robotics Projects". I'm using Ubuntu 18.04 LTS and ROS Melodic Morenia. I'm trying to build a robot simulation. And I was following instructions and stucked. I created robot_base.urdf.xacro and robot_essentials.xacro files. Here is the content of files = -robot_base.urdf.xacro
<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="robot_base" >
<link name="base_link">
<visual>
<origin
xyz="0 0 0"
rpy="1.5707963267949 0 3.14" />
<geometry>
<mesh filename="package://robot_description/meshes/robot_base.stl"/>
</geometry>
<material
name="">
<color
rgba="0.79216 0.81961 0.93333 1" />
</material>
</visual>
</link>
<xacro:robot_wheel prefix="front_left"/>
<xacro:robot_wheel prefix="front_right"/>
<xacro:robot_wheel prefix="rear_left"/>
<xacro:robot_wheel prefix="rear_right"/>
<xacro:wheel_joint prefix="front_left" origin="0.220 0.250 0"/>
<xacro:wheel_joint prefix="front_right" origin="0.220 -0.250 0"/>
<xacro:wheel_joint prefix="rear_left" origin="-0.220 0.250 0"/>
<xacro:wheel_joint prefix="rear_right" origin="-0.220 -0.250 0"/>
</robot>
and -robot_essentials.xacro =
<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="robot_essentials" >
<xacro:macro name="robot_wheel" params="prefix">
<link name="${prefix}_wheel">
<visual>
<origin
xyz="0 0 0"
rpy="1.5707963267949 0 0" />
<geometry>
<mesh filename="package://robot_description/meshes/wheel.stl" />
</geometry>
<material
name="">
<color
rgba="0.79216 0.81961 0.93333 1" />
</material>
</visual>
</link>
</xacro:macro>
<xacro:macro name="wheel_joint" params="prefix origin">
<joint name="${prefix}_wheel_joint" type="continuous">
<axis xyz="0 1 0"/>
<parent link ="base_link"/>
<child link ="${prefix}_wheel"/>
<origin rpy ="0 0 0" xyz= "${origin}"/>
</joint>
</xacro:macro>
</robot>
Than I'm trying to run this command :
roslaunch urdf_tutorial display.launch model:=robot_base.urdf.xacro
I'm getting this error =
unknown macro name: robot_wheel
when processing file: robot_base.urdf.xacro
RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: command [['/opt/ros/melodic/share/xacro/xacro.py', 'robot_base.urdf.xacro']] returned with code [2].
Param xml is <param command="$(find xacro)/xacro.py $(arg model)" name="robot_description"/>
The traceback for the exception was written to the log file*
Can you help me to get the issue and solve it.
Thanks.
Originally posted by Morgenstern on ROS Answers with karma: 25 on 2020-06-01
Post score: 0