Skip to content

Commit

Permalink
Add Cyclone DDS ROS RMW (#2)
Browse files Browse the repository at this point in the history
* Add cyclone DDS as ROS RMW + configurate it to support high msg
throughput
* Avoid `dev.sh` override `latest` docker tag for convenience
* Enable colorised ROS log
* Synchronise host time with docker container
  • Loading branch information
hect95 authored May 21, 2024
1 parent 07afae6 commit 80b9404
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RUN apt-get update \
apt-get -y --quiet --no-install-recommends install \
ros-galactic-ros-base \
ros-dev-tools \
ros-galactic-rmw-cyclonedds-cpp \
&& rm -rf /var/lib/apt/lists/*

# Setup ROS1 environment variables [For AV server]
Expand All @@ -43,9 +44,17 @@ ENV ROS1_WS /opt/ros1_msgs_ws
# Setup ROS2 msgs workspace folder
ENV ROS2_WS /opt/ros2_msgs_ws

# Set cyclone DDS ROS RMW
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
COPY ./cyclone_dds.xml /opt/ros/
ENV CYCLONEDDS_URI=file:///opt/ros/cyclone_dds.xml

# Setup ROS1-2 bridge workspace
ENV BRIDGE_WS /opt/ros1_bridge_ws

# Enable ROS log colorised output
ENV RCUTILS_COLORIZED_OUTPUT=1

# -----------------------------------------------------------------------

FROM base AS runtime
Expand Down
9 changes: 9 additions & 0 deletions cyclone_dds.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config
https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
<Domain id="any">
<Internal>
<MinimumSocketReceiveBufferSize>10MB</MinimumSocketReceiveBufferSize>
</Internal>
</Domain>
</CycloneDDS>
5 changes: 3 additions & 2 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

# Build docker image up to dev stage
DOCKER_BUILDKIT=1 docker build \
-t av_ros1_bridge:latest \
-t av_ros1_bridge:latest-dev \
-f Dockerfile --target dev .

# Run docker image with local code volumes for development
docker run -it --rm --net host --privileged \
-v /dev/shm:/dev/shm \
-v /etc/localtime:/etc/localtime:ro \
-v ./ecal_to_ros/ros1:/opt/ros1_msgs_ws/src/ecal_to_ros \
-v ./ecal_to_ros/ros2:/opt/ros2_msgs_ws/src/ecal_to_ros \
-v ./bin:/opt/ros1_bridge_ws/src/ros1_bridge/bin \
Expand All @@ -22,4 +23,4 @@ docker run -it --rm --net host --privileged \
-v ./test:/opt/ros1_bridge_ws/src/ros1_bridge/test \
-v ./CMakeLists.txt:/opt/ros1_bridge_ws/src/ros1_bridge/CMakeLists.txt \
-v ./package.xml:/opt/ros1_bridge_ws/src/ros1_bridge/package.xml \
av_ros1_bridge:latest
av_ros1_bridge:latest-dev
1 change: 1 addition & 0 deletions runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ DOCKER_BUILDKIT=1 docker build \
# Run docker image without volumes
docker run -it --rm --net host --privileged \
-v /dev/shm:/dev/shm \
-v /etc/localtime:/etc/localtime:ro \
av_ros1_bridge:latest $CMD

0 comments on commit 80b9404

Please sign in to comment.