Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ros:humble

RUN mkdir -p uros_ws
WORKDIR uros_ws
WORKDIR /uros_ws

RUN git clone --depth 1 -b humble https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup \
&& . /opt/ros/$ROS_DISTRO/setup.sh \
&& apt update \
Expand Down
16 changes: 14 additions & 2 deletions micro-ROS-Agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM microros/base:humble
FROM microros/base:humble AS micro-ros-agent-builder

WORKDIR /uros_ws
RUN . /opt/ros/$ROS_DISTRO/setup.sh \
Expand All @@ -8,10 +8,22 @@ RUN . /opt/ros/$ROS_DISTRO/setup.sh \
&& ros2 run micro_ros_setup build_agent.sh \
&& rm -rf log/ build/ src/

FROM ros:humble-ros-core

COPY --from=micro-ros-agent-builder /uros_ws /uros_ws

WORKDIR /uros_ws

# Disable shared memory
COPY disable_fastdds_shm.xml disable_fastdds_shm_localhost_only.xml /tmp/

ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp
ENV MICROROS_DISABLE_SHM=1

RUN echo ". /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc
RUN echo ". /uros_ws/install/setup.bash" >> ~/.bashrc

# setup entrypoint
COPY ./micro-ros_entrypoint.sh /
ENTRYPOINT ["/bin/sh", "/micro-ros_entrypoint.sh"]
CMD ["--help"]
CMD ["--help"]
10 changes: 6 additions & 4 deletions micro-ROS-Agent/micro-ros_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
. "/opt/ros/$ROS_DISTRO/setup.sh"
. "/uros_ws/install/local_setup.sh"

if [ "$ROS_LOCALHOST_ONLY" = "1" ] ; then
export FASTRTPS_DEFAULT_PROFILES_FILE=/tmp/disable_fastdds_shm_localhost_only.xml
else
export FASTRTPS_DEFAULT_PROFILES_FILE=/tmp/disable_fastdds_shm.xml
if [ "$MICROROS_DISABLE_SHM" = "1" ] ; then
if [ "$ROS_LOCALHOST_ONLY" = "1" ] ; then
export FASTRTPS_DEFAULT_PROFILES_FILE=/tmp/disable_fastdds_shm_localhost_only.xml
else
export FASTRTPS_DEFAULT_PROFILES_FILE=/tmp/disable_fastdds_shm.xml
fi
fi

exec ros2 run micro_ros_agent micro_ros_agent "$@"