diff --git a/Dockerfile b/Dockerfile index 5e420267..fe51ca3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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] @@ -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 diff --git a/cyclone_dds.xml b/cyclone_dds.xml new file mode 100644 index 00000000..cc049ffe --- /dev/null +++ b/cyclone_dds.xml @@ -0,0 +1,9 @@ + + + + + 10MB + + + diff --git a/dev.sh b/dev.sh index d863c276..814502c9 100755 --- a/dev.sh +++ b/dev.sh @@ -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 \ @@ -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 diff --git a/runtime.sh b/runtime.sh index 345163f7..9edefdf2 100755 --- a/runtime.sh +++ b/runtime.sh @@ -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