Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: #4

Open
arifulislamiut opened this issue Aug 2, 2020 · 19 comments

Comments

@arifulislamiut
Copy link

Hi,
I'm using Ubuntu 20.04 LTS and ROS noetic distro

After running $ roslaunch mybot_gazebo mybot_world.launch i'm getting the following error.
How can i fix it?

Screenshot from 2020-08-02 17-07-59

@knickels
Copy link
Contributor

Hi! I got this working on Melodic, check out my fork and see if it does it. I don't have noetic, but it gets you one step closer anyway 👍

@rafamrtq
Copy link

rafamrtq commented Nov 21, 2020

Hi! replace the xacro call to
"$(find xacro)/xacro '$(find mybot_description)/urdf/mybot.xacro'"

@genielamp123
Copy link

how to replace xacro call to $(find xacro) i got the same error

@knickels
Copy link
Contributor

knickels commented Dec 3, 2020

It would be in line 22 of mybot_ws/src/mybot_gazebo/launch/mybot_world.launch.
What do you get when you call rospack find xacro in a shell?

@orangedomino
Copy link

Thank you knickels, the change to line 22 worked perfectly. I have the sim up and running now.

(I am also using Ubuntu 20.04 and ROS Noetic)

@haoranchen1104
Copy link

Hi, i'm working on Ubuntu 20.04 and ROS noetic distro.
I got this when i ran $ roslaunch mybot_gazebo mybot_world.launch

moz@moz:~/catkin_ws$ roslaunch mybot_gazebo mybot_world.launch 
... logging to /home/moz/.ros/log/dc3be7de-51a6-11eb-8e73-49182861ab54/roslaunch-moz-75427.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

name 'm' is not defined 
when evaluating expression 'm*(3*r*r+h*h)/12'
when processing file: /home/moz/catkin_ws/src/mybot_gazebo_tutorial/mybot_description/urdf/mybot.xacro
RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: command [['/opt/ros/noetic/lib/xacro/xacro', '/home/moz/catkin_ws/src/mybot_gazebo_tutorial/mybot_description/urdf/mybot.xacro']] returned with code [2]. 

Param xml is <param name="robot_description" command="$(find xacro)/xacro '$(find mybot_description)/urdf/mybot.xacro'"/>
The traceback for the exception was written to the log file

and i've already change the xacro call to "$(find xacro)/xacro '$(find mybot_description)/urdf/mybot.xacro'"
Is there any solution?

@haoranchen1104
Copy link

Hi, i'm working on Ubuntu 20.04 and ROS noetic distro.
I got this when i ran $ roslaunch mybot_gazebo mybot_world.launch

moz@moz:~/catkin_ws$ roslaunch mybot_gazebo mybot_world.launch 
... logging to /home/moz/.ros/log/dc3be7de-51a6-11eb-8e73-49182861ab54/roslaunch-moz-75427.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

name 'm' is not defined 
when evaluating expression 'm*(3*r*r+h*h)/12'
when processing file: /home/moz/catkin_ws/src/mybot_gazebo_tutorial/mybot_description/urdf/mybot.xacro
RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: command [['/opt/ros/noetic/lib/xacro/xacro', '/home/moz/catkin_ws/src/mybot_gazebo_tutorial/mybot_description/urdf/mybot.xacro']] returned with code [2]. 

Param xml is <param name="robot_description" command="$(find xacro)/xacro '$(find mybot_description)/urdf/mybot.xacro'"/>
The traceback for the exception was written to the log file

and i've already change the xacro call to "$(find xacro)/xacro '$(find mybot_description)/urdf/mybot.xacro'"
Is there any solution?

I found a solution.
In noetic distro, every xacro defined tag should be like this <xacro:###>. I changed all xacro defined tags and the command worked.

@DreeN0T
Copy link

DreeN0T commented Jan 17, 2021

Hi, i'm working on Ubuntu 20.04 and ROS noetic distro.
I got this when i ran $ roslaunch mybot_gazebo mybot_world.launch

moz@moz:~/catkin_ws$ roslaunch mybot_gazebo mybot_world.launch 
... logging to /home/moz/.ros/log/dc3be7de-51a6-11eb-8e73-49182861ab54/roslaunch-moz-75427.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

