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 - Colcon build Error #125

Open
nicolal01 opened this issue Jun 19, 2023 · 13 comments
Open

ROS2 - Colcon build Error #125

nicolal01 opened this issue Jun 19, 2023 · 13 comments

Comments

@nicolal01
Copy link

I am trying to build this package in ubuntu 22.04 with ROS2 Humble. I get the following error log when I run colcon build.
Screenshot_20230619_134136

Does anyone know what i could do to solve this error?

@sbarber-dsi
Copy link

You have to change the code to make it build for ROS2
There's instructions in the readme

@AlessioGianu
Copy link

hi, i've followed the guideline in the readme but the colcon build command shows the follow:
Screenshot from 2023-10-05 15-56-19

How can i solve these errors? Thank you so much

@TZECHIN6
Copy link

TZECHIN6 commented Oct 6, 2023

might be you provide more details about your build step? seem you miss to source /opt/ros/<distro>/setup.bash

@AlessioGianu
Copy link

AlessioGianu commented Oct 6, 2023

Hi, thank you for answering;
the source /opt/ros/<distro>/setup.bash is present inside the bashrc file.
I followed the following steps:

  • Install via git clone
  • Install all the dependency shown in the readme
  • followed the sub-steps in the [4.3 Compile with ROS2 colcon]

I'm not expert of ROS2 so maybe I'm missing some trivial steps.
I also tried chatGPT but it wasn't helpful ( people are better ).

@sbarber-dsi
Copy link

sbarber-dsi commented Oct 6, 2023

I believe you have not configured the project to build for ROS2.
That looks like it is still trying to build against the ROS1 headers.

The Robosense ROS driver does not compile for ROS2 as-is.
You must make a number of changes in order for it to compile.

@AlessioGianu
Copy link

Sorry, do you mean changes that are not inside the readMe file?

@TZECHIN6
Copy link

TZECHIN6 commented Oct 6, 2023

Would you share your workspace structure with tree cmd? Also, could you run the demo_node example in ROS2?

I have built it several times today... all built are success.

which linux and ros version are you working on? Have you installed desktop version or base version of ROS? have you run rosdep install --from-paths src --ignore src -r -y to install dependency with rosdep?

@AlessioGianu
Copy link

Hi sorry for my late response, i have not my pc with me this WE.
I'm working with ROS2 Humble with full desktop installation and ubuntu 22.04 LTS.

I run the command rosdep install --from-paths src --ignore src -r -y inside the /robosense_ws/src/rslidar_sdk folder but didn't work so instead i run rosdep install --from-paths src -y -r and the result was "all deps are installed"

I want to thank you for your time.

