ros / xacro

Xacro is an XML macro language. With xacro, you can construct shorter and more readable XML files by using macros that expand to larger XML expressions.
http://www.ros.org/wiki/xacro
BSD 3-Clause "New" or "Revised" License
85 stars 99 forks source link

name 'namespace' is not defined #316

Closed johnwaneboy closed 2 years ago

johnwaneboy commented 2 years ago

There is a strange issue. I have install and run a program successfully, and no adjustments were made. When I ran another program, but there is no changes in the first program, the following problems occurred.

name 'namespace' is not defined when evaluating expression 'namespace' when processing file: /home/wane/catkin_ws/src/rotors_simulator/rotors_description/urdf/component_snippets.xacro included from: /home/wane/catkin_ws/src/rotors_simulator/rotors_description/urdf/hummingbird_base.xacro included from: /home/wane/catkin_ws/src/rotors_simulator/rotors_description/urdf/mav_generic_odometry_sensor.gazebo RLException: while processing /home/wane/catkin_ws/src/rpg_quadrotor_control/simulation/rpg_rotors_interface/launch/basics/base_quad_simulation.launch: while processing /home/wane/catkin_ws/src/rotors_simulator/rotors_gazebo/launch/spawn_mav.launch: Invalid tag: Cannot load command parameter [robot_description]: command [['/opt/ros/melodic/lib/xacro/xacro', '/home/wane/catkin_ws/src/rotors_simulator/rotors_description/urdf/mav_generic_odometry_sensor.gazebo', 'enable_logging:=false', 'enable_ground_truth:=true', 'enable_mavlink_interface:=false', 'log_file:=hummingbird', 'wait_to_record_bag:=false', 'mav_name:=hummingbird', 'namespace:=hummingbird']] returned with code [2].

Param xml is The traceback for the exception was written to the log file

rhaschke commented 2 years ago

The error message states that your are accessing the xacro property ${namespace}, which isn't defined in component_snippets.xacro. I see that you pass a namespace argument via cmdline, but this needs to be referenced via $(arg namespace). For further debugging, you should provide a minimal code example exhibiting the issue.

danielvennestrom commented 2 years ago

I am running into a similar problem. On the rotors_simulator repo there is an issue that suggest using older xacro version and rebuild the package.

rhaschke commented 2 years ago

Thanks for referencing the rotors_simulator repo (even better would have been referencing the issue: https://github.com/ethz-asl/rotors_simulator/issues/695). The problem is resolved in xacro 1.14.13. Please simply update.