Ask Your Question
0

RLException: Invalid <param> tag

asked 2020-06-01 07:20:41 -0500

Morgenstern gravatar image

updated 2020-06-01 07:23:24 -0500

gvdhoorn gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-06-01 10:04:22 -0500

ahcorde gravatar image

Hi,

you need to include in your main URDF a include of the other URDF where you define the wheel:

<xacro:include filename="$(find <your packge>)<path to your urdf inside the package>/robot_essentials" />
<xacro:robot_wheel prefix="front_left"/>
<xacro:robot_wheel prefix="front_right"/>
edit flag offensive delete link more

Comments

Thanks. It worked. Thanks for helping me. I hope you have a nice day :) .

Morgenstern gravatar image Morgenstern  ( 2020-06-02 06:25:02 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-06-01 07:20:41 -0500

Seen: 24 times

Last updated: Jun 01