ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Problem with Turtlebot3 in Dockerfile: CMake Error at CMakeLists.txt

asked 2022-06-23 04:05:35 -0500

Zeckurbo gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-27 06:40:09 -0500

Zeckurbo gravatar image

As I found the solution here and here, the fix was to directly source:

RUN source /opt/ros/foxy/setup.bash && colcon build --symlink-install

I dont know why sourcing ~/.bashrc did not work, but now it seems to build in the docker creation just fine.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-06-23 03:54:59 -0500

Seen: 562 times

Last updated: Jun 27 '22