Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having trouble building colcon workspace #9

Open
joshHUNB opened this issue May 11, 2021 · 10 comments
Open

Having trouble building colcon workspace #9

joshHUNB opened this issue May 11, 2021 · 10 comments

Comments

@joshHUNB
Copy link

Hello I have been trying unsuccessfully to get the Livox ROS2 driver to work on my machine. I am running ubuntu 18.04 with ROS2 Dashing.

These are the commands I am running to install Livox-SDK and the ROS2 Driver. The colcon build command fails and I am not sure why.

git clone https://github.com/Livox-SDK/Livox-SDK.git
cd Livox-SDK
cd build && cmake ..
make 
sudo make install 
source /opt/ros/dashing/setup.bash
sudo apt install python3-colcon-common-extensions
cd
mkdir -p ws_livox/src
git clone https://github.com/Livox-SDK/livox_ros2_driver.git ws_livox/src
cd ws_livox
colcon build

This is the terminal output I get after running colcon build in ws_livox

Starting >>> livox_interfaces
Starting >>> livox_sdk_vendor
Finished <<< livox_sdk_vendor [1.10s]                                                              
Finished <<< livox_interfaces [4.93s]                       
Starting >>> livox_ros2_driver
--- stderr: livox_ros2_driver                              
** WARNING ** io features related to ensenso will be disabled
** WARNING ** io features related to davidSDK will be disabled
** WARNING ** io features related to dssdk will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
** WARNING ** visualization features related to ensenso will be disabled
** WARNING ** visualization features related to davidSDK will be disabled
** WARNING ** visualization features related to dssdk will be disabled
** WARNING ** visualization features related to rssdk will be disabled
/usr/include/apr-1.0
apr-1
/usr/bin/ld: /usr/local/lib/liblivox_sdk_static.a(device_discovery.cpp.o): relocation R_X86_64_TPOFF32 against symbol `_ZGVZN6spdlog7details2os9thread_idEvE3tid' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/liblivox_sdk_static.a(livox_sdk.cpp.o): relocation R_X86_64_PC32 against symbol `_ZN3fmt2v58internal12basic_bufferIcE6resizeEm' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [liblivox_ros2_driver.so] Error 1
make[1]: *** [CMakeFiles/livox_ros2_driver.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< livox_ros2_driver [4.56s, exited with code 2]

Summary: 2 packages finished [9.62s]
  1 package failed: livox_ros2_driver
  1 package had stderr output: livox_ros2_driver

Any help would be appreciated

@Livox-SDK
Copy link
Owner

sorry, joshHUNB,
Build it on ROS2 foxy please!
Someone migrated it to the foxy now.

@myxiaojun
Copy link

@Livox-SDK same problem... so the livox_ros2_driver based on ros2 foxy now? but README said running Livox ROS2 driver under ubuntu18.04, ROS2 (dashing, ubuntu18.04)... Foxy is based on ubuntu 20.04.

@joshHUNB
Copy link
Author

I have tried building it on Foxy but haven't had much success. Do you have any new install instructions?

For example I build foxy workspace from source, then I go to the ws_livox it asks for perception_pcl to be added, so I put that in ws_livox/src (I tried in Foxy but it didn't like that), but then perception fails.

Could not find a package configuration file provided by "catkin" with any
of the following names:

catkinConfig.cmake
catkin-config.cmake

...
Failed <<< pcl_conversions [1.43s, exited with code 1]

Moving to Foxy may be a problem for my project as well since we mostly operate in 18.04 ubuntu. But I have managed to get Foxy working

@Livox-SDK
Copy link
Owner

No need to install Livox-SDK in advance!
you can delete the "/usr/local/lib/liblivox_sdk_static.a" now, and build it again!

@jarekkt
Copy link

jarekkt commented Dec 8, 2021

Note - see the other issue - you have different compilation options in SDK and driver, so only local build of SDK ( within driver) will work. It will never properly link to standalone SDK build.

@AsiDiaz
Copy link

AsiDiaz commented Jan 14, 2022

@Livox-SDK Building it without Livox-SDK I get this errors when I try to run the driver:

`ros2 launch livox_lidar_rviz_launch.py

[INFO] [launch]: All log files can be found below /home/asier/.ros/log/2022-01-14-11-05-14-866050-asier-5087
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [livox_ros2_driver_node-1]: process started with pid [5090]
[INFO] [rviz2-2]: process started with pid [5092]
[livox_ros2_driver_node-1] [INFO] [1642154715.398756964] [livox_lidar_publisher]: Livox Ros Driver Version: 0.0.1
[livox_ros2_driver_node-1] /home/asier/ws_livox/install/livox_ros2_driver/lib/livox_ros2_driver/livox_ros2_driver_node: symbol lookup error: /home/asier/ws_livox/install/livox_ros2_driver/lib/liblivox_ros2_driver.so: undefined symbol: GetLivoxSdkVersion
[ERROR] [livox_ros2_driver_node-1]: process has died [pid 5090, exit code 127, cmd '/home/asier/ws_livox/install/livox_ros2_driver/lib/livox_ros2_driver/livox_ros2_driver_node --ros-args -r __node:=livox_lidar_publisher --params-file /tmp/launch_params_uzgbqlp7 --params-file /tmp/launch_params_4hko0s01 --params-file /tmp/launch_params_l6txhpwf --params-file /tmp/launch_params_jpgjag7f --params-file /tmp/launch_params_fxisb1xm --params-file /tmp/launch_params_8vpj3gdp --params-file /tmp/launch_params_mva09fnb --params-file /tmp/launch_params_dt2abqe1 --params-file /tmp/launch_params_31irzg3k']. `

I build it on Ubuntu 20.04 with Foxy.

@jarekkt
Copy link

jarekkt commented Jan 14, 2022

Look for this in one of CMakeLists.txt

set(livox_sdk_REV "v2.3.0")
....
GIT_REPOSITORY https://github.com/Livox-SDK/Livox-SDK.git

You need precisely same version....

@jarekkt
Copy link

jarekkt commented Jan 14, 2022

And you need SDK to bu build

@AsiDiaz
Copy link

AsiDiaz commented Jan 14, 2022

@jarekkt Yes, I finally managed to build it, thank you so much.

@rty813
Copy link

rty813 commented Feb 23, 2022

I solved it by add -fPIC to Livox-SDK/sdk_core/CMakeLists.txt
image
And, rebuild it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants