Skip to content

Commit

Permalink
Efc/ros1 (#161)
Browse files Browse the repository at this point in the history
* Basic testing on docker image for tf works

Signed-off-by: Aaron Chong <aaronchong@google.com>

* Renaming types and starting conversions

Signed-off-by: Aaron Chong <aaronchong@google.com>

* Renaming and verifying regression tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* minimal-zenoh-bridge-ros1 to build bridge from source

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Clone bridge recursively for rosrust

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* nav1 tf integration tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Fix nav1 robot testing namespace, lint

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Fix imports, lint, new cmake and action argument to split nav1 or nav2 integration tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Fix ros master race condition, basic conversion

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* TransformStamped ros1 type

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Build with updated images

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Reduce size of minimal zenoh bridge ros1 image, lint

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Setup for more testing scripts

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* move base handler

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* lint

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* free_fleet testing

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* move_base_handler integration testing

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Basic testing on the level of nav1 robot adapter

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Basic nav1 fleet adapter setup done

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* New image builds and new tests

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Refactor out the part of starting fleet adapters for future testing

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Turn off nightly on-push build

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Update documentation with nav1 simulation example

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* nav1 sim architecture

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Update CI branch, todos on readme

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

---------

Signed-off-by: Aaron Chong <aaronchong@google.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth authored Dec 31, 2024
1 parent 02cf5d3 commit 26ff2b8
Show file tree
Hide file tree
Showing 38 changed files with 2,231 additions and 137 deletions.
11 changes: 8 additions & 3 deletions .github/actions/build-and-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ inputs:
zenoh-version:
description: string, version of eclipse-zenoh to install from pip
required: true
integration-testing:
nav1-integration-testing:
description: string, supports ON or OFF only
required: false
default: "OFF"
nav2-integration-testing:
description: string, supports ON or OFF only
required: false
default: "OFF"
Expand All @@ -18,7 +22,7 @@ runs:
- name: install dependencies
run: |
sudo apt update && sudo apt install python3-pip -y
pip3 install eclipse-zenoh==${{ inputs.zenoh-version }} pycdr2 --break-system-packages
pip3 install eclipse-zenoh==${{ inputs.zenoh-version }} pycdr2 rosbags --break-system-packages
shell: bash

- uses: ros-tooling/setup-ros@v0.7
Expand All @@ -34,7 +38,8 @@ runs:
{
"build": {
"cmake-args": [
"-DINTEGRATION_TESTING=${{ inputs.integration-testing }}"
"-DNAV1_INTEGRATION_TESTING=${{ inputs.nav1-integration-testing }}",
"-DNAV2_INTEGRATION_TESTING=${{ inputs.nav2-integration-testing }}"
],
"mixin": ["coverage-pytest"]
},
Expand Down
31 changes: 31 additions & 0 deletions .github/docker/integration-tests/nav1-docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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
@@ -1,5 +1,3 @@
version: "3"

services:
minimal-nav2-bringup:
image: ghcr.io/open-rmf/free_fleet/minimal-nav2-bringup:jazzy-latest
Expand All @@ -11,8 +9,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
21 changes: 21 additions & 0 deletions .github/docker/minimal-nav1-bringup/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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

# Modify existing launch file to add initial pose
RUN cd /tb3 \
&& curl --output turtlebot3_navigation.launch "https://raw.githubusercontent.com/ROBOTIS-GIT/turtlebot3/refs/heads/noetic-devel/turtlebot3_navigation/launch/turtlebot3_navigation.launch" \
&& sed -z 's|amcl.launch"/>|amcl.launch"><arg name="initial_pose_x" value="-2.0"/><arg name="initial_pose_y" value="-0.5"/></include>|' turtlebot3_navigation.launch > turtlebot3_navigation_edited.launch

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

ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && roslaunch --wait /tb3/turtlebot3_navigation_edited.launch map_file:=/tb3/navigation2/nav2_bringup/maps/tb3_sandbox.yaml open_rviz:=false"]
6 changes: 3 additions & 3 deletions .github/docker/minimal-nav2-bringup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ARG ROS_DISTRO=jazzy
FROM docker.io/ros:$ROS_DISTRO-ros-base

RUN apt update && apt install -y curl ros-$ROS_DISTRO-nav2-bringup ros-$ROS_DISTRO-rmw-cyclonedds-cpp
RUN apt update && apt install -y curl ros-$ROS_DISTRO-nav2-bringup ros-$ROS_DISTRO-rmw-cyclonedds-cpp

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

ENV RMW_IMPLEMENTATION rmw_cyclonedds_cpp
ENV GAZEBO_MODEL_PATH "$GAZEBO_MODEL_PATH:/tb3/turtlebot3_simulations/turtlebot3_gazebo/models"
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
ENV GAZEBO_MODEL_PATH="$GAZEBO_MODEL_PATH:/tb3/turtlebot3_simulations/turtlebot3_gazebo/models"

RUN rm -rf \
/var/lib/apt/lists \
Expand Down
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"]
36 changes: 36 additions & 0 deletions .github/docker/minimal-zenoh-bridge-ros1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
### Build bridge

ARG ROS_DISTRO=noetic
FROM docker.io/ros:$ROS_DISTRO-ros-base
ARG ZENOH_BRIDGE_REPO=eclipse-zenoh/zenoh-plugin-ros1
ARG ZENOH_BRIDGE_TAG=main
ARG FREE_FLEET_BRANCH=main

RUN apt update && apt install -y build-essential curl git unzip wget

# Get Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

ENV PATH="/root/.cargo/bin:${PATH}"

RUN mkdir -p /zenoh-bridge && cd /zenoh-bridge \
&& git clone --recursive https://github.com/$ZENOH_BRIDGE_REPO -b $ZENOH_BRIDGE_TAG zenoh-plugin-ros1 \
&& cd /zenoh-bridge/zenoh-plugin-ros1 \
&& cargo build --package zenoh-bridge-ros1 --bin zenoh-bridge-ros1 --release

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

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

### Set up bare minimum zenoh-bridge-ros1 image

FROM docker.io/ros:$ROS_DISTRO-ros-base

COPY --from=0 /zenoh-bridge/turtlebot3_zenoh_bridge_ros1_client_config.json5 /zenoh-bridge/turtlebot3_zenoh_bridge_ros1_client_config.json5

COPY --from=0 /zenoh-bridge/zenoh-plugin-ros1/target/release/zenoh-bridge-ros1 /zenoh-bridge/zenoh-bridge-ros1

ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && /zenoh-bridge/zenoh-bridge-ros1 -c /zenoh-bridge/turtlebot3_zenoh_bridge_ros1_client_config.json5"]
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
ARG ROS_DISTRO=jazzy
FROM docker.io/ros:$ROS_DISTRO-ros-base
ARG ZENOH_VERSION=1.0.1
ARG ZENOH_VERSION=1.1.0
ARG FREE_FLEET_BRANCH=main

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

RUN mkdir -p /zenoh-bridge && cd /zenoh-bridge \
&& wget -O zenoh-plugin-ros2dds.zip https://github.com/eclipse-zenoh/zenoh-plugin-ros2dds/releases/download/$ZENOH_VERSION/zenoh-plugin-ros2dds-$ZENOH_VERSION-x86_64-unknown-linux-gnu-standalone.zip \
&& unzip zenoh-plugin-ros2dds.zip \
&& 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_zenoh_bridge_ros2dds_client_config.json5

ENV RMW_IMPLEMENTATION rmw_cyclonedds_cpp
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"]
ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && /zenoh-bridge/zenoh-bridge-ros2dds -c /zenoh-bridge/turtlebot3_1_zenoh_bridge_ros2dds_client_config.json5"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: integration-tests
name: nav1-integration-tests

on: push

Expand All @@ -22,18 +22,18 @@ 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/nav1-docker-compose.yaml" up -d --build

- name: build-and-test
uses: ./.github/actions/build-and-test
with:
ros-distribution: ${{ matrix.ros_distribution }}
zenoh-version: 1.0.1
integration-testing: ON
zenoh-version: 1.1.0
nav1-integration-testing: ON

- 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/nav1-docker-compose.yaml" down

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/nav2-integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: nav2-integration-tests

on: push

jobs:
integration-tests:
timeout-minutes: 10
runs-on: ubuntu-latest
container:
image: osrf/ros:${{ matrix.ros_distribution }}-desktop-noble
strategy:
matrix:
ros_distribution:
- jazzy

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install docker-compose
run: |
sudo apt update && sudo apt install docker-compose -y
- name: Start test fixture containers
run: docker-compose -f ".github/docker/integration-tests/nav2-docker-compose.yaml" up -d --build

- name: build-and-test
uses: ./.github/actions/build-and-test
with:
ros-distribution: ${{ matrix.ros_distribution }}
zenoh-version: 1.1.0
nav2-integration-testing: ON

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

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ros_ws/coveragepy/.coverage
flags: tests
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Loading

0 comments on commit 26ff2b8

Please sign in to comment.