zhengxiang94 / ocs2_ros2

BSD 3-Clause "New" or "Revised" License
50 stars 15 forks source link

OCS2 Pinocchio Interface Build Error #3

Closed RX-00 closed 6 days ago

RX-00 commented 2 weeks ago

Hello! Thank you for your work on porting OCS2 over to ROS 2.

I am having some problems when trying to colcon build based on the instructions. My computer is running Ubuntu 22.04 LTS and I am using ROS 2 Humble.

Here is what my ros2_ws/src/ looks like:

hpp-fcl  ocs2_ros2  pinocchio

This is the error I've been getting, but I am unable to resolve:

Starting >>> ocs2_pinocchio_interface
--- stderr: ocs2_pinocchio_interface                                                                                               
/usr/bin/ld: libocs2_pinocchio_interface.so: undefined reference to `pinocchio::urdf::details::parseRootTree(urdf::ModelInterface const*, pinocchio::urdf::details::UrdfVisitorBaseTpl<double, 0>&)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/testPinocchioInterface.dir/build.make:149: testPinocchioInterface] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:185: CMakeFiles/testPinocchioInterface.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< ocs2_pinocchio_interface [0.28s, exited with code 2]
Aborted  <<< ocs2_quadruped_loopshaping_interface [11.9s]  

Thank you very much for your help!!

zhengxiang94 commented 2 weeks ago

First of all, I've only tested it at Iron. Second, both hpp-fcl and pinocchio need to be compiled with cmake.

Note that hpp-fcl and pinocchio are located outside the ros2_ws/src/ folder. Here are the installation steps

mkdir build && cd build
cmake ..
make -j4
make install