joonr7 / HesaiLidar_General_ROS2

ROS2 driver for PandarXT PandarQT Pandar64 Pandar40P Pandar40M Pandar20A Pandar20B
Apache License 2.0
4 stars 4 forks source link

Ros2 Build error #5

Closed cyp4x141 closed 2 years ago

cyp4x141 commented 2 years ago

Hi, @joonr7 I try to build this driver on Ubuntu20.04 for ROS2 galactic. Boost version is 1.71.0

$ colcon build

and get this error

/usr/bin/ld: libPandarGeneralSDK.so: undefined reference to `boost::thread::native_handle()'
/usr/bin/ld: libPandarGeneralSDK.so: undefined reference to `typeinfo for boost::detail::thread_data_base'
/usr/bin/ld: libPandarGeneralSDK.so: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
/usr/bin/ld: libPandarGeneral.so: undefined reference to `boost::thread::detach()'
/usr/bin/ld: libPandarGeneralSDK.so: undefined reference to `boost::thread::join_noexcept()'
/usr/bin/ld: libPandarGeneralSDK.so: undefined reference to `boost::thread::start_thread_noexcept()'
/usr/bin/ld: libPandarGeneralSDK.so: undefined reference to `vtable for boost::detail::thread_data_base'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/hesai_lidar_node.dir/build.make:158: hesai_lidar_node] Error 1
make[1]: *** [CMakeFiles/Makefile2:221: CMakeFiles/hesai_lidar_node.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< hesai_lidar [1.99s, exited with code 2]

Summary: 0 packages finished [2.08s]
  1 package failed: hesai_lidar
  1 package had stderr output: hesai_lidar

I add link for libboost_thread.so and libboost_thread.a in /usr/lib/ , add this

set(CMAKE_CXX_FLAGS "${CAMKE_CXX_FLAGS} -L/usr/lib/x86_64-linux-gnu/ -lboost_thread") or set(CMAKE_CXX_FLAGS "${CAMKE_CXX_FLAGS} -L/usr/lib/ -lboost_thread")

both not working, still get the same error. Is there any suggestions to build this ros2 driver correctly?

Thanks.

rexsham commented 2 years ago

Same issue here, tried a lot of things but still get the same build error

joonr7 commented 2 years ago

Thanks for your discussion.
Hesai has developed their own ROS2 driver and is distributing their own ROS2 driver.

Please enjoy official driver ! https://github.com/HesaiTechnology/HesaiLidar_General_ROS/tree/ROS2