Skip to content

firmware build fails for ROS 2 Humble: build_firmware.sh: line 80: cd: /ws/firmware/mcu_ws: No such file or directory #793

@dbenders1

Description

@dbenders1

Issue template

  • Hardware description: PC, Docker: ros:humble-ros-core
  • RTOS: host
  • Installation type: micro_ros_setup
  • Version or commit hash: humble

Steps to reproduce the issue

Run docker build -f Dockerfile -t issue . from a directory containing the following Dockerfile:

FROM ros:humble-ros-core

ENV ROS_DISTRO=humble
ENV ROS_ROOT=/opt/ros/${ROS_DISTRO}
ENV WS=/ws

SHELL [ "/bin/bash", "-c" ]

RUN apt update \
  && apt install -y --no-install-recommends \
  build-essential \
  git \
  python3-colcon-common-extensions \
  python3-rosdep \
  && apt clean \
  && rm -rf /var/lib/apt/lists/*

RUN rosdep init \
  && rosdep update

RUN source ${ROS_ROOT}/setup.bash \
  && mkdir -p ${WS}/src \
  && cd ${WS} \
  && git clone -b ${ROS_DISTRO} https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup \
  && apt update \
  && rosdep update \
  && rosdep install --from-paths src --ignore-src -y \
  && apt clean \
  && rm -rf /var/lib/apt/lists/*

RUN source ${ROS_ROOT}/setup.bash \
  && cd ${WS} \
  && colcon build

RUN apt update \
  && cd ${WS} \
  && source install/setup.bash \
  && ros2 run micro_ros_setup create_firmware_ws.sh host \
  && ros2 run micro_ros_setup build_firmware.sh \
  && apt clean \
  && rm -rf /var/lib/apt/lists/*

CMD ["bash"]

Expected behavior

Successful image creation.

Actual behavior

Docker build fails with:

/ws/install/micro_ros_setup/lib/micro_ros_setup/build_firmware.sh: line 80: cd: /ws/firmware/mcu_ws: No such file or directory

Additional information

The command cd $FW_TARGETDIR/mcu_ws in build_firmware.sh assumes that mcu_ws exists, but it doesn't. Given the content in create_firmware_ws.sh, mcu_ws is only created if rtos != host. In this case, rtos = host, so mcu_ws is not created. This explains the error. I will create a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions