Ar-Ray-code / rpi-bullseye-ros2

ROS2-Jazzy for Raspbian-bookworm
https://zenn.dev/array/books/raspi_os_de_hajimeru_ros2_2
MIT License
86 stars 19 forks source link

colcon build problem #25

Closed wyfwyfwyf1234567 closed 4 weeks ago

wyfwyfwyf1234567 commented 1 month ago

Hi! Thank you for sharing the files. I have installed the jazzy on raspberry pi 5 (bookworm) according to your instruction. However, when I run the conmand 'colcon build', the following error occurs. Could you please help me fix the problem? 59b33b8609b76ba1d0ec9987ff38570

Ar-Ray-code commented 1 month ago

First, please tell me how to reproduction this.. (From ros2-jazzy installatin)

wyfwyfwyf1234567 commented 1 month ago

The reproduction steps:

  1. wget https://s3.ap-northeast-1.wasabisys.com/download-raw/dpkg/ros2-desktop/debian/bookworm/ros-jazzy-desktop- 0.3.2_20240525_arm64.deb
  2. sudo apt install ./ros-jazzy-desktop-0.3.2_20240525_arm64.deb
  3. sudo pip install --break-system-packages vcstool colcon-common-extensions
  4. source /opt/ros/jazzy/setup.bash
  5. mkdir -p /ros2_ws/src
  6. cd /ros2_ws
  7. sudo git clone https://github.com/ros2/examples src/examples -b jazzy
  8. sudo colcon build --symlink-install
Ar-Ray-code commented 1 month ago

Don't use colcon with sudo. You can build without admin privileges.

[!TIP] Why is colcon installed with sudo pip install colcon-common-extensions? -> Because you need admin privileges to install under /usr/local/bin. You can use which colcon to check where the colcon command is located.

Ar-Ray-code commented 1 month ago

However, I didn't get the same error log as yours, so I don't know if this will solve the problem.

wyfwyfwyf1234567 commented 1 month ago

Thanks for your reply. it didn't work for me. May be I need to find other solution. thank you.

Ar-Ray-code commented 1 month ago

Maybe your ROS environment is broken...

Please show me the console result of find /opt/ros/ -name rclcppConcifg.cmake.


Expected result is /opt/ros/jazzy/share/rclcpp/cmake/rclcppConfig.cmake

wyfwyfwyf1234567 commented 1 month ago

The console result shows nothing.... e48406b72ecad7b64eea9054f4d8066

Ar-Ray-code commented 1 month ago

It is likely that the dpkg is corrupt or has disappeared due to an unexpected error during installation (or subsequent operation).

In fact, I found rclcppConfig.cmake from https://s3.ap-northeast-1.wasabisys.com/download-raw/dpkg/ros2-desktop/debian/bookworm/ros-jazzy-desktop-0.3.2_20240525_arm64.deb. (same pkg from your procedure)

Reinstall it and check that there are no errors in its execution process.

~$ dpkg -c ros-jazzy-desktop-0.3.2_20240525_arm64.deb | grep rclcppConfig.cmake
-rw-r--r-- root/root      1379 2024-05-25 10:27 ./opt/ros/jazzy/share/rclcpp/cmake/rclcppConfig.cmake
-rw-r--r-- root/root      1336 2024-05-25 10:27 ./opt/ros/jazzy/share/test_rclcpp/cmake/test_rclcppConfig.cmake
wyfwyfwyf1234567 commented 1 month ago

I reinstalled the bookworm on raspberry pi 5 and then reinstalled the sudo apt install ./ros-jazzy-desktop-0.3.2_20240525_arm64.deb. The colsole shows following result. (Notice) bb89070349209e5f79c95137e574174 Then I try to do colcon build according to the reproduction steps. The colsole shows the result: 0c9b368d4b2ded104e08cae9d1e7f9a Then I type dpkg -c ros-jazzy-desktop-0.3.2_20240525_arm64.deb | grep ament_cmakeConfig.cmake the result is showed below. 3667df60cc5147246afa3d40f32681e The package is already included in the deb, but it cannot be found. This may be the problem. Could you please give me some suggestions? Thanks

Ar-Ray-code commented 1 month ago

Your log during installation look like same as mine...

If you can find the file with find /opt/ros/ -name rclcppConcifg.cmake, try deleting the build cache. (maybe you've already run)

rm -rf ~/ros2_ws/install ~/ros2_ws/build

# after removing the cache, run following
source /opt/ros/jazzy/setup.bash
colcon build
wyfwyfwyf1234567 commented 4 weeks ago

I tried to build the official example in the official docker image, and the same error occurred. I tried the ros2 code provided by others, and it built normally. So I guess there is a problem in the official example. Thank you for your help.:>