Skip to content

Commit

Permalink
Added nav1 and nav2 to names to make it clearer
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Jan 2, 2025
1 parent 9b37a80 commit dabfcab
Show file tree
Hide file tree
Showing 23 changed files with 75 additions and 73 deletions.
6 changes: 3 additions & 3 deletions .github/docker/minimal-zenoh-bridge-ros1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN mkdir -p /zenoh-bridge && cd /zenoh-bridge \
&& 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
&& wget -O nav1_tb3_zenoh_bridge_ros1_client_config.json5 https://raw.githubusercontent.com/open-rmf/free_fleet/refs/heads/$FREE_FLEET_BRANCH/free_fleet_examples/config/zenoh/nav1_tb3_zenoh_bridge_ros1_client_config.json5

RUN rm -rf \
/var/lib/apt/lists \
Expand All @@ -29,8 +29,8 @@ RUN rm -rf \

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/nav1_tb3_zenoh_bridge_ros1_client_config.json5 /zenoh-bridge/nav1_tb3_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"]
ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && /zenoh-bridge/zenoh-bridge-ros1 -c /zenoh-bridge/nav1_tb3_zenoh_bridge_ros1_client_config.json5"]
4 changes: 2 additions & 2 deletions .github/docker/minimal-zenoh-bridge-ros2dds/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ RUN mkdir -p /zenoh-bridge && cd /zenoh-bridge \
&& rm zenoh-plugin-ros2dds.zip

RUN cd /zenoh-bridge \
&& 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
&& wget -O nav2_tb3_zenoh_bridge_ros2dds_client_config.json5 https://raw.githubusercontent.com/open-rmf/free_fleet/refs/heads/$FREE_FLEET_BRANCH/free_fleet_examples/config/zenoh/nav2_tb3_zenoh_bridge_ros2dds_client_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_zenoh_bridge_ros2dds_client_config.json5"]
ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && /zenoh-bridge/zenoh-bridge-ros2dds -c /zenoh-bridge/nav2_tb3_zenoh_bridge_ros2dds_client_config.json5"]
14 changes: 8 additions & 6 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: nightly

on:
schedule:
# 2am SGT
- cron: '0 18 * * *'
# on:
# schedule:
# # 2am SGT
# - cron: '0 18 * * *'

on: [push]

jobs:
build-minimal-nav2-docker-images:
Expand Down Expand Up @@ -41,7 +43,7 @@ jobs:
build-args: |
ROS_DISTRO=${{ matrix.ros_distribution }}
ZENOH_VERSION=1.1.0
FREE_FLEET_BRANCH=easy-full-control
FREE_FLEET_BRANCH=efc-cleanup
tags: ghcr.io/${{ github.repository }}/minimal-zenoh-bridge-ros2dds:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-zenoh-bridge-ros2dds

Expand Down Expand Up @@ -90,7 +92,7 @@ jobs:
ROS_DISTRO=${{ matrix.ros_distribution }}
ZENOH_BRIDGE_REPO=aaronchongth/zenoh-plugin-ros1
ZENOH_BRIDGE_TAG=namespace
FREE_FLEET_BRANCH=easy-full-control
FREE_FLEET_BRANCH=efc-cleanup
tags: ghcr.io/${{ github.repository }}/minimal-zenoh-bridge-ros1:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-zenoh-bridge-ros1

Expand Down
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations ~/turtlebot3_sim

![](../media/ff_tb3_faster_smaller.gif)

This simulates running an isolated (by `ROS_DOMAIN_ID`) turtlebot3 with a ROS 2 navigation stack, and setting up RMF with `free_fleet_adapter` (on a different `ROS_DOMAIN_ID`), allowing the fleet adapter to command the robot via a configured `zenoh-bridge-ros2dds` with the namespace `turtlebot3_1`.
This simulates running an isolated (by `ROS_DOMAIN_ID`) turtlebot3 with a ROS 2 navigation stack, and setting up RMF with `free_fleet_adapter` (on a different `ROS_DOMAIN_ID`), allowing the fleet adapter to command the robot via a configured `zenoh-bridge-ros2dds` with the namespace `nav2_tb3`.

Launch simulation and set up the initial position of the robot (see gif),

Expand Down Expand Up @@ -134,15 +134,15 @@ 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_bridge_ros2dds_client_config.json5
./zenoh-bridge-ros2dds -c ~/ff_ws/src/free_fleet/free_fleet_examples/config/zenoh/nav2_tb3_zenoh_bridge_ros2dds_client_config.json5
```

Listen to transforms over `zenoh`,

```bash
source ~/ff_ws/install/setup.bash
ros2 run free_fleet_examples nav2_get_tf.py \
--namespace turtlebot3_1
--namespace nav2_tb3
```

Start a `navigate_to_pose` action over `zenoh`, using example values,
Expand All @@ -151,7 +151,7 @@ Start a `navigate_to_pose` action over `zenoh`, using example values,
source ~/ff_ws/install/setup.bash
ros2 run free_fleet_examples nav2_send_navigate_to_pose.py \
--frame-id map \
--namespace turtlebot3_1 \
--namespace nav2_tb3 \
-x 1.808 \
-y 0.503
```
Expand All @@ -165,13 +165,16 @@ export ROS_DOMAIN_ID=55
ros2 launch free_fleet_examples turtlebot3_world_rmf_common.launch.xml
```

Launch the `free_fleet_adapter` with the current example's configurations, verify that `turtlebot3_1` has been added to fleet `turtletbot`.
Launch the `free_fleet_adapter` with the current example's configurations, verify that `nav2_tb3` has been added to fleet `turtletbot3`.

```bash
source ~/ff_ws/install/setup.bash
export ROS_DOMAIN_ID=55

ros2 launch free_fleet_examples tb3_simulation_fleet_adapter.launch.xml
ros2 launch free_fleet_examples nav2_tb3_simulation_fleet_adapter.launch.xml

# Or launch with the rmf-web API server address
# ros2 launch free_fleet_examples nav2_tb3_simulation_fleet_adapter.launch.xml server_uri:="ws://localhost:8000/_internal"
```

Dispatch an example RMF patrol tasks using [`rmf-web`](https://github.com/open-rmf/rmf-web) on the same `ROS_DOMAIN_ID` as the RMF core packages, or use the `dispatch_patrol` script,
Expand Down Expand Up @@ -224,7 +227,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/unique_multi_tb3_zenoh_bridge_ros2dds_client_config.json5
./zenoh-bridge-ros2dds -c ~/ff_ws/src/free_fleet/free_fleet_examples/config/zenoh/nav2_unique_multi_tb3_zenoh_bridge_ros2dds_client_config.json5
```

Start the RMF core packages on a different `ROS_DOMAIN_ID` to simulate running on a different machine,
Expand All @@ -237,17 +240,17 @@ export ROS_DOMAIN_ID=55
ros2 launch free_fleet_examples turtlebot3_world_rmf_common.launch.xml
```

Launch the `free_fleet_adapter` with the current example's configurations, verify that `turtlebot3_1` has been added to fleet `turtlebot3`.
Launch the `free_fleet_adapter` with the current example's configurations, verify that `nav2_tb3` has been added to fleet `turtlebot3`.

```bash
source ~/ff_ws/install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export ROS_DOMAIN_ID=55

ros2 launch free_fleet_examples unique_multi_tb3_simulation_fleet_adapter.launch.xml
ros2 launch free_fleet_examples nav2_unique_multi_tb3_simulation_fleet_adapter.launch.xml

# Or launch with the rmf-web API server address
# ros2 launch free_fleet_examples unique_multi_tb3_simulation_fleet_adapter.launch.xml server_uri:="ws://localhost:8000/_internal"
# ros2 launch free_fleet_examples nav2_unique_multi_tb3_simulation_fleet_adapter.launch.xml server_uri:="ws://localhost:8000/_internal"
```

Dispatch example RMF patrol tasks using [`rmf-web`](https://github.com/open-rmf/rmf-web) on the same `ROS_DOMAIN_ID` as the RMF core packages, or use the `dispatch_patrol` scripts, which will cause the robot to negotiate as they perform their tasks.
Expand Down Expand Up @@ -312,7 +315,7 @@ export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=/PATH_TO_navigation2/nav2_bringup/maps/tb3_sandbox.yaml
```

