jrl-umi3218 / mc_panda

Panda's RobotModule and extensions for mc_rtc
BSD 2-Clause "Simplified" License
8 stars 6 forks source link

xacro issue #14

Closed wyqsnddd closed 2 years ago

wyqsnddd commented 2 years ago

Hi Pierre and Niels,

After my recent mc_rtc update, I came across the following issue about the xacro package. Have you encountered similar cases before?

smi
[  4%] Generating ../urdf/panda_default.urdf
[  9%] Generating ../urdf/panda_foot.urdf
[ 14%] Generating ../urdf/panda_pump.urdf
[ 19%] Generating ../urdf/panda_hand.urdf
Traceback (most recent call last):
  File "/opt/ros/melodic/bin/xacro", line 32, in <module>
    import xacro
ImportError: No module named xacro
Traceback (most recent call last):
  File "/opt/ros/melodic/bin/xacro", line 32, in <module>
    import xacro
ImportError: No module named xacro
[ 33%] Built target mc_panda_devices
data/CMakeFiles/generate_panda_pump_urdf.dir/build.make:77: recipe for target 'urdf/panda_pump.urdf' failed
make[2]: *** [urdf/panda_pump.urdf] Error 1
CMakeFiles/Makefile2:246: recipe for target 'data/CMakeFiles/generate_panda_pump_urdf.dir/all' failed
make[1]: *** [data/CMakeFiles/generate_panda_pump_urdf.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
data/CMakeFiles/generate_panda_default_urdf.dir/build.make:76: recipe for target 'urdf/panda_default.urdf' failed
make[2]: *** [urdf/panda_default.urdf] Error 1
CMakeFiles/Makefile2:168: recipe for target 'data/CMakeFiles/generate_panda_default_urdf.dir/all' failed
make[1]: *** [data/CMakeFiles/generate_panda_default_urdf.dir/all] Error 2
Traceback (most recent call last):
  File "/opt/ros/melodic/bin/xacro", line 32, in <module>
    import xacro
ImportError: No module named xacro
Traceback (most recent call last):
  File "/opt/ros/melodic/bin/xacro", line 32, in <module>
    import xacro
ImportError: No module named xacro
data/CMakeFiles/generate_panda_foot_urdf.dir/build.make:77: recipe for target 'urdf/panda_foot.urdf' failed
make[2]: *** [urdf/panda_foot.urdf] Error 1
CMakeFiles/Makefile2:220: recipe for target 'data/CMakeFiles/generate_panda_foot_urdf.dir/all' failed
make[1]: *** [data/CMakeFiles/generate_panda_foot_urdf.dir/all] Error 2
data/CMakeFiles/generate_panda_hand_urdf.dir/build.make:76: recipe for target 'urdf/panda_hand.urdf' failed
make[2]: *** [urdf/panda_hand.urdf] Error 1
CMakeFiles/Makefile2:194: recipe for target 'data/CMakeFiles/generate_panda_hand_urdf.dir/all' failed
make[1]: *** [data/CMakeFiles/generate_panda_hand_urdf.dir/all] Error 2
[ 38%] Building CXX object src/CMakeFiles/mc_panda.dir/panda.cpp.o
[ 42%] Linking CXX shared library libmc_panda.so
[ 42%] Built target mc_panda
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2

Whereas, in the same terminal, I can import xacro from python:

yuquan@yuquan-3541:~/local/mc_panda/build$ python2
Python 2.7.17 (default, Feb 27 2021, 15:10:58) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xacro
>>> quit()
yuquan@yuquan-3541:~/local/mc_panda/build$ python3
Python 3.6.9 (default, Dec  8 2021, 21:08:43) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xacro
>>> quit()
yuquan@yuquan-3541:~/local/mc_panda/build$ rospack find xacro
/opt/ros/melodic/share/xacro
gergondet commented 2 years ago

Hi @wyqsnddd

Any chance your smi alias is sudo make install and not make && sudo make install?

The first would break because your sudo does not have ROS sourced in the environment.

wyqsnddd commented 2 years ago

Hi Pierre,

Indeed my alias is smi=sudo make install. I switched to make && sudo make install (or make), however, it gives another issue:

yuquan@yuquan-3541:~/local/mc_panda/build$ make 
[  4%] Generating ../urdf/panda_default.urdf

[  4%] Built target generate_panda_default_urdf
[  9%] Generating ../urdf/panda_hand.urdf
Invalid parameter "ns"
when instantiating macro: hand (/home/yuquan/local/mc_rtc/catkin_ws/src/franka_ros/franka_description/robots/hand.xacro)
in file: /home/yuquan/local/mc_panda/build/xacro/panda_hand.urdf.xacro
data/CMakeFiles/generate_panda_hand_urdf.dir/build.make:76: recipe for target 'urdf/panda_hand.urdf' failed
make[2]: *** [urdf/panda_hand.urdf] Error 2
CMakeFiles/Makefile2:194: recipe for target 'data/CMakeFiles/generate_panda_hand_urdf.dir/all' failed
make[1]: *** [data/CMakeFiles/generate_panda_hand_urdf.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2

Could you please give me another suggestion?

gergondet commented 2 years ago

Hi @wyqsnddd

I pushed a commit that fixes this issue. It seems the parameter name was changed upstream so to be on the safe side I'm now including the hand.xacro file in this repo as well as the other files.

wyqsnddd commented 2 years ago

Hi Pierre, Now I can make and install, thanks a lot for the quick fix!