Build error in ROS Humble: pcl_msgs/msg/point_indices.hpp not found in pcl_conversions
I am currently using ROS Humble and encountering an error during the build process. Specifically, the file pclmsgs/msg/pointindices.hpp cannot be found. This error occurs when trying to build the scanmatcher package(my package), which utilizes pcl_conversions.
Here are the details of the error message: This happens in both local and CI environments. https://github.com/rsasaki0109/li_slam_ros2/actions/runs/4954408589/jobs/8862872227
In file included from /home/runner/ros2_ws/src/li_slam_ros2/scanmatcher/include/scanmatcher/utility.h:60,
from /home/runner/ros2_ws/src/li_slam_ros2/scanmatcher/src/imu_preintegration.cpp:31:
/opt/ros/humble/include/pcl_conversions/pcl_conversions.h:61:10: fatal error: pcl_msgs/msg/point_indices.hpp: No such file or directory
61 | #include <pcl_msgs/msg/point_indices.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/imu_preintegration.dir/build.make:76: CMakeFiles/imu_preintegration.dir/src/imu_preintegration.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:195: CMakeFiles/imu_preintegration.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Failed <<< scanmatcher [2min 49s, exited with code 2]
What's puzzling is that pcl_conversions is installed via apt, so I'm not sure why this error is occurring. There doesn't seem to be a problem with the CMakeLists.txt, and all the other dependency packages should be installed as well. Any hints or suggestions to solve this problem would be greatly appreciated.
Thank you in advance for your help.
Asked by ryohei sasaki on 2023-05-12 20:01:39 UTC
Answers
Resolved https://github.com/rsasaki0109/li_slam_ros2/pull/21
Asked by ryohei sasaki on 2023-06-08 17:41:30 UTC
Comments
Glad we're seeing at least one resolution. For future, linking to external sites is unreliable way of sharing a solution (e.g. what if the external site becomes unavailable). I'm trying to list what was effective from the PR li_slam_ros2!21.
- For the very error in OP's output where a header file that is provided by
pcl_msgs
was somehow not found, looks like the pkgscanmatcher
was missingfind_package
andament_target_dependencies
it.
That should be it, nice find.
Btw, the following is just what I noticed.
I see many lines where you switch from the smart pointers provided by the library (PCL) to the one provided by
boost
. I feel that is a bit counter-trend of moving away from boost's smart pointer. I don't know. E.g.:- OLD
#include <pcl/filters/boost.h>
- NEW
#include <boost/shared_ptr.hpp>
- OLD
It is
find_package(PCL 1.12
ing. Did you really need a versioned library?
Asked by 130s on 2023-06-09 05:12:37 UTC
Comments
Thank you very much for your kind input.
You are absolutely right about the multiple lines where the switch to boost's smart pointers is happening. I hadn't noticed that before, and I appreciate you bringing it to my attention. I will make the necessary corrections.
Regarding the need for version specification, I'm not sure if it was truly necessary. The changes were introduced during the transition from foxy to humble, and I haven't examined them as they were contributed by external contributors. I will investigate this further and ensure its validity.
Once again, thank you for your valuable insights and assistance.
Asked by ryohei sasaki on 2023-06-09 08:31:39 UTC
Comments
Are you adding pcl_msgs as a dependency in your CMake?
Asked by Bernat Gaston on 2023-05-15 06:07:10 UTC
Yes, I am adding pcl_msgs as a dependency in my CMake file.
Asked by ryohei sasaki on 2023-05-15 07:20:17 UTC
Ok. Can you search for this file? I usually use locate for finding these files. Just to see if the file is in the system. Sometimes the headers come in the -dbg package of the library which comes separately in apt.
Asked by Bernat Gaston on 2023-05-15 07:26:49 UTC
I am also verifying the existence of 'pcl_msgs/msg/point_indices.hpp' using the 'locate' command. By the way, I didn't find a solution even when asking ChatGPT-4
Asked by ryohei sasaki on 2023-05-15 09:07:26 UTC
sudo apt install locate sudo updatedb locate point_indices.hpp
Asked by Bernat Gaston on 2023-05-15 09:11:07 UTC
Took a deeper look and yet I haven't found a culprit (assuming https://github.com/rsasaki0109/li_slam_ros2/pull/14 is what this question is based on). I'd re-run the same CI job and see (sorry for a dumb suggestion)?
Asked by 130s on 2023-05-15 15:05:42 UTC
@Bernat Gaston The result of the "locate point_indices.hpp" command is shown below. It happened both locally and in CI.
/opt/ros/humble/include/pcl_msgs/pcl_msgs/msg/point_indices.hpp
Asked by ryohei sasaki on 2023-05-15 18:54:21 UTC
@130s This problem is reproduced even after running CI many times...
Asked by ryohei sasaki on 2023-05-15 18:56:18 UTC
Wait, have you tried this execution in your local before going to the CI? In my experiencie github CI gives a lot of problems with ROS
Asked by Bernat Gaston on 2023-05-16 01:24:18 UTC
Yes, I have tried this execution locally
Asked by ryohei sasaki on 2023-05-16 04:47:23 UTC
simply I added directory name, but another errors appered.
Asked by Ebisuno on 2023-05-25 03:31:12 UTC