Skip to content

Docker mdtool / ROS Node #26

@mvancleaver

Description

@mvancleaver

Hello,

I'm trying to get mdtool/ROS drivers running in a docker container. When running mdtool on the Host i am able to ping all the drives. When mdtool runs in the docker container it cannot see the USB device. I've mapped the device path into the privileged container and can verify it maps onto /dev/ttyACM0

Are there hooks on the drivers installed on the Host OS that would block the resources from being utilized in a container?

Docker Compose

md80_candle:  
    image: empyreanlattice/md80_candle:humble
    build:
      context: ../../
      dockerfile: ./submodules/ishim/docker/Dockerfile.md80_candle
    network_mode: host
    volumes:
      - /dev:/dev
      - ../../config/params:/config
    privileged: true
    command: mdtool ping all

Dockerfile

FROM ros:humble

# Install Apt Packages
RUN apt-get update && apt-get install -y \
    git \
    nano \
    wget \
    locales \
    python3-dev \
    python3-pip \
    build-essential \
    setserial \ 
    && rm -rf /var/lib/apt/lists/*
RUN locale-gen en_US.UTF-8
SHELL ["/bin/bash", "-c"]

RUN python3 -m pip install -U numpy numpy-quaternion pyyaml Pillow==8.3.2 

RUN wget https://github.com/mabrobotics/mdtool/releases/download/v1.5.1/mdtool-arm64-1.5.1-Linux.deb
RUN apt install ./mdtool-arm64-1.5.1-Linux.deb
RUN usermod -a -G dialout root

# Install MAB MD80 ROS2 Packages
RUN git clone --recursive https://github.com/mabrobotics/candle_ros2.git /ros2_ws/src/candle_ros2

RUN source /ros_entrypoint.sh && apt update && rosdep install --from-paths /ros2_ws/src --ignore-src --rosdistro $ROS_DISTRO -y

RUN source /ros_entrypoint.sh && \
    cd /ros2_ws && \
    colcon build && \
    rm -r build log

# Update ros_entrypoint.sh
RUN /bin/sed -i \
  '/source "\/opt\/ros\/$ROS_DISTRO\/setup.bash"/a source "\/ros2_ws\/install\/local_setup.bash"' \
  /ros_entrypoint.sh

RUN source /ros_entrypoint.sh

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