Build Error For zed-ros2-examples in zed_aruco_localization

I’m using ros2 humble, jetpack v6 and zed sdk v4.1.3.
I have a ros2 workspace where I’ve installed zed-ros2-wrapper.
I’m trying to install zed-ros2-examples in that same workspace but I get a colcon build error such as the following:

CMake Error at cmake_install.cmake:69 (file):
file INSTALL cannot find
“/home/user/ros2_ws/src/zed-ros2-examples/examples/zed_aruco_localization/DIRECTORY”:
No such file or directory.

home/user/ros2_ws/src/zed-ros2-examples/examples/zed_aruco_localization does exist.
The workspace has the following structure:

ros2_ws

src

zed-ros2-examples
zed-ros2-wrapper

The steps I followed:

mkdir -p ~/ros2_ws/src/
cd ~/ros2_ws/src/
git clone --recursive GitHub - stereolabs/zed-ros2-wrapper: ROS 2 wrapper for the ZED SDK
cd …
sudo apt update
rosdep update
rosdep install --from-paths src --ignore-src -r -y
colcon build
cd ~/ros2_ws/src/
git clone GitHub - stereolabs/zed-ros2-examples: A collection of examples and tutorials to illustrate how to better use the ZED cameras in the ROS2 framework
cd …/
sudo apt update
rosdep update
rosdep install --from-paths src --ignore-src -r -y
colcon build ← ERROR

I’ve tried the usual tricks such as rm -rf build/ install/ log/ and using --recursive when cloning zed-ros2-examples.

I don’t want to ignore this package as I’d like to be able to use it.

I just pushed a fix for OpenCV compatibility issues. Please update the zed-ros2-examples code:

cd ~/ros2_ws/src/zed-ros2-examples
git pull --recurse-submodules
cd ~/ros2_ws/
colcon build

Hi @Myzhar
Unfortunately, the error still occurs.
I’ve also installed the latest zed sdk v4.1.4 and also removed all build/, install/ and log/ as well as completely re-cloned zed-ros2-examples. These have not helped either.

Please post the full build log

Here is the output for the last two commands in the following steps (creating a completely new ros2_ws and re-clonded both zed-ros2-wrapper and zed-ros2-examples):

mkdir -p ~/ros2_ws/src/
cd ~/ros2_ws/src/
git clone --recursive GitHub - stereolabs/zed-ros2-wrapper: ROS 2 wrapper for the ZED SDK
cd …
sudo apt update
rosdep update
rosdep install --from-paths src --ignore-src -r -y
colcon build
cd ~/ros2_ws/src/
git clone GitHub - stereolabs/zed-ros2-examples: A collection of examples and tutorials to illustrate how to better use the ZED cameras in the ROS2 framework
cd …/
sudo apt update
rosdep update
rosdep install --from-paths src --ignore-src -r -y ← ERROR
colcon build ← ERROR

Initial rosdep install error from 2nd-to-last command:

user@GTW-ONX2-ubuntu:~/ros2_ws$ rosdep install --from-paths src --ignore-src -r -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
zed_robot_integration: Cannot locate rosdep definition for [scout_description]
Continuing to install resolvable dependencies…
#All required rosdeps installed successfully

colcon build error from last command:

user@GTW-ONX2-ubuntu:~/ros2_ws$ colcon build
Starting >>> zed_interfaces
Starting >>> zed_topic_benchmark_interfaces
Starting >>> zed_tutorial_depth
Starting >>> zed_tutorial_pos_tracking
— stderr: zed_interfaces
listing git files failed - pretending there aren’t any

Finished <<< zed_interfaces [3.12s]
Starting >>> zed_components
Finished <<< zed_components [0.39s]
Starting >>> zed_wrapper
Finished <<< zed_wrapper [0.38s]
Starting >>> zed_tutorial_video
— stderr: zed_topic_benchmark_interfaces
CMake Warning (dev) at /opt/ros/humble/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:20 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run “cmake --help-policy CMP0148” for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
/opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
/opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:81 (rosidl_generate_interfaces)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /opt/ros/humble/share/python_cmake_module/cmake/Modules/FindPythonExtra.cmake:52 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run “cmake --help-policy CMP0148” for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
/opt/ros/humble/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:23 (find_package)
/opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
/opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:81 (rosidl_generate_interfaces)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /opt/ros/humble/share/python_cmake_module/cmake/Modules/FindPythonExtra.cmake:140 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run “cmake --help-policy CMP0148” for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
/opt/ros/humble/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:23 (find_package)
/opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
/opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:81 (rosidl_generate_interfaces)
This warning is for project developers. Use -Wno-dev to suppress it.

listing git files failed - pretending there aren’t any

Finished <<< zed_topic_benchmark_interfaces [14.1s]
Starting >>> zed_topic_benchmark_component
Finished <<< zed_tutorial_depth [35.2s]
Starting >>> rviz_plugin_zed_od
Finished <<< zed_tutorial_video [36.4s]
Starting >>> zed_aruco_localization
Finished <<< zed_topic_benchmark_component [27.6s]
Starting >>> zed_rgb_convert
Finished <<< zed_tutorial_pos_tracking [52.8s]
Starting >>> zed_topic_benchmark
Finished <<< zed_topic_benchmark [21.7s]
Starting >>> zed_depth_to_laserscan
Finished <<< zed_depth_to_laserscan [6.68s]
Starting >>> zed_display_rviz2
Finished <<< zed_display_rviz2 [3.03s]
Starting >>> zed_multi_camera
Finished <<< zed_multi_camera [3.84s]
Starting >>> zed_robot_integration
— stderr: zed_aruco_localization
CMake Warning (dev) at /usr/local/zed/zed-config.cmake:72 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed. Run “cmake
–help-policy CMP0146” for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

Call Stack (most recent call first):
CMakeLists.txt:83 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/zed/zed-config.cmake:77 (exec_program):
Policy CMP0153 is not set: The exec_program command should not be called.
Run “cmake --help-policy CMP0153” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Use execute_process() instead.
Call Stack (most recent call first):
CMakeLists.txt:83 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/zed/zed-config.cmake:78 (exec_program):
Policy CMP0153 is not set: The exec_program command should not be called.
Run “cmake --help-policy CMP0153” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Use execute_process() instead.
Call Stack (most recent call first):
CMakeLists.txt:83 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/zed/zed-config.cmake:94 (exec_program):
Policy CMP0153 is not set: The exec_program command should not be called.
Run “cmake --help-policy CMP0153” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Use execute_process() instead.
Call Stack (most recent call first):
CMakeLists.txt:83 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/zed/zed-config.cmake:122 (exec_program):
Policy CMP0153 is not set: The exec_program command should not be called.
Run “cmake --help-policy CMP0153” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Use execute_process() instead.
Call Stack (most recent call first):
CMakeLists.txt:83 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:84 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed. Run “cmake
–help-policy CMP0146” for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Error at cmake_install.cmake:69 (file):
file INSTALL cannot find
“/home/user/ros2_ws/src/zed-ros2-examples/examples/zed_aruco_localization/DIRECTORY”:
No such file or directory.


Failed <<< zed_aruco_localization [50.5s, exited with code 1]
Aborted <<< zed_robot_integration [2.84s]
Aborted <<< zed_rgb_convert [54.8s]
Aborted <<< rviz_plugin_zed_od [1min 2s]

Summary: 12 packages finished [1min 38s]
1 package failed: zed_aruco_localization
3 packages aborted: rviz_plugin_zed_od zed_rgb_convert zed_robot_integration
4 packages had stderr output: zed_aruco_localization zed_interfaces zed_rgb_convert zed_topic_benchmark_interfaces
1 package not processed

This error is something weird. Are you sure that you did not modify the CMakeLists.txt file?

Hi @Myzhar

I’m pretty sure I haven’t.
I’ve just followed the steps I last posted.
And I’ve tried them multiple times.

Hi @Myzhar
It doesn’t help a great deal, but:

I have noticed another documented case of this error here: Launchin 2 ZEDX Cams doesn't work · Issue #209 · stereolabs/zed-ros2-wrapper · GitHub.
But, it doesn’t appear they came up with a solution other than simply cherry-picking examples from the zed-ros2-examples package and avoiding zed_aruco_localization

What version of CMake are you using?
Please read this:
https://cmake.org/cmake/help/latest/policy/CMP0146.html

Hi @Myzhar

I’m using cmake v3.30.2
If I add cmake_policy(SET CMP0146 OLD) near the top of CMakeLists.tx within zed_aruco_localization, the policy warning for CMP0146 goes away, but the error persists.

Hi @jdcast
this is a version that we do not support yet because not automatically installed by using APT (v3.22.1).
I hope you can understand that we cannot test and provide fixes for all the available versions of CMake.

Hi @Myzhar

Which version do you recommend I roll back to? v3.22.1 or perhaps an earlier version than that?

$ cmake --version
cmake version 3.22.1

This version is working correctly for me.

Hi @Myzhar

I gave cmake v3.22.1 a shot. It looks like the cmake warnings have disappeared but the blocking error is still there for zed_aruco_localization:

user@orin5:~/ros2_ws$ rm -rf build/ install/ log/
user@orin5:~/ros2_ws$ colcon build
Starting >>> zed_components
Starting >>> zed_topic_benchmark_interfaces
Starting >>> rviz_plugin_zed_od
Starting >>> zed_tutorial_depth
— stderr: zed_topic_benchmark_interfaces
listing git files failed - pretending there aren’t any

Finished <<< zed_topic_benchmark_interfaces [15.9s]
Starting >>> zed_topic_benchmark_component
[Processing: rviz_plugin_zed_od, zed_components, zed_topic_benchmark_component, zed_tutorial_depth]
Finished <<< zed_tutorial_depth [46.9s]
Starting >>> zed_tutorial_pos_tracking
Finished <<< zed_topic_benchmark_component [33.2s]
Starting >>> zed_tutorial_video
Finished <<< rviz_plugin_zed_od [58.3s]
Starting >>> zed_topic_benchmark
Finished <<< zed_topic_benchmark [11.3s]
Finished <<< zed_tutorial_video [32.1s]
Finished <<< zed_tutorial_pos_tracking [39.4s]
[Processing: zed_components]
[Processing: zed_components]
[Processing: zed_components]
Finished <<< zed_components [3min 6s]
Starting >>> zed_wrapper
Starting >>> zed_aruco_localization
Starting >>> zed_rgb_convert
Finished <<< zed_wrapper [23.5s]
Starting >>> zed_depth_to_laserscan
Starting >>> zed_display_rviz2
Finished <<< zed_display_rviz2 [1.98s]
Starting >>> zed_multi_camera
Finished <<< zed_multi_camera [1.98s]
Starting >>> zed_robot_integration
Finished <<< zed_depth_to_laserscan [4.29s]
Starting >>> zed_ros2
Finished <<< zed_ros2 [1.15s]
Finished <<< zed_robot_integration [1.69s]
— stderr: zed_aruco_localization
CMake Error at cmake_install.cmake:69 (file):
file INSTALL cannot find
“/home/user/ros2_ws/src/zed-ros2-examples/examples/zed_aruco_localization/DIRECTORY”:
No such file or directory.


Failed <<< zed_aruco_localization [32.1s, exited with code 1]
Aborted <<< zed_rgb_convert [37.2s]

Summary: 14 packages finished [3min 43s]
1 package failed: zed_aruco_localization
1 package aborted: zed_rgb_convert
2 packages had stderr output: zed_aruco_localization zed_topic_benchmark_interfaces
user@orin5:~/ros2_ws$ which cmake
/usr/local/bin/cmake
user@orin5:~/ros2_ws$ cmake --version
cmake version 3.22.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Did you clean the CMake cache by deleting the build, install, and log subfolders of your ROS 2 workspace?

Hi @Myzhar

Yes, I removed those directories.
You’ll see that in the output above.

Hi @Myzhar

Yes, I removed those directories.

[Discourse post]

The problem seems to be caused by these lines of the CMakeLists.txt file:

Sincerely, I cannot understand why. Everything works correctly in all the test I made on different platforms with different OS versions.

Hi @Myzhar

Could you list a minimal set of steps for jetpack v6.0 (including the flashing steps) that worked for you to build zed-ros2-examples?

I performed the required steps because on the machine I used as testbench ROS 2 was not installed:

  1. installed ROS 2 from apt
  2. created the workspace:
mkdir -p ~/devel/ros2_ws/src
  1. cloned the Wrapper repository:
cd ~/devel/ros2_ws/src
git clone --recurse-submodules https://github.com/stereolabs/zed-ros2-wrapper.git
git clone --recurse-submodules https://github.com/stereolabs/zed-ros2-examples
  1. I updated the dependencies

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
rosdep update
cd ~/devel/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
  1. I built the packages of the workspace
cd ~/devel/ros2_ws
colcon build --symlink-install --cmake-args=-DCMAKE_BUILD_TYPE=Release

Nothing different from what is documented in the READMEs of the repositories