The Tree structure of the ws is:
.
└── src
├── rslidar_msg
│   ├── CMakeLists.txt
│   ├── LICENSE
│   ├── msg
│   │   └── RslidarPacket.msg
│   ├── package.xml
│   ├── README.md
│   ├── ros1
│   │   ├── CMakeLists.txt
│   │   └── package.xml
│   └── ros2
│   ├── CMakeLists.txt
│   └── package.xml
└── rslidar_sdk
├── CHANGELOG.md
├── CMakeLists.txt
├── config
│   └── config.yaml
├── create_debian.sh
├── doc
│   ├── howto
│   │   ├── 04_how_to_work_along_with_rslidar_sdk_node_v1.3.x_CN.md
│   │   ├── 05_how_to_change_point_type_CN.md
│   │   ├── 05_how_to_change_point_type.md
│   │   ├── 06_how_to_decode_online_lidar_CN.md
│   │   ├── 06_how_to_decode_online_lidar.md
│   │   ├── 07_online_lidar_advanced_topics_CN.md
│   │   ├── 07_online_lidar_advanced_topics.md
│   │   ├── 08_how_to_decode_pcap_file_CN.md
│   │   ├── 08_how_to_decode_pcap_file.md
│   │   ├── 09_pcap_file_advanced_topics_CN.md
│   │   ├── 09_pcap_file_advanced_topics.md
│   │   ├── 10_how_to_use_coordinate_transformation_CN.md
│   │   ├── 10_how_to_use_coordinate_transformation.md
│   │   ├── 11_how_to_record_replay_packet_rosbag_CN.md
│   │   ├── 11_how_to_record_replay_packet_rosbag.md
│   │   ├── 12_how_to_create_deb.md
│   │   └── img
│   │   ├── 04_01_packet_rosbag.png
│   │   ├── 07_01_broadcast.png
│   │   ├── 07_02_unicast.png
│   │   ├── 07_03_multicast.png
│   │   ├── 07_04_multi_lidars_port.png
│   │   ├── 07_05_multi_lidars_ip.png
│   │   ├── 07_06_vlan_layer.png
│   │   ├── 07_07_vlan.png
│   │   └── 07_08_user_layer.png
│   ├── intro
│   │   ├── 02_parameter_intro_CN.md
│   │   ├── 02_parameter_intro.md
│   │   ├── 03_hiding_parameters_intro_CN.md
│   │   └── 03_hiding_parameters_intro.md
│   └── src_intro
│   ├── img
│   │   ├── class_destination_packet.png
│   │   ├── class_destination_pointcloud.png
│   │   ├── class_node_manager.png
│   │   ├── class_source_destination.png
│   │   ├── class_source_driver.png
│   │   └── class_source_packet_ros.png
│   └── rslidar_sdk_intro_CN.md
├── img
│   └── 01_01_download_page.png
├── launch
│   ├── elequent_start.py
│   ├── start.launch
│   └── start.py
├── LICENSE
├── node
│   └── rslidar_sdk_node.cpp
├── package.xml
├── README_CN.md
├── README.md
├── rviz
│   ├── rviz2.rviz
│   └── rviz.rviz
└── src
├── manager
│   ├── node_manager.cpp
│   └── node_manager.hpp
├── msg
│   ├── ros_msg
│   │   ├── rs_compressed_image.hpp
│   │   ├── RsCompressedImage.msg
│   │   ├── rslidar_packet.hpp
│   │   ├── rslidar_packet_legacy.hpp
│   │   ├── RslidarPacket.msg
│   │   └── rslidar_scan_legacy.hpp
│   └── rs_msg
│   └── lidar_point_cloud_msg.hpp
├── rs_driver
│   ├── CHANGELOG.md
│   ├── cmake
│   │   ├── cmake_uninstall.cmake.in
│   │   ├── FindPCAP.cmake
│   │   ├── rs_driverConfig.cmake
│   │   ├── rs_driverConfig.cmake.in
│   │   ├── rs_driverConfigVersion.cmake
│   │   └── rs_driverConfigVersion.cmake.in
│   ├── CMakeLists.txt
│   ├── demo
│   │   ├── CMakeLists.txt
│   │   ├── demo_online.cpp
│   │   ├── demo_online_multi_lidars.cpp
│   │   └── demo_pcap.cpp
│   ├── doc
│   │   ├── howto
│   │   │   ├── 07_how_to_port_your_app_from_rs_driver_1.3.x_to_1.5.x_CN.md
│   │   │   ├── 07_how_to_port_your_app_from_rs_driver_1.3.x_to_1.5.x.md
│   │   │   ├── 08_how_to_decode_online_lidar_CN.md
│   │   │   ├── 08_how_to_decode_online_lidar.md
│   │   │   ├── 09_online_lidar_advanced_topics_CN.md
│   │   │   ├── 09_online_lidar_advanced_topics.md
│   │   │   ├── 10_how_to_decode_pcap_file_CN.md
│   │   │   ├── 10_how_to_decode_pcap_file.md
│   │   │   ├── 11_pcap_file_advanced_topics_CN.md
│   │   │   ├── 11_pcap_file_advanced_topics.md
│   │   │   ├── 12_how_to_configure_by_pcap_file_CN.md
│   │   │   ├── 12_how_to_configure_by_pcap_file.md
│   │   │   ├── 13_how_to_capture_pcap_file_CN.md
│   │   │   ├── 13_how_to_capture_pcap_file.md
│   │   │   ├── 14_how_to_use_rs_driver_viewer_CN.md
│   │   │   ├── 14_how_to_use_rs_driver_viewer.md
│   │   │   ├── 15_how_to_transform_pointcloud_CN.md
│   │   │   ├── 15_how_to_transform_pointcloud.md
│   │   │   ├── 16_how_to_compile_on_windows_CN.md
│   │   │   ├── 16_how_to_compile_on_windows.md
│   │   │   ├── 17_how_to_avoid_packet_loss_CN.md
│   │   │   ├── 17_how_to_avoid_packet_loss.md
│   │   │   ├── 18_about_point_layout_CN.md
│   │   │   ├── 18_about_point_layout.md
│   │   │   ├── 19_about_splitting_frame_CN.md
│   │   │   ├── 19_about_splitting_frame.md
│   │   │   ├── 20_about_usage_of_cpu_and_memory_CN.md
│   │   │   ├── 20_about_usage_of_cpu_and_memory.md
│   │   │   ├── 21_how_to_parse_difop_CN.md
│   │   │   ├── 21_how_to_parse_difop.md
│   │   │   └── img
│   │   │   ├── 07_01_branches.png
│   │   │   ├── 07_02_cpu_usage_dev.png
│   │   │   ├── 07_03_cpu_usage_dev_opt.png
│   │   │   ├── 09_01_broadcast.png
│   │   │   ├── 09_02_unicast.png
│   │   │   ├── 09_03_multicast.png
│   │   │   ├── 09_04_multi_lidars_port.png
│   │   │   ├── 09_05_multi_lidars_ip.png
│   │   │   ├── 09_06_vlan_layer.png
│   │   │   ├── 09_07_vlan.png
│   │   │   ├── 09_08_user_layer.png
│   │   │   ├── 12_01_select_by_port.png
│   │   │   ├── 12_02_select_by_non_port.png
│   │   │   ├── 12_03_rs32_msop_packet.png
│   │   │   ├── 12_04_rs32_difop_packet.png
│   │   │   ├── 12_05_with_vlan.png
│   │   │   ├── 12_06_with_user_layer.png
│   │   │   ├── 12_07_with_tail_layer.png
│   │   │   ├── 12_08_not_supported.png
│   │   │   ├── 13_01_wireshark_select_nic.png
│   │   │   ├── 13_02_wireshark_capture.png
│   │   │   ├── 13_03_wireshark_filter_by_port.png
│   │   │   ├── 13_04_wireshark_export_all.png
│   │   │   ├── 13_05_wireshark_export_range.png
│   │   │   ├── 13_06_wireshark_mark.png
│   │   │   ├── 13_07_wireshark_export_marked.png
│   │   │   ├── 13_08_wireshark_export_marked_range.png
│   │   │   ├── 14_01_rs_driver_viewer_point_cloud.png
│   │   │   ├── 16_01_demo_project.png
│   │   │   ├── 16_02_demo_use_cpp14.png
│   │   │   ├── 16_03_demo_extra_include.png
│   │   │   ├── 16_04_demo_include_path.png
│   │   │   ├── 16_05_demo_lib_path.png
│   │   │   ├── 16_06_demo_lib.png
│   │   │   ├── 16_07_demo_precompile_macro.png
│   │   │   ├── 16_08_viewer_install_pcl.png
│   │   │   ├── 16_09_viewer_install_pcl_dep.png
│   │   │   ├── 16_10_viewer_add_env_var.png
│   │   │   ├── 16_11_viewer_project.png
│   │   │   ├── 16_12_viewer_sdl_check.png
│   │   │   ├── 16_13_viewer_include_path.png
│   │   │   ├── 16_14_viewer_lib_path.png
│   │   │   ├── 16_15_viewer_lib.png
│   │   │   ├── 16_16_viewer_precompile_macro.png
│   │   │   ├── 18_01_mech_lasers.png
│   │   │   ├── 18_02_mems_lasers.png
│   │   │   ├── 18_03_mech_lasers_and_points.png
│   │   │   ├── 18_04_mech_points.png
│   │   │   ├── 18_05_mems_lasers_and_points.png
│   │   │   ├── 18_06_mems_points.png
│   │   │   ├── 19_01_split_angle.png
│   │   │   ├── 19_02_safe_range.png
│   │   │   └── 20_01_components_and_threads.png
│   │   ├── intro
│   │   │   ├── 02_directories_and_files_CN.md
│   │   │   ├── 02_directories_and_files.md
│   │   │   ├── 03_thread_model_CN.md
│   │   │   ├── 03_thread_model.md
│   │   │   ├── 04_parameter_intro_CN.md
│   │   │   ├── 04_parameter_intro.md
│   │   │   ├── 05_cmake_macros_intro_CN.md
│   │   │   ├── 05_cmake_macros_intro.md
│   │   │   ├── 06_error_code_intro_CN.md
│   │   │   ├── 06_error_code_intro.md
│   │   │   └── img
│   │   │   ├── 03_01_components_and_threads.png
│   │   │   └── 03_02_interface_with_threads.png
│   │   └── src_intro
│   │   ├── img
│   │   │   ├── class_azimuth_section.png
│   │   │   ├── class_chan_angles.png
│   │   │   ├── class_decoder_factory.png
│   │   │   ├── class_decoder_mech.png
│   │   │   ├── class_decoder.png
│   │   │   ├── class_decoder_rsbp.png
│   │   │   ├── class_decoder_rsm1.png
│   │   │   ├── class_distance_section.png
│   │   │   ├── classes_block_iterator.png
│   │   │   ├── classes_decoder.png
│   │   │   ├── classes_input.png
│   │   │   ├── classes_rs16_block_iterator.png
│   │   │   ├── classes_split_strategy_by_seq.png
│   │   │   ├── classes_split_strategy.png
│   │   │   ├── class_input_factory.png
│   │   │   ├── class_input_pcap.png
│   │   │   ├── class_input.png
│   │   │   ├── class_input_raw.png
│   │   │   ├── class_input_sock.png
│   │   │   ├── class_lidar_driver_impl.png
│   │   │   ├── class_trigon.png
│   │   │   ├── components.png
│   │   │   ├── fov.png
│   │   │   ├── msop_dual_return.png
│   │   │   ├── msop_ruby128.png
│   │   │   ├── msop_single_return.png
│   │   │   ├── packet_layers_full.png
│   │   │   ├── packet_layers.png
│   │   │   ├── packet_record_replay.png
│   │   │   ├── rs16_msop_dual_return.png
│   │   │   ├── rs16_msop_single_return.png
│   │   │   ├── safe_range.png
│   │   │   ├── split_angle.png
│   │   │   ├── split_position.png
│   │   │   └── trigon_sinss.png
│   │   └── rs_driver_intro_CN.md
│   ├── LICENSE
│   ├── README_CN.md
│   ├── README.md
│   ├── src
│   │   └── rs_driver
│   │   ├── api
│   │   │   └── lidar_driver.hpp
│   │   ├── common
│   │   │   ├── error_code.hpp
│   │   │   ├── rs_common.hpp
│   │   │   └── rs_log.hpp
│   │   ├── driver
│   │   │   ├── decoder
│   │   │   │   ├── basic_attr.hpp
│   │   │   │   ├── block_iterator.hpp
│   │   │   │   ├── chan_angles.hpp
│   │   │   │   ├── decoder_factory.hpp
│   │   │   │   ├── decoder.hpp
│   │   │   │   ├── decoder_mech.hpp
│   │   │   │   ├── decoder_RS128.hpp
│   │   │   │   ├── decoder_RS16.hpp
│   │   │   │   ├── decoder_RS32.hpp
│   │   │   │   ├── decoder_RS48.hpp
│   │   │   │   ├── decoder_RS80.hpp
│   │   │   │   ├── decoder_RSBP.hpp
│   │   │   │   ├── decoder_RSE1.hpp
│   │   │   │   ├── decoder_RSHELIOS_16P.hpp
│   │   │   │   ├── decoder_RSHELIOS.hpp
│   │   │   │   ├── decoder_RSM1.hpp
│   │   │   │   ├── decoder_RSM1_Jumbo.hpp
│   │   │   │   ├── decoder_RSM2.hpp
│   │   │   │   ├── decoder_RSP128.hpp
│   │   │   │   ├── decoder_RSP48.hpp
│   │   │   │   ├── decoder_RSP80.hpp
│   │   │   │   ├── member_checker.hpp
│   │   │   │   ├── section.hpp
│   │   │   │   ├── split_strategy.hpp
│   │   │   │   └── trigon.hpp
│   │   │   ├── driver_param.hpp
│   │   │   ├── input
│   │   │   │   ├── input_factory.hpp
│   │   │   │   ├── input.hpp
│   │   │   │   ├── input_pcap.hpp
│   │   │   │   ├── input_pcap_jumbo.hpp
│   │   │   │   ├── input_raw.hpp
│   │   │   │   ├── input_raw_jumbo.hpp
│   │   │   │   ├── input_sock.hpp
│   │   │   │   ├── input_sock_jumbo.hpp
│   │   │   │   ├── jumbo.hpp
│   │   │   │   ├── unix
│   │   │   │   │   ├── input_sock_epoll.hpp
│   │   │   │   │   └── input_sock_select.hpp
│   │   │   │   └── win
│   │   │   │   └── input_sock_select.hpp
│   │   │   └── lidar_driver_impl.hpp
│   │   ├── macro
│   │   │   ├── version.hpp
│   │   │   └── version.hpp.in
│   │   ├── msg
│   │   │   ├── packet.hpp
│   │   │   ├── pcl_point_cloud_msg.hpp
│   │   │   └── point_cloud_msg.hpp
│   │   └── utility
│   │   ├── buffer.hpp
│   │   ├── dbg.hpp
│   │   └── sync_queue.hpp
│   ├── test
│   │   ├── ab_dual_return_block_iterator_test.cpp
│   │   ├── basic_attr_test.cpp
│   │   ├── buffer_test.cpp
│   │   ├── chan_angles_test.cpp
│   │   ├── CMakeLists.txt
│   │   ├── decoder_rs16_test.cpp
│   │   ├── decoder_rs32_test.cpp
│   │   ├── decoder_rsbp_test.cpp
│   │   ├── decoder_test.cpp
│   │   ├── dual_return_block_iterator_test.cpp
│   │   ├── res
│   │   │   └── angle.csv
│   │   ├── rs16_dual_return_block_iterator_test.cpp
│   │   ├── rs16_single_return_block_iterator_test.cpp
│   │   ├── rs_driver_test.cpp
│   │   ├── section_test.cpp
│   │   ├── single_return_block_iterator_test.cpp
│   │   ├── split_strategy_test.cpp
│   │   ├── sync_queue_test.cpp
│   │   └── trigon_test.cpp
│   ├── tool
│   │   ├── CMakeLists.txt
│   │   ├── rs_driver_pcdsaver.cpp
│   │   └── rs_driver_viewer.cpp
│   └── win
│   ├── demo_online
│   │   └── demo_online.vcxproj
│   ├── demo_pcap
│   │   └── demo_pcap.vcxproj
│   ├── rs_driver.sln
│   └── rs_driver_viewer
│   └── rs_driver_viewer.vcxproj
├── source
│   ├── source_driver.hpp
│   ├── source.hpp
│   ├── source_packet_ros.hpp
│   └── source_pointcloud_ros.hpp
└── utility
├── common.hpp
└── yaml_reader.hpp

53 directories, 298 files

@TZECHIN6
Copy link

from what i saw in here is that, you put all the packages outside the src directory.

If you follow the ros2_ws structure should look like this:

ros2_ws
└── src
    ├── package1
    ├── package2
    └── ...

Under the root dir ros2_ws, run cmd rosdep install --from-paths src --ignore-src -r -y should install all required dependencies.

@AlessioGianu
Copy link

Hi, maybe the tree structure shows not correctly the structure; i don't know why but the structure is like you posted and the command for dependencies tell me all is installed correctly. I will try on another computer to understand better why this happens

@TZECHIN6
Copy link

One of my new team members also encountered some weird issues, he told me that after reinstalling everything CAREFULLY and structured, the build was a success.

I am not sure do you run any venv or conda I suggest not to use it for now if you have used those and build on top of it.

You could log down the step when reinstalling, then might be I could help a better understanding which part cause the issue

@AlessioGianu
Copy link

I'm not using any environments at all.
I will try to reinstall all as you suggests, and than the next days there will be a colleague of mine that had used this sensor before so maybe with 4 hands we will be able to solve this issue. Thanks for now and if the problems subsist, and if you have time and you want, i will ask you again.
Thanks so much for your time and your suggestions.

@TZECHIN6
Copy link

Yeah I will reply when I am free. Just leave the finding and step to reproduce in here.

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

4 participants