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
89 stars 99 forks source link

Running roslaunch franka_gazebo panda.launch gives name 'xacro' not defined error #335

Closed giorgiapazzi closed 9 months ago

giorgiapazzi commented 9 months ago

I'm running the example reported in franka_ros documentation . When I try to run: roslaunch franka_gazebo panda.launch x:=-0.5 \ world:=$(rospack find franka_gazebo)/world/stone.sdf \ controller:=cartesian_impedance_example_controller \ rviz:=true

I get the following error: name 'xacro' is not defined when evaluating expression 'xacro.load_yaml('$(find franka_description)/robots/panda/joint_limits.yaml')' I get the same error launching: xacro $(rospack find franka_description)/robots/panda/panda.urdf.xacro gazebo:=true

I'm using franka_ros for Ros Noetic.

rhaschke commented 9 months ago

This works for me as expected. Which version of xacro do you use? Maybe you actually use an old version?

giorgiapazzi commented 9 months ago

I'm using the version 1.14.6 for xacro

giorgiapazzi commented 9 months ago

I have installed libfranka using the command sudo apt install libfranka. Instead, for the franka_ros package, I have installed it from the source code cloning the git repository branch noetic-devel.

rhaschke commented 9 months ago

What's the result of which xacro?

giorgiapazzi commented 9 months ago

which xacro command returns: /opt/ros/noetic/bin/xacro

I have tried also rospack find xacro and the result is: /opt/ros/noetic/share/xacro

rhaschke commented 9 months ago

This is weird. Could you try reinstalling xacro? What happens if you use xacro from source as well? Do you use a virtual or conda environment?

giorgiapazzi commented 9 months ago

I solved the problem by cloning the xacro repository directly into my workspace and remake.

rhaschke commented 9 months ago

If that works, your installation of xacro is somehow screwed. Can we close this issue?

giorgiapazzi commented 9 months ago

Yes we can close it