In the ROS 1 Noetic environment, set up prerequisites of [zenoh-plugin-ros1](https://github.com/aaronchongth/zenoh-plugin-ros1), build `zenoh-bridge-ros1` in release, and start it with the [provided config in examples](free_fleet_examples/config/zenoh/turtlebot3_zenoh_bridge_ros1_client_config.json5). See the [relevant docker file](.github/docker/minimal-zenoh-bridge-ros1/Dockerfile) for reference.
In the ROS 1 Noetic environment, set up prerequisites of [zenoh-plugin-ros1](https://github.com/aaronchongth/zenoh-plugin-ros1), build `zenoh-bridge-ros1` in release, and start it with the [provided config in examples](free_fleet_examples/config/zenoh/nav1_tb3_zenoh_bridge_ros1_client_config.json5). See the [relevant docker file](.github/docker/minimal-zenoh-bridge-ros1/Dockerfile) for reference.

```bash
# Get the config file
Expand All @@ -325,7 +328,7 @@ cargo build --package zenoh-bridge-ros1 --bin zenoh-bridge-ros1 --release

# Use cargo run, or just run the executable directly
source /opt/ros/noetic/setup.bash
./target/release/zenoh-bridge-ros1 -c PATH_TO_free_fleet/free_fleet_examples/config/zenoh/turtlebot3_zenoh_bridge_ros1_client_config.json5
./target/release/zenoh-bridge-ros1 -c PATH_TO_free_fleet/free_fleet_examples/config/zenoh/nav1_tb3_zenoh_bridge_ros1_client_config.json5
```

On the machine where the free fleet adapter will run, start the common launch files and the free fleet adapter,
Expand All @@ -337,7 +340,7 @@ export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
ros2 launch free_fleet_examples turtlebot3_world_rmf_common.launch.xml
```

Launch the `free_fleet_adapter` with the current example's configurations, verify that `tb3_0` has been added to fleet `turtlebot3`.
Launch the `free_fleet_adapter` with the current example's configurations, verify that `nav1_tb3` has been added to fleet `turtlebot3`.

```bash
source ~/ff_ws/install/setup.bash
Expand All @@ -356,13 +359,13 @@ source ~/ff_ws/install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export ROS_DOMAIN_ID=55

# tb3_0 to run clockwise around the map
# nav1_tb3 to run clockwise around the map
ros2 run rmf_demos_tasks dispatch_patrol \
-p north_west north_east south_east south_west \
-n 3 \
-st 0 \
-F turtlebot3 \
-R tb3_0
-R nav1_tb3
```

## Troubleshooting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def tearDownClass(cls):

def test_move_base_statuses_do_not_exist(self):
move_base_handler = Nav1MoveBaseHandler(
'missing_turtlebot3_1', self.zenoh_session, self.node
'missing_nav1_tb3', self.zenoh_session, self.node
)

statuses_exists = False
Expand All @@ -54,7 +54,7 @@ def test_move_base_statuses_do_not_exist(self):

def test_command_status_and_cancel(self):
move_base_handler = Nav1MoveBaseHandler(
'tb3_0', self.zenoh_session, self.node
'nav1_tb3', self.zenoh_session, self.node
)

status_array = None
Expand Down
24 changes: 12 additions & 12 deletions free_fleet_adapter/tests/integration/test_nav1_robot_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
import zenoh


class TestNav2RobotAdapter(unittest.TestCase):
class TestNav1RobotAdapter(unittest.TestCase):

@classmethod
def setUpClass(cls):
rclpy.init()
cls.node = rclpy.create_node('test_nav2_robot_adapter')
cls.node = rclpy.create_node('test_nav1_robot_adapter')
cls.zenoh_session = zenoh.open(zenoh.Config())

@classmethod
Expand All @@ -44,7 +44,7 @@ def test_non_existent_robot_pose(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='missing_turtlebot3_1',
name='missing_nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand All @@ -69,7 +69,7 @@ def test_robot_pose(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='tb3_0',
name='nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand All @@ -94,7 +94,7 @@ def test_robot_battery_soc(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='tb3_0',
name='nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand Down Expand Up @@ -122,7 +122,7 @@ def test_robot_unable_to_update(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='tb3_0',
name='nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand Down Expand Up @@ -161,7 +161,7 @@ def test_idle_robot_navigate_is_done(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='tb3_0',
name='nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand All @@ -187,7 +187,7 @@ def test_robot_stop_without_command(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='tb3_0',
name='nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand Down Expand Up @@ -216,7 +216,7 @@ def test_robot_handle_navigate_to_invalid_map(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='tb3_0',
name='nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand Down Expand Up @@ -255,7 +255,7 @@ def test_robot_handle_navigate_to_pose(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='tb3_0',
name='nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand Down Expand Up @@ -292,7 +292,7 @@ def test_robot_stop_navigate(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='tb3_0',
name='nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand Down Expand Up @@ -332,7 +332,7 @@ def test_robot_execute_unknown_action(self):
tf_buffer = Buffer()

robot_adapter = Nav1RobotAdapter(
name='tb3_0',
name='nav1_tb3',
configuration=None,
robot_config_yaml={
'initial_map': 'L1',
Expand Down
4 changes: 2 additions & 2 deletions free_fleet_adapter/tests/integration/test_nav1_tf_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_tf_does_not_exist(self):
tf_buffer = Buffer()

tf_handler = Nav1TfHandler(
'missing_turtlebot3_1', self.zenoh_session, tf_buffer, self.node
'missing_nav1_tb3', self.zenoh_session, tf_buffer, self.node
)

transform_exists = False
Expand All @@ -59,7 +59,7 @@ def test_tf_exists(self):
tf_buffer = Buffer()

tf_handler = Nav1TfHandler(
'tb3_0', self.zenoh_session, tf_buffer, self.node
'nav1_tb3', self.zenoh_session, tf_buffer, self.node
)

transform_exists = False
Expand Down
Loading

0 comments on commit dabfcab

Please sign in to comment.