name 'm' is not defined 
when evaluating expression 'm*(3*r*r+h*h)/12'
when processing file: /home/moz/catkin_ws/src/mybot_gazebo_tutorial/mybot_description/urdf/mybot.xacro
RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: command [['/opt/ros/noetic/lib/xacro/xacro', '/home/moz/catkin_ws/src/mybot_gazebo_tutorial/mybot_description/urdf/mybot.xacro']] returned with code [2]. 

Param xml is <param name="robot_description" command="$(find xacro)/xacro '$(find mybot_description)/urdf/mybot.xacro'"/>
The traceback for the exception was written to the log file

and i've already change the xacro call to "$(find xacro)/xacro '$(find mybot_description)/urdf/mybot.xacro'"
Is there any solution?

I found a solution.
In noetic distro, every xacro defined tag should be like this <xacro:###>. I changed all xacro defined tags and the command worked.

could you tell me what did you do exactly? i am stuck with the same issue

@haoranchen1104
Copy link

@DreeN0T every macro label in the "macro.xacro" file, for instance "<box_inertia>", should be changed in the main xacro file "mybot.xacro". The label should be like this "xacro:box_inertia".

@DreeN0T
Copy link

DreeN0T commented Jan 17, 2021

Thank you, it was some other error but it worked 👍

@molsondry
Copy link

molsondry commented Jan 18, 2021

Hi to all Turtlebot friends,
trying to start turtlebot3_gazebo turtlebot3_stage_1.launch and all others except empty world leads to the same problem described above. For me it began after installing ROS Noetic Ninjemys under Ubuntu 20.04. What helps is editing the launchfiles and replace:
param name="robot_description" command="$(find xacro)/xacro.py $(find turtlebot3_description).......
by
param name="robot_description" command="$(find xacro)/xacro $(find turtlebot3_description).......

Easy doing is find and replace with grep and sed:
cd ~/catkin_ws/src/turtlebot3_simulations/turtlebot3_gazebo/launch
grep "xacro.py" -rli | xargs sed -i 's/xacro.py/xacro/g'

@must23
Copy link

must23 commented Jul 13, 2021

@DreeN0T and @Modrizil Hi! How did you change the mybot.xacro? mind if you show me? Idk which to replace in the mybot.xacro! really ppreciate your help!

@mantasu
Copy link

mantasu commented Nov 21, 2021

I would like to expand on @haoranchen1104's reply.

Given 2 files, macros.xacro and mybot.xacro (may be a different name), usually located in urdf directory, do the following changes:

  1. In macros.xacro:
    1. Make sure the <robot> tag includes xmlns sepcification, i.e, looks like this:
      • <robot xmlns:xacro="http://www.ros.org/wiki/xacro">
    2. Append xacro to every macro tag in the opening and closing, e.g.:
      • <xacro:macro name="sphere_inertia" params="m r">...</xacro:macro>
    3. If any macros are used, also append xacro prefix to their tag, e. g.:
      • <xacro:cylinder_inertia m="${wheelMass}" r="${wheelRadius}" h="${wheelWidth}"/>
  2. In mybot.xacro:
    1. If any macros are used, append xacro prefix to their tag, e. g.:
      • <xacro:cylinder_inertia m="${wheelMass}" r="${wheelRadius}" h="${wheelWidth}"/>

If still unclear, check for examples here in section 3.4

@tzimbill
Copy link

every macro label in the "macro.xacro" file, for instance "<box_inertia>", should be changed in the main xacro file "mybot.xacro". The label should be like this "xacro:box_inertia".

Hello, my friend,
could you explain to me in more detail what I need to change?

@DreeN0T
Copy link

DreeN0T commented Feb 23, 2022

every macro label in the "macro.xacro" file, for instance "<box_inertia>", should be changed in the main xacro file "mybot.xacro". The label should be like this "xacro:box_inertia".

Hello, my friend, could you explain to me in more detail what I need to change?

@tzimbill , you should change "xacro.py' with "xacro" and it should work

@bhavyawadhwa856
Copy link

bhavyawadhwa856 commented Jul 25, 2022

Thanks for the solution @molsondry molsondry. For others who didn't understand: go to your launch folder (where your world.launch file is) cd ....../launch/ for eg.cd ~/catkin_ws/src/turtlebot3_simulations/turtlebot3_gazebo/launch then grep "xacro.py" -rli | xargs sed -i 's/xacro.py/xacro/g'

