-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Which demo
sensor_diagnostics
Steps to reproduce
- Clone the repository
- Run
cd demos/sensor_diagnostics && bash run-demo.sh - Docker build fails during
colcon buildat theros2_medkit_serializationpackage
Expected behavior
The Docker image builds successfully and the demo launches.
Actual behavior
The build fails because ros2_medkit_serialization (and potentially other packages) cannot find the ROS2MedkitCompat CMake module. The error occurs during the CMake configure step:
CMake Error at CMakeLists.txt (include):
include could not find requested file:
ROS2MedkitCompat
Root cause
The Dockerfile clones ros2_medkit, extracts individual packages from ros2_medkit/src/ into ${COLCON_WS}/src/, and then deletes the entire clone with rm -rf ros2_medkit. However, ros2_medkit/cmake/ROS2MedkitCompat.cmake — a shared CMake module referenced by multiple packages via ../../cmake relative paths — is not preserved before deletion.
Proposed fix
Add a line to preserve the CMake module before removing the clone:
RUN git clone --depth 1 https://github.com/selfpatch/ros2_medkit.git && \
mv ros2_medkit/src/ros2_medkit_gateway . && \
mv ros2_medkit/src/ros2_medkit_serialization . && \
mv ros2_medkit/src/ros2_medkit_msgs . && \
mv ros2_medkit/src/ros2_medkit_fault_manager . && \
mv ros2_medkit/src/ros2_medkit_fault_reporter . && \
mv ros2_medkit/src/ros2_medkit_diagnostic_bridge . && \
+ mkdir -p ${COLCON_WS}/cmake && mv ros2_medkit/cmake/ROS2MedkitCompat.cmake ${COLCON_WS}/cmake/ && \
rm -rf ros2_medkitThis places ROS2MedkitCompat.cmake at ${COLCON_WS}/cmake/, which is exactly where the relative ../../cmake paths from packages in ${COLCON_WS}/src/<pkg>/ resolve to. The fix has been tested locally and the demo builds and runs correctly.
Environment
- ROS 2 distro: Jazzy
- OS: Ubuntu 24.04 on WSL 2
- ros2_medkit version: latest (HEAD of main)