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

ROS2 Galactic Compatibility #44

Open
wants to merge 13 commits into
base: ROS2
Choose a base branch
from

Conversation

dadaroce
Copy link

@dadaroce dadaroce commented Nov 30, 2021

This PR performs some changes to launch the wrapper using galactic ROS2 distribution.

I guess it's better to locate this PR and not merge to the dashing branch that you have currently made.

@dadaroce dadaroce mentioned this pull request Nov 30, 2021
@josephlu-robot
Copy link

josephlu-robot commented Aug 3, 2022

Thanks for this PR!
However, I confront a problem after doing colcon build:

/home/ros2_ws/install/hesai_lidar/lib/hesai_lidar/hesai_lidar_node: error while loading shared libraries: libPandarGeneral.so: cannot open shared object file: No such file or directory
[ERROR] [hesai_lidar_node-1]: process has died [pid 87514, exit code 127, cmd '/home/ros2_ws/install/hesai_lidar/lib/hesai_lidar/hesai_lidar_node --ros-args -r __node:=hesai_node -r __ns:=/hesai --params-file /tmp/launch_params_68fka05e --params-file /tmp/launch_params_fj_hx739 --params-file /tmp/launch_params_fnfnzkic --params-file /tmp/launch_params_h9sjd9cp --params-file /tmp/launch_params_s7ka_33y --params-file /tmp/launch_params_wfnh3ero --params-file /tmp/launch_params_gg5t4lp1 --params-file /tmp/launch_params_nxv60w57 --params-file /tmp/launch_params_sk3xwox6 --params-file /tmp/launch_params_t9lojl9u --params-file /tmp/launch_params_c6xqdh2b --params-file /tmp/launch_params_ybuifwhf --params-file /tmp/launch_params_2eka_84z --params-file /tmp/launch_params_u_ol4we2 --params-file /tmp/launch_params_iw6injdu --params-file /tmp/launch_params_4ltr97s4'].

Any ideas?

@dadaroce
Copy link
Author

dadaroce commented Aug 3, 2022

Thanks for this PR! However, I confront a problem after doing colcon build:

/home/ros2_ws/install/hesai_lidar/lib/hesai_lidar/hesai_lidar_node: error while loading shared libraries: libPandarGeneral.so: cannot open shared object file: No such file or directory
[ERROR] [hesai_lidar_node-1]: process has died [pid 87514, exit code 127, cmd '/home/ros2_ws/install/hesai_lidar/lib/hesai_lidar/hesai_lidar_node --ros-args -r __node:=hesai_node -r __ns:=/hesai --params-file /tmp/launch_params_68fka05e --params-file /tmp/launch_params_fj_hx739 --params-file /tmp/launch_params_fnfnzkic --params-file /tmp/launch_params_h9sjd9cp --params-file /tmp/launch_params_s7ka_33y --params-file /tmp/launch_params_wfnh3ero --params-file /tmp/launch_params_gg5t4lp1 --params-file /tmp/launch_params_nxv60w57 --params-file /tmp/launch_params_sk3xwox6 --params-file /tmp/launch_params_t9lojl9u --params-file /tmp/launch_params_c6xqdh2b --params-file /tmp/launch_params_ybuifwhf --params-file /tmp/launch_params_2eka_84z --params-file /tmp/launch_params_u_ol4we2 --params-file /tmp/launch_params_iw6injdu --params-file /tmp/launch_params_4ltr97s4'].

Any ideas?

Try to build using:
colcon build --symlink-install --packages-up-to hesai_lidar

Is there any error/warning logs?

@josephlu-robot
Copy link

josephlu-robot commented Aug 3, 2022

I got the same error after try using colcon build --symlink-install --packages-up-to hesai_lidar

but with a warning:

[0.441s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/ros2_ws/install/hesai_lidar' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.443s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/ros2_ws/install/hesai_lidar' in the environment variable CMAKE_PREFIX_PATH doesn't exist

@dadaroce
Copy link
Author

dadaroce commented Aug 3, 2022

What's the output of sudo find / -name *libPandarGeneral.so*?

@josephlu-robot
Copy link

/home/ros2_ws/build/hesai_lidar/libPandarGeneral.so

@josephlu-robot
Copy link

josephlu-robot commented Aug 9, 2022

I've tried this but it still doesn't work:

I think some modification in the CMakeLists.txt is needed?

@josephlu-robot
Copy link

install(TARGETS PandarGeneral
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

Add this section will fix the problem.

@dadaroce
Copy link
Author

dadaroce commented Aug 9, 2022

Nice! Not sure why it didn't work out of the box. Maybe a member of the Hesai Team someday will review this PR.

@Chris7462
Copy link

Thank you for this PR.

I'm trying to make this PR compatible with ROS Humble. However, there is a build error that I'm not sure where to modify the CMakeLists.txt. Could you please help? Thank you.

src/HesaiLidar_General_ROS/src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pandarGeneral_internal.h:37:10: fatal error: tf2_ros/transform_listener.h: No such file or directory
37 | #include <tf2_ros/transform_listener.h>

@dadaroce
Copy link
Author

dadaroce commented Mar 6, 2023

Thank you for this PR.

I'm trying to make this PR compatible with ROS Humble. However, there is a build error that I'm not sure where to modify the CMakeLists.txt. Could you please help? Thank you.

src/HesaiLidar_General_ROS/src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pandarGeneral_internal.h:37:10: fatal error: tf2_ros/transform_listener.h: No such file or directory 37 | #include <tf2_ros/transform_listener.h>

@Chris7462 try replacing:

#include <tf2_ros/transform_listener.h>

to

#include <tf2_ros/transform_listener.hpp>

Ros2 humble remove all the old .h files and replace them with the new .hpp format.

@dadaroce
Copy link
Author

dadaroce commented Mar 6, 2023

Looks like no one will merge this PR haha

@Chris7462
Copy link

@dadaroce Thank you. However it still shows the same error

src/HesaiLidar_General_ROS/src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pandarGeneral_internal.h:37:10: fatal error: tf2_ros/transform_listener.h: No such file or
37 | #include <tf2_ros/transform_listener.hpp>

I believe the problem is from the CMakeLists.txt. It didn't include any ROS related header in the PandarGeneralRaw.

@dadaroce
Copy link
Author

dadaroce commented Mar 6, 2023

Do you have tf2_ros installed?

apt install ros-humble-tf2-ros

@Chris7462
Copy link

Yes, I did have the tf2_ros installed.

@dadaroce
Copy link
Author

dadaroce commented Mar 6, 2023

Could you please show me your repo? maybe there are some missing dependencies on the CMake
I mean, do you have any Fork?

@Chris7462
Copy link

@dadaroce So, what I did is cloned your repo and built it with ROS Humble. The error shows the same as the previous comment.

Do you have ROS Humble installed? If yes, could you please try to build your repo with it? Thank you.

@dadaroce
Copy link
Author

dadaroce commented Mar 6, 2023

Sure! Tomorrow I'll give you a hand with it.

@Chris7462
Copy link

Sure! Tomorrow I'll give you a hand with it.

Hi @dadaroce any luck with it? Please let me know if there's anything that I can help with.

@dadaroce
Copy link
Author

Hi @Chris7462, you could solve it adding these lines:

ament_target_dependencies(PandarGeneral 
  "tf2_ros"
)

However, looks like you should perform some work around it to fully build that package using Humble.

@dadaroce
Copy link
Author

@Chris7462 please check this branch: https://github.com/kiwicampus/HesaiLidar_General_ROS/tree/ros2-humble I've made some updates to fully build on Humble. However, I don't have any Hesai LIDAR so, I'm not able to test it.

Also, you could notice that this PR and the Humble branch were made some time ago and there were several changes on the main branch.

@Chris7462
Copy link

@dadaroce Thank you. I will test your Humble branch.

@Chris7462
Copy link

@dadaroce Need to add this section in your ros2-humble branch. I have tested it on the PandarQT. Your branch works.

install(TARGETS PandarGeneral
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

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

Successfully merging this pull request may close these issues.

3 participants