Skip to content

Commit

Permalink
Basic testing on docker image for tf works
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Dec 20, 2024
1 parent 02cf5d3 commit aa75526
Show file tree
Hide file tree
Showing 12 changed files with 375 additions and 11 deletions.
33 changes: 33 additions & 0 deletions .github/docker/integration-tests/docker-compose-nav1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "3"

services:
minimal-ros1-sim:
image: ghcr.io/open-rmf/free_fleet/minimal-ros1-sim:noetic-latest
stop_signal: SIGINT
network_mode: host
privileged: true
stdin_open: true
tty: true

minimal-nav1-bringup:
image: ghcr.io/open-rmf/free_fleet/minimal-nav1-bringup:noetic-latest
stop_signal: SIGINT
network_mode: host
privileged: true
stdin_open: true
tty: true

minimal-zenoh-bridge-ros1:
image: ghcr.io/open-rmf/free_fleet/minimal-zenoh-bridge-ros1:noetic-latest
network_mode: host
stdin_open: true
tty: true

minimal-zenoh-router:
image: eclipse/zenoh
restart: unless-stopped
network_mode: host
stdin_open: true
tty: true
environment:
- RUST_LOG=debug
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ services:
environment:
- ROS_DOMAIN_ID=42

minimal-zenoh-bridge:
image: ghcr.io/open-rmf/free_fleet/minimal-zenoh-bridge:jazzy-latest
minimal-zenoh-bridge-ros2dds:
image: ghcr.io/open-rmf/free_fleet/minimal-zenoh-bridge-ros2dds:jazzy-latest
network_mode: host
stdin_open: true
tty: true
Expand Down
16 changes: 16 additions & 0 deletions .github/docker/minimal-nav1-bringup/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ARG ROS_DISTRO=noetic
FROM docker.io/ros:$ROS_DISTRO-ros-base

RUN apt update && apt install -y curl ros-$ROS_DISTRO-turtlebot3-navigation ros-$ROS_DISTRO-dwa-local-planner

RUN mkdir -p /tb3 && cd /tb3 \
&& curl -sL https://github.com/ros-navigation/navigation2/archive/refs/heads/master.tar.gz -o navigation2.tar.gz \
&& mkdir -p /tb3/navigation2 && tar zxf navigation2.tar.gz -C /tb3/navigation2 --strip-components=1 && rm navigation2.tar.gz

ENV TURTLEBOT3_MODEL burger

RUN rm -rf \
/var/lib/apt/lists \
/dist

ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=/tb3/navigation2/nav2_bringup/maps/tb3_sandbox.yaml open_rviz:=false initial_pose_x:=-2.0 initial_pose_y:=-0.5 initial_pose_a:=0.0"]
12 changes: 12 additions & 0 deletions .github/docker/minimal-ros1-sim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG ROS_DISTRO=noetic
FROM docker.io/ros:$ROS_DISTRO-ros-base

RUN apt update && apt install -y ros-$ROS_DISTRO-turtlebot3-gazebo ros-$ROS_DISTRO-gazebo-ros-pkgs

ENV TURTLEBOT3_MODEL burger

RUN rm -rf \
/var/lib/apt/lists \
/dist

ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && roslaunch turtlebot3_gazebo turtlebot3_world.launch gui:=false"]
22 changes: 22 additions & 0 deletions .github/docker/minimal-zenoh-bridge-ros1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG ROS_DISTRO=noetic
FROM docker.io/ros:$ROS_DISTRO-ros-base
ARG ZENOH_VERSION=1.0.0-beta.2
ARG FREE_FLEET_BRANCH=main

RUN apt update && apt install -y wget unzip ros-jazzy-rmw-cyclonedds-cpp

RUN mkdir -p /zenoh-bridge && cd /zenoh-bridge \
&& wget -O zenoh-plugin-ros1.zip https://github.com/eclipse-zenoh/zenoh-plugin-ros1/releases/download/$ZENOH_VERSION/zenoh-plugin-ros1-$ZENOH_VERSION-x86_64-unknown-linux-gnu-standalone.zip \
&& unzip zenoh-plugin-ros1.zip \
&& rm zenoh-plugin-ros1.zip

RUN cd /zenoh-bridge \
&& wget -O turtlebot3_1_client_zenoh_config.json5 https://raw.githubusercontent.com/open-rmf/free_fleet/refs/heads/$FREE_FLEET_BRANCH/free_fleet_examples/config/zenoh/turtlebot3_1_client_zenoh_config.json5

ENV RMW_IMPLEMENTATION rmw_cyclonedds_cpp

RUN rm -rf \
/var/lib/apt/lists \
/dist

ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && /zenoh-bridge/zenoh-bridge-ros2dds -c /zenoh-bridge/turtlebot3_1_client_zenoh_config.json5"]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN mkdir -p /zenoh-bridge && cd /zenoh-bridge \
&& rm zenoh-plugin-ros2dds.zip

RUN cd /zenoh-bridge \
&& wget -O turtlebot3_1_client_zenoh_config.json5 https://raw.githubusercontent.com/open-rmf/free_fleet/refs/heads/$FREE_FLEET_BRANCH/free_fleet_examples/config/zenoh/turtlebot3_1_client_zenoh_config.json5
&& wget -O turtlebot3_1_zenoh_bridge_ros2dds_client_config.json5 https://raw.githubusercontent.com/open-rmf/free_fleet/refs/heads/$FREE_FLEET_BRANCH/free_fleet_examples/config/zenoh/turtlebot3_1_client_zenoh_config.json5

ENV RMW_IMPLEMENTATION rmw_cyclonedds_cpp

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
sudo apt update && sudo apt install docker-compose -y
- name: Start test fixture containers
run: docker-compose -f ".github/docker/integration-tests/docker-compose.yaml" up -d --build
run: docker-compose -f ".github/docker/integration-tests/docker-compose-nav2.yaml" up -d --build

- name: build-and-test
uses: ./.github/actions/build-and-test
Expand All @@ -33,7 +33,7 @@ jobs:

- name: Stop test fixture containers
if: always()
run: docker-compose -f ".github/docker/integration-tests/docker-compose.yaml" down
run: docker-compose -f ".github/docker/integration-tests/docker-compose-nav2.yaml" down

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
39 changes: 34 additions & 5 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,45 @@ jobs:
tags: ghcr.io/${{ github.repository }}/minimal-nav2-bringup:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-nav2-bringup

- name: Build and push minimal-zenoh-bridge
- name: Build and push minimal-zenoh-bridge-ros2dds
uses: docker/build-push-action@v5
with:
push: true
build-args: |
ROS_DISTRO=${{ matrix.ros_distribution }}
ZENOH_VERSION=1.0.1
FREE_FLEET_BRANCH=easy-full-control
tags: ghcr.io/${{ github.repository }}/minimal-zenoh-bridge:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-zenoh-bridge
tags: ghcr.io/${{ github.repository }}/minimal-zenoh-bridge-ros2dds:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-zenoh-bridge-ros2dds

- name: Build and push minimal-ros1-sim
uses: docker/build-push-action@v5
with:
push: true
build-args: |
ROS_DISTRO=noetic
tags: ghcr.io/${{ github.repository }}/minimal-ros1-sim:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-ros1-sim

- name: Build and push minimal-nav1-bringup
uses: docker/build-push-action@v5
with:
push: true
build-args: |
ROS_DISTRO=noetic
tags: ghcr.io/${{ github.repository }}/minimal-nav1-bringup:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-nav1-bringup

- name: Build and push minimal-zenoh-bridge-ros1
uses: docker/build-push-action@v5
with:
push: true
build-args: |
ROS_DISTRO=noetic
ZENOH_VERSION=1.0.0-beta.2
FREE_FLEET_BRANCH=easy-full-control
tags: ghcr.io/${{ github.repository }}/minimal-zenoh-bridge-ros1:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-zenoh-bridge-ros1

integration-tests:
needs: build-minimal-docker-images
Expand All @@ -65,7 +94,7 @@ jobs:
sudo apt update && sudo apt install docker-compose -y
- name: Start test fixture containers
run: docker-compose -f ".github/docker/integration-tests/docker-compose.yaml" up -d --build
run: docker-compose -f ".github/docker/integration-tests/docker-compose-nav2.yaml" up -d --build

- name: build-and-test
uses: ./.github/actions/build-and-test
Expand All @@ -76,4 +105,4 @@ jobs:

- name: Stop test fixture containers
if: always()
run: docker-compose -f ".github/docker/integration-tests/docker-compose.yaml" down
run: docker-compose -f ".github/docker/integration-tests/docker-compose-nav2.yaml" down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ source /opt/ros/jazzy/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

cd PATH_TO_EXTRACTED_ZENOH_BRIDGE
./zenoh-bridge-ros2dds -c ~/ff_ws/src/free_fleet/free_fleet_examples/config/zenoh/turtlebot3_1_zenoh_config.json5
./zenoh-bridge-ros2dds -c ~/ff_ws/src/free_fleet/free_fleet_examples/config/zenoh/turtlebot3_1_zenoh_bridge_ros2dds_client_config.json5
```

Listen to transforms over `zenoh`,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
////
//// This file presents the default configuration used by `zenoh-plugin-ros1` plugin.
//// The "ros1" JSON5 object below can be used as such in the "plugins" part of a config file for the zenoh router (zenohd).
////
{
plugins: {
////
//// ROS1 bridge related configuration
//// All settings are optional and are unset by default - uncomment the ones you want to set
////
ros1: {
////
//// ros_master_uri: A URI of the ROS1 Master to connect to, the defailt is http://localhost:11311/
////
// ros_master_uri: "http://localhost:11311/",

////
//// ros_hostname: A hostname to send to ROS1 Master, the default is system's hostname
////
// ros_hostname: "hostname",

////
//// ros_name: A bridge node's name for ROS1, the default is "ros1_to_zenoh_bridge"
////
// ros_name: "ros1_to_zenoh_bridge",

////
//// with_rosmaster: An option wether the bridge should run it's own rosmaster process, the default is "false"
////
// with_rosmaster: "false",

////
//// subscriber_bridging_mode: Global subscriber's topic bridging mode. Accepted values:
//// - "auto"(default) - bridge topics once they are declared locally or discovered remotely
//// - "lazy_auto" - bridge topics once they are both declared locally and discovered remotely
//// - "disabled" - never bridge topics. This setting will also suppress the topic discovery."#
subscriber_bridging_mode: "disabled",

////
//// publisher_bridging_mode: Global publisher's topic bridging mode. Accepted values:
//// - "auto"(default) - bridge topics once they are declared locally or discovered remotely
//// - "lazy_auto" - bridge topics once they are both declared locally and discovered remotely
//// - "disabled" - never bridge topics. This setting will also suppress the topic discovery."#
publisher_bridging_mode: "disabled",

////
//// service_bridging_mode: Global service's topic bridging mode. Accepted values:
//// - "auto"(default) - bridge topics once they are declared locally or discovered remotely
//// - "lazy_auto" - bridge topics once they are both declared locally and discovered remotely
//// - "disabled" - never bridge topics. This setting will also suppress the topic discovery."#
service_bridging_mode: "disabled",

////
//// client_bridging_mode: Mode of client's topic bridging. Accepted values:
//// - "auto" - bridge topics once they are discovered remotely
//// - "disabled"(default) - never bridge topics. This setting will also suppress the topic discovery.
//// NOTE: there are some pecularities on how ROS1 handles clients:
//// - ROS1 doesn't provide any client discovery mechanism
//// - ROS1 doesn't allow multiple services on the same topic
//// Due to this, client's bridging works differently compared to pub\sub bridging:
//// - lazy bridging mode is not available as there is no way to discover local ROS1 clients
//// - client bridging is disabled by default, as it may brake the local ROS1 system if it intends to have client and service interacting on the same topic
//// In order to use client bridging, you have two options:
//// - globally select auto bridging mode (with caution!) with this option
//// - bridge specific topics using 'client_topic_custom_bridging_mode' option (with a little bit less caution!)"#
client_bridging_mode: "disabled",

////
//// subscriber_topic_custom_bridging_mode: A JSON Map describing custom bridging modes for particular topics.
//// Custom bridging mode overrides the global one.
//// Format: {"topic1":"mode", "topic2":"mode"}
//// Example: {"/my/topic1":"lazy_auto","/my/topic2":"auto"}
//// where
//// - topic: ROS1 topic name
//// - mode (auto/lazy_auto/disabled) as described above
//// The default is empty
//// Zenoh -> ROS 1
// subscriber_topic_custom_bridging_mode: {
// "/tf": "auto"
// },

////
//// publisher_topic_custom_bridging_mode: A JSON Map describing custom bridging modes for particular topics.
//// Custom bridging mode overrides the global one.
//// Format: {"topic1":"mode", "topic2":"mode"}
//// Example: {"/my/topic1":"lazy_auto","/my/topic2":"auto"}
//// where
//// - topic: ROS1 topic name
//// - mode (auto/lazy_auto/disabled) as described above
//// The default is empty
//// ROS 1 -> Zenoh
publisher_topic_custom_bridging_mode: {
"/tf": "auto"
},

////
//// service_topic_custom_bridging_mode: A JSON Map describing custom bridging modes for particular topics.
//// Custom bridging mode overrides the global one.
//// Format: {"topic1":"mode", "topic2":"mode"}
//// Example: {"/my/topic1":"lazy_auto","/my/topic2":"auto"}
//// where
//// - topic: ROS1 topic name
//// - mode (auto/lazy_auto/disabled) as described above
//// The default is empty
// service_topic_custom_bridging_mode: ""

////
//// client_topic_custom_bridging_mode: A JSON Map describing custom bridging modes for particular topics.
//// Custom bridging mode overrides the global one.
//// Format: {"topic1":"mode", "topic2":"mode"}
//// Example: {"/my/topic1":"auto","/my/topic2":"auto"}
//// where
//// - topic: ROS1 topic name
//// - mode (auto/disabled) as described above
//// The default is empty
// client_topic_custom_bridging_mode: ""

////
//// ros_master_polling_interval: An interval how to poll the ROS1 master for status
//// Bridge polls ROS1 master to get information on local topics, as this is the only way to keep
//// this info updated. This is the interval of this polling. The default is "100ms"
////
//// Takes a string such as 100ms, 2s, 5m
//// The string format is [0-9]+(ns|us|ms|[smhdwy])
////
// ros_master_polling_interval: "100ms",

////
//// This plugin uses Tokio (https://tokio.rs/) for asynchronous programming.
//// When running as a plugin within a Zenoh router, the plugin creates its own Runtime managing 2 pools of threads:
//// - worker threads for non-blocking tasks. Those threads are spawn at Runtime creation.
//// - blocking threads for blocking tasks (e.g. I/O). Those threads are spawn when needed.
//// For more details see https://github.com/tokio-rs/tokio/discussions/3858#discussioncomment-869878
//// When running as a standalone bridge the Zenoh Session's Runtime is used and can be configured via the
//// `ZENOH_RUNTIME` environment variable. See https://docs.rs/zenoh-runtime/latest/zenoh_runtime/enum.ZRuntime.html
////

//// work_thread_num: The number of worker thread in the asynchronous runtime will use. (default: 2)
//// Only for a plugin, no effect on a bridge.
// work_thread_num: 2,

//// max_block_thread_num: The number of blocking thread in the asynchronous runtime will use. (default: 50)
//// Only for a plugin, no effect on a bridge.
// max_block_thread_num: 50,
},

////
//// REST API configuration (active only if this part is defined)
////
// rest: {
// ////
// //// The HTTP port number (for all network interfaces).
// //// You can bind on a specific interface setting a "<local_ip>:<port>" string.
// ////
// http_port: 8000,
// },
},

////
//// zenoh related configuration (see zenoh documentation for more details)
////

////
//// id: The identifier (as hex-string) that zenoh-bridge-ros1 must use. If not set, a random UUIDv4 will be used.
//// WARNING: this id must be unique in your zenoh network.
// id: "A00001",

////
//// mode: The bridge's mode (peer or client)
////
//mode: "client",

////
//// Which endpoints to connect to. E.g. tcp/localhost:7447.
//// By configuring the endpoints, it is possible to tell zenoh which router/peer to connect to at startup.
////
connect: {
endpoints: [
// "<proto>/<ip>:<port>"
]
},

////
//// Which endpoints to listen on. E.g. tcp/localhost:7447.
//// By configuring the endpoints, it is possible to tell zenoh which are the endpoints that other routers,
//// peers, or client can use to establish a zenoh session.
////
listen: {
endpoints: [
// "<proto>/<ip>:<port>"
]
},
}
Loading

0 comments on commit aa75526

Please sign in to comment.