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 failed to build ros2 wrapper #2531

Closed
Martzi opened this issue Nov 3, 2022 · 12 comments
Closed

[ros2] colcon failed to build ros2 wrapper #2531

Martzi opened this issue Nov 3, 2022 · 12 comments
Labels

Comments

@Martzi
Copy link

Martzi commented Nov 3, 2022

System: ubuntu focal, x64
ROS: ros2 galaxy
SDK: librealsense2=2.51.1-0~realsense0.7526

My problem is that I tried to compile ros2 wrapper with colcon, but I get the following error. I tried with all the different branches for ros2 (ros2-development, ros2-legacy, old/ros2-511) both fail at the same place.

CMake Error at /home/ubuntu/docker-home/robot_ws/install/realsense2_camera_msgs/share/realsense2_camera_msgs/cmake/ament_cmake_export_targets-extras.cmake:18 (message):
  Failed to find exported target names in
  '/home/ubuntu/docker-home/robot_ws/install/realsense2_camera_msgs/share/realsense2_camera_msgs/cmake/realsense2_camera_msgs__rosidl_generator_cExport.cmake'
Call Stack (most recent call first):
  /home/ubuntu/docker-home/robot_ws/install/realsense2_camera_msgs/share/realsense2_camera_msgs/cmake/realsense2_camera_msgsConfig.cmake:41 (include)
  CMakeLists.txt:93 (find_package)
@MartyG-RealSense
Copy link
Collaborator

Hi @Martzi The wrapper names were changed 3 days ago at the time of writing this, as described at #2527

Have you previously been able to install the ROS2 wrapper on Galactic before this change, please?

@Martzi
Copy link
Author

Martzi commented Nov 3, 2022

Hi!
I just tried this yesterday and today and the error is the same.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 3, 2022

I will highlight your case to the RealSense ROS team. Thanks very much for your patience.

The address /home/ubuntu/docker-home/robot_ws refers to Docker. Can you confirm whether you are using Docker, please?

@Martzi
Copy link
Author

Martzi commented Nov 3, 2022

Yes, I forgot to mention that. It is inside a docker image. Should I give additional details about that?

@MartyG-RealSense
Copy link
Collaborator

Yes please, additional details about your docker image are welcome in case it is a factor in your problem.

@Martzi
Copy link
Author

Martzi commented Nov 3, 2022

i use dorowu/ubuntu-desktop-lxde-vnc:focal as a base image https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc

I cloned the UR ros2 repo locally, copy to the docker environment and build there with colcon.

RUN mkdir -p /home/ubuntu/docker-home/robot_ws/src

ENV COLCON_WS=/home/ubuntu/docker-home/robot_ws

WORKDIR /home/ubuntu/docker-home/robot_ws

COPY /docker-home/robot_ws/src /src

RUN colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 3, 2022

Does it make any difference if you simply use colcon build instead of adding the Release arg, since the official instructions only specify colcon build

https://github.com/IntelRealSense/realsense-ros#step-5-build

Also, have the rosdep dependencies in Step 4 been installed?

https://github.com/IntelRealSense/realsense-ros#step-4-install-dependencies

@SamerKhshiboun
Copy link
Contributor

SamerKhshiboun commented Nov 3, 2022

Hey @Martzi ,
Can you please tell me what is the cmake version ? (cmake --version)
Because if it is 3.24.0 and above, you might face a problem as I issued here:
actions/runner-images#6179 (comment)
You should make sure your docker image has a lower cmake version or has a cmake version that includes the fix like this one:
ament/ament_cmake#395

@Martzi
Copy link
Author

Martzi commented Nov 3, 2022

Also, have the rosdep dependencies in Step 4 been installed?

Yes, Step 4 also done

Can you please tell me what is the cmake version ? (cmake --version)

Thanks for the question, I am using Cmake 3.8 so definitely above 3.24. I will check it on later if it is the issue and reply!

@MartyG-RealSense
Copy link
Collaborator

Hi @Martzi Do you have an update about this case that you can provide, please? Thanks!

@Martzi
Copy link
Author

Martzi commented Nov 10, 2022

Hi, sorry for the late reply.

Finally I have time to test it out and yes, it was really the cmake version mismatch, it really does not prefer above 3.24.0.
Thans @SamerKhshiboun and @MartyG-RealSense !

@Martzi Martzi closed this as completed Nov 10, 2022
@MartyG-RealSense
Copy link
Collaborator

You are very welcome, @Martzi - it's excellent news that the problem is resolved. Thanks very much for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants