ozandmrz / raspberry_pi_visual_slam

This repository contains a comprehensive guide and setup scripts for implementing Visual SLAM on Raspberry Pi 5 using ROS2 Humble, ORB-SLAM3, and RViz2 with Raspberry Pi Camera Module 3. It includes detailed instructions for installation, configuration, and running a Visual SLAM system for real-time camera data processing and visualization.
4 stars 0 forks source link

Errors building ros2_mono_publisher #1

Open dougmatic2000 opened 10 hours ago

dougmatic2000 commented 10 hours ago

Thanks for putting this together and sharing.

Using: Raspberry Pi 5 Raspberry OS 64bit Bookworm Debian 12

I flashed a new SD card with OS and followed your instructions. It compiled and built to this point in "Publishing ORB SLAM3 Data in ROS2":

rosdep install --from-paths src --ignore-src -r -y
colcon build

This gives many similar errors, sample:

In file included from /home/pibot5/ros2_pose/src/orb_slam3_ros2_mono_publisher/src/monocular/monocular-slam-node.cpp:7:
/home/pibot5/ros2_humble/install/sensor_msgs/include/sensor_msgs/sensor_msgs/image_encodings.hpp: At global scope:
/home/pibot5/ros2_humble/install/sensor_msgs/include/sensor_msgs/sensor_msgs/image_encodings.hpp:43:12: error: conflicting declaration ‘const char sensor_msgs::image_encodings::RGB8 []’
   43 | const char RGB8[] = "rgb8";
      |            ^~~~
In file included from /usr/include/cv_bridge/cv_bridge.h:41,
                 from /home/pibot5/ros2_pose/src/orb_slam3_ros2_mono_publisher/src/monocular/monocular-slam-node.hpp:9,
                 from /home/pibot5/ros2_pose/src/orb_slam3_ros2_mono_publisher/src/monocular/monocular-slam-node.cpp:1:
/usr/include/sensor_msgs/image_encodings.h:47:23: note: previous declaration as ‘const string sensor_msgs::image_encodings::RGB8’
   47 |     const std::string RGB8 = "rgb8";
      |                       ^~~~

There seems to be two different versions of cv_bridge; one built from source, the other possibly installed in /usr/include/sensor_msgs/image_encodings.h from dependency:

Get:19 http://deb.debian.org/debian bookworm/main arm64 libsensor-msgs-dev arm64 1.13.1-1+b1 [40.4 kB]
Get:20 http://deb.debian.org/debian bookworm/main arm64 libcv-bridge-dev arm64 1.16.2+ds-1+b3 [13.1 kB]

Do you know how to resolve this issue?

ozandmrz commented 9 hours ago

I'm not entirely sure about the solution. I haven't encountered this error before, but it might be caused by a conflict in the dependencies. Are libsensor-msgs-dev or libcv-bridge-dev installed? If so, removing them might help resolve the issue.