Ask Your Question
0

RLException: Invalid <param> tag

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

Morgenstern gravatar image

updated 2021-04-24 02:42:09 -0600

miura 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
5

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

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 -0600 )edit

I use noetic and the ans worked for me as well Thank You

Sudo gravatar image Sudo  ( 2020-07-16 21:55:38 -0600 )edit

Thanks worked for me

concorde42 gravatar image concorde42  ( 2020-11-26 11:36:46 -0600 )edit
1

I got the simulation but wheels are not connected to the robot base why??

BG_22 gravatar image BG_22  ( 2020-12-20 19:38:19 -0600 )edit

Hi, I'm actually learning from the same book and running the same code. This helped me run the simulation but there was only one wheel in the middle. did you have the same problem, if not can you please help me figure out what's wrong. Thank you

YassineA2 gravatar image YassineA2  ( 2021-04-19 19:43:02 -0600 )edit

Probably you are writin wrong somethin. (Incompletely)

Morgenstern gravatar image Morgenstern  ( 2021-04-26 23:18:16 -0600 )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 -0600

Seen: 853 times

Last updated: Jun 01 '20