ROS2: issues building the composition demo found in ros2/demos
I am using ROS2 version dashing on Ubuntu 18.04.3 LTS.
I am failing to build the ros2 demos found at:
https://github.com/ros2/demos/tree/ma...
Steps to reproduce:
$ mkdir -p ros2_demos_ws/src $ cd ros2_demos_ws/src $ git clone https://github.com/ros2/demos
I place COLCON_IGNORE
in all the folders that I want colcon to ignore (basically all the demos except the "composition" demo).
$ cd ros2_demos_ws $ colcon build --symlink-install
Which results in the following output.
[0.192s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path
'home/ros2_example_ws/install/examples_rclcpp_minimal_action_client' in the environment variable
CMAKE_PREFIX_PATH doesn't exist
--- stderr: composition
CMake Error at CMakeLists.txt:133 (find_package):
By not providing "Findlaunch_testing_ament_cmake.cmake" in
CMAKE_MODULE_PATH this project has asked CMake to find a package
configuration file provided by "launch_testing_ament_cmake", but CMake did
not find one.
Could not find a package configuration file provided by
"launch_testing_ament_cmake" with any of the following names:
launch_testing_ament_cmakeConfig.cmake
launch_testing_ament_cmake-config.cmake
Add the installation prefix of "launch_testing_ament_cmake" to
CMAKE_PREFIX_PATH or set "launch_testing_ament_cmake_DIR" to a directory
containing one of the above files. If "launch_testing_ament_cmake"
provides a separate development package or SDK, be sure it has been
installed.
How did you install ros2 dashing? The package it is looking for is within the default installation of dashing seen here. Did you source the ros2 installation before running
colcon build --symlink-install
?EDIT:
Also would you be so kind as to format above so it is more code like for future people who may have this issue?
I installed following the instructions Installing ROS2 via Debian Packages
Yes, after installation I set up the environment by running
source /opt/ros/dashing/setup.bash
.Try the following:
Once the packages are installed, source your ros2 installation, and then try and build again.
The build finished successfully and the composition demo worked. Thanks for the help. Wondering why these were left out?
Running
sudo apt install ros-dashing-launch*
resulted in installing the following packages that weren't installed originally.Once installed, I sourced the ros2 installation:
Then ran colcon build:
Which resulted in a warning, but build finished successfully.
Then to run the demo:
Don't worry about the warning. I don't think it will apply to what you needed. The demo started properly, correct? If so, I'll make a formal answer and you can accept it for future users who may have this problem :-)
Yes, thank you.