@echefulouis
Copy link

Hello I tried to run : roslaunch turtlebot3_gazebo turtlebot3_world.launch

and keep getting

image

Please whats the best fix.

@Shivam7Sharma
Copy link

Shivam7Sharma commented Nov 15, 2022

Hello I tried to run : roslaunch turtlebot3_gazebo turtlebot3_world.launch

and keep getting

image

Please whats the best fix.

I am getting the same error. I was able to resolve this using :
[https://answers.ros.org/question/331455/xacro-substitution-args-not-supported-no-module-named-rospkg/]

@Saswati-Project
Copy link

I am using ROS noetic to run Turtlebot simulation in gazebo environment. I cloned the repository turtlebot and turtlebot simulator. When I ran the command roslaunch turtlebot_gazebo turtlebot_world.launch
I received an error as follows
`... logging to /home/abc/.ros/log/0fbbba6c-49ec-11ef-bb1f-7b777aa12b2b/roslaunch-megatron-15084.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

/usr/bin/rosversion:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import load_entry_point
/usr/bin/rosversion:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import load_entry_point
resource not found: kobuki_description
ROS path [0]=/opt/ros/noetic/share/ros
ROS path [1]=/home/abc/ROS_ws/src
ROS path [2]=/opt/ros/noetic/share
when processing file: /home/abc/ROS_ws/src/turtlebot/turtlebot_description/robots/kobuki_hexagons_astra.urdf.xacro
RLException: while processing /home/abc/ROS_ws/src/turtlebot_simulator/turtlebot_gazebo/launch/includes/kobuki.launch.xml:
Invalid tag: Cannot load command parameter [robot_description]: command [['/opt/ros/noetic/lib/xacro/xacro', '/home/abc/ROS_ws/src/turtlebot/turtlebot_description/robots/kobuki_hexagons_astra.urdf.xacro']] returned with code [2].

Param xml is
The traceback for the exception was written to the log file
`
The code block of kobuki.launch.xml is

<launch>
<arg name="base"/>
<arg name="stacks"/>
<arg name="3d_sensor"/>
<arg name="urdf_file" default="$(find xacro)/xacro '$(find turtlebot_description)/robots/$(arg base)_$(arg stacks)_$(arg 3d_sensor).urdf.xacro'"/>
<param name="robot_description" command="$(arg urdf_file)"/>
<!--  Gazebo model spawner  -->
<node name="spawn_turtlebot_model" pkg="gazebo_ros" type="spawn_model" args="$(optenv ROBOT_INITIAL_POSE) -unpause -urdf -param robot_description -model mobile_base"/>
<!--  Velocity muxer  -->
<node pkg="nodelet" type="nodelet" name="mobile_base_nodelet_manager" args="manager"/>
<node pkg="nodelet" type="nodelet" name="cmd_vel_mux" args="load yocs_cmd_vel_mux/CmdVelMuxNodelet mobile_base_nodelet_manager">
<param name="yaml_cfg_file" value="$(find turtlebot_bringup)/param/mux.yaml"/>
<remap from="cmd_vel_mux/output" to="mobile_base/commands/velocity"/>
</node>
<!--  Bumper/cliff to pointcloud (not working, as it needs sensors/core messages)  -->
<include file="$(find turtlebot_bringup)/launch/includes/kobuki/bumper2pc.launch.xml"/>
</launch>

The code block for kobuki_hexagons_astra.urdf.xacro is

<?xml version="1.0"?>
<!--
    - Base      : kobuki
    - Stacks    : hexagons
    - 3d Sensor : astra
-->    
<robot name="turtlebot" xmlns:xacro="http://ros.org/wiki/xacro">

  <xacro:include filename="$(find turtlebot_description)/urdf/turtlebot_common_library.urdf.xacro" />
  <xacro:include filename="$(find kobuki_description)/urdf/kobuki.urdf.xacro" />
  <xacro:include filename="$(find turtlebot_description)/urdf/stacks/hexagons.urdf.xacro"/>
  <xacro:include filename="$(find turtlebot_description)/urdf/sensors/astra.urdf.xacro"/>
  
  <xacro:kobuki/>
  <xacro:stack_hexagons parent="base_link"/>
  <xacro:sensor_astra   parent="base_link"/>
</robot>

The code block of is

import xacro
xacro.main()

How can I solve the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests