micro-ROS / docker

Docker-related material to setup, configure and develop with micro-ROS hardware.

Home Page:https://micro-ros.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some question about micro-ros-agent dockerfiles

elgarbe opened this issue · comments

Hi, I'm using micros-ros on my custom stm32f722 board connected through USB to a Jetson Nano, with ubuntu 22.04 (custom image for the nano) and ros2 iron.
After an udev rule I can run:
docker run -it --rm --net=host --device=/dev/ttyChori microros/micro-ros-agent:humble serial --dev /dev/ttyChori
and list the topics publish on the host.
The Nano is connected by eth to a router and on the same LAN I have an ubuntu 22.04 with ros iron running on WSL over win11.
I can list all micro-ros topics on wsl too.
So everithing is working ok.
Now I wanted to replicate the same with a f9p GPS using Kumar github ros2 driver.I build my dockerfile using it and I can't list topics on the host computer but I can list them on the WSL OS.
Just to understand why one is working and the other not I made a dockerfile, similar to the ublox gps one, trying to get micro-ros-agent working like the provided image. I can't make it work, I can list topics on the WSL OS but not on the host computer (Jetson Nano)

FROM ros:iron

RUN mkdir -p /home/microros_ws
WORKDIR /home/microros_ws

RUN mkdir src \
    && git -C src clone -b $ROS_DISTRO https://github.com/micro-ROS/micro-ROS-Agent.git \
    && git -C src clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_msgs.git  \
    && . /opt/ros/$ROS_DISTRO/setup.sh \
    &&  apt update \
    &&  apt install -y python3-pip \
    libspdlog-dev \
    libfmt-dev \
    ros-$ROS_DISTRO-rmw-fastrtps-cpp \
    &&  apt autoremove -y \
    &&  sudo rosdep fix-permissions \
    &&  rosdep update \
    &&  rosdep install --from-paths src --ignore-src -y \
    &&  colcon build --cmake-args -DUAGENT_BUILD_EXECUTABLE=OFF -DUAGENT_P2P_PROFILE=OFF -DUAGENT_USE_SYSTEM_LOGGER=ON --no-warn-unused-cli \
    &&  rm -rf log/ build/ src/* \
    &&  rm -rf /var/lib/apt/lists/*

ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp
# ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

COPY ros_entrypoint.sh /

ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
version: '3.4'
services:
  robot:
    network_mode: "host"
    # privileged: true
    build:
      context: .
      dockerfile: Dockerfile
    devices:
      - /dev/ttyACM0:/dev/ttyACM0
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    command: ros2 run micro_ros_agent micro_ros_agent serial -v --dev /dev/ttyACM0

So I'm wondering which part of your micro-ros agent dockerfile is the one that I'm not taking into account.

I know that it's not a micro-ros related question, but after a week of reading documentation about docker and ros I can't found an answer.

Thank!

Ok, I manage to isolate the line that makes it works and it's the one related to https://github.com/micro-ROS/docker/blob/iron/micro-ROS-Agent/disable_fastdds_shm.xml
Adding that file and setting ENV makes it work.