Problem with Turtlebot3 in Dockerfile: CMake Error at CMakeLists.txt
Hello,
I have a problem with setting up a Turtlebot3 in a docker container. I start with a installed ROS2 foxy on Ubuntu:focal
My ~/.bashrc inside the container looks like this:
source /opt/ros/foxy/setup.bash
export ROS_DOMAIN_ID=30 #TURTLEBOT3
export GAZEBO_MODEL_PATH=:~/turtlebot3_ws/src/turtlebot3_simulations/turtlebot3_gazebo/models
What I do in the Dockerfile is:
WORKDIR /root/turtlebot3_ws/src
RUN git clone -b foxy-devel https://github.com/ROBOTIS-GIT/DynamixelSDK.git
RUN git clone -b foxy-devel https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
RUN git clone -b foxy-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
RUN git clone -b foxy-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
WORKDIR /root/turtlebot3_ws
#
RUN cat ~/.bashrc
RUN source ~/.bashrc && colcon build --symlink-install
The last line throws the error:
--- stderr: dynamixel_sdk
CMake Error at CMakeLists.txt:18 (find_package):
By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"ament_cmake", but CMake did not find one.
Could not find a package configuration file provided by "ament_cmake" with
any of the following names:
ament_cmakeConfig.cmake
ament_cmake-config.cmake
Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
"ament_cmake_DIR" to a directory containing one of the above files. If
"ament_cmake" provides a separate development package or SDK, be sure it
has been installed.
---
Failed <<< dynamixel_sdk [1.02s, exited with code 1]
But if I run the container (created without the last line) and run colcon build --symlink-install by hand, it installs just fine.
Any ideas what I could do wrong here? As seen, ROS foxy should be sourced right in the .bashrc
Thank you in advance