Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Re-write] Free fleet adapter using easy-full-control fleet adapter and zenoh bridges #145

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

aaronchongth
Copy link
Member

@aaronchongth aaronchongth commented Sep 30, 2024

New feature implementation

A large motivation of this re-write, is to fully utilize the well tested tools already available in the ROS ecosystem and Zenoh, and also take advantage of python bindings as much as possible, to allow for easier iterations, testing and contributions.

The use of Zenoh bridges will hopefully also minimize disruption to any existing robot navigation stack, and can be spun up with just a standalone binary with the appropriate configuration file.

The legacy implementation can still be found at the legacy branch.

Architecture

This architecture and the use of Zenoh bridges will ideally improve the integration experience, with just setting up the zenoh-bridge-ros2dds and its configuration, instead of building and running a separate node.

This PR does not support the ROS 1 navigation stack, the diagram is just for illustrating the proposed architecture once it is implemented down the road.

Single robot example using official nav2_bringup's tb3_simulation

Two robots example using official nav2_bringup's unique_multi_tb3_simulation

Although the two robot simulation example is just for testing purposes as it uses a different architecture as intended

Next TODOs (over subsequent PRs)

  • hardware testing
  • attempt to optimize tf messages (not all are needed)
  • ROS 1 nav support
  • map switching support
  • docking support
  • support for Rolling
  • docker images
  • releases
  • testing and support for other RMW implementations

There are plenty of TODOs left, but this is the bare minimum testable and usable state

@aaronchongth aaronchongth marked this pull request as ready for review September 30, 2024 17:45
@aaronchongth aaronchongth marked this pull request as draft September 30, 2024 17:46
@aaronchongth aaronchongth marked this pull request as ready for review October 1, 2024 02:50
@aaronchongth aaronchongth changed the title [Re-write] Free fleet adapter using easy full control and zenoh bridges [Re-write] Free fleet adapter using easy-full-control fleet adapter and zenoh bridges Oct 1, 2024
@aaronchongth aaronchongth mentioned this pull request Oct 1, 2024
* Pytest setup

Signed-off-by: Aaron Chong <[email protected]>

* Add workflow

Signed-off-by: Aaron Chong <[email protected]>

* On push for testing

Signed-off-by: Aaron Chong <[email protected]>

* Remove branch override

Signed-off-by: Aaron Chong <[email protected]>

* Use workflow directory

Signed-off-by: Aaron Chong <[email protected]>

* Basic testing ci without RMF

Signed-off-by: Aaron Chong <[email protected]>

* Use containers

Signed-off-by: Aaron Chong <[email protected]>

---------

Signed-off-by: Aaron Chong <[email protected]>
README.md Outdated Show resolved Hide resolved
@aaronchongth aaronchongth mentioned this pull request Oct 16, 2024
1 task
Copy link
Member

@xiyuoh xiyuoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for revamping free fleet! Tried out the examples and things are looking fantastic. I was able to bring up both single and multiple TB3 tests by following the instructions on README.

Left some minor comments for the README that are mostly about typos and clarity. For the fleet/robot adapter, I was primarily looking out for edge cases where self.nav_goal_id might fall out of sync with self.execution and catching any scenarios where the execution object is left unattended if self.nav_goal_id is set to None. This may lead to RMF not sending any subsequent commands, or sending outdated nav commands if replans are not being called prompty.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@PVijayaGanesh
Copy link

PVijayaGanesh commented Oct 29, 2024

Hi I did Free fleet adapter using easy-full-control fleet adapter and zenoh bridges
Steps I follow:

  1. Install humble rmf

  2. clone the branch easy full controll free fleet ( git clone -b easy-full-controll <> )

  3. zenoh v11 setup i did ..

  4. ros2 run free_fleet_examples test_navigate_to_pose.py
    --frame-id map
    --namespace turtlebot3_1
    -x 1.808
    -y 0.503

    This command is working... i sends the goal and robot is moving

    1. when the launch free fleet adapter i got this issue..

Screenshot from 2024-10-29 10-26-29

How can i resolve this...

@xiyuoh @aaronchongth

tomkimsour and others added 5 commits November 7, 2024 11:58
* rebase with latest change

Signed-off-by: thomasung <[email protected]>

* add missing \ in readme

Signed-off-by: thomasung <[email protected]>

* update readme informations about zenoh version

Signed-off-by: thomasung <[email protected]>

clean dangling code

* fix linting issues and test example test files

Signed-off-by: thomasung <[email protected]>

---------

Signed-off-by: thomasung <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
tomkimsour and others added 3 commits November 15, 2024 11:19
* fix Crash node if easy_fleet creation fails

Upon creation of the EasyFullControl object the node may keep running even tho the returned pointer is null

Signed-off-by: thomasung <[email protected]>

lint

Signed-off-by: thomasung <[email protected]>

* rephrase comments

Signed-off-by: thomasung <[email protected]>

follow pycodestyle

Signed-off-by: Thomas Ung <[email protected]>

---------

Signed-off-by: thomasung <[email protected]>
Signed-off-by: Thomas Ung <[email protected]>
* Adding dockerfiles for building tests

Signed-off-by: Aaron Chong <[email protected]>

* Initial docker compose nightly workflow

Signed-off-by: Aaron Chong <[email protected]>

* Using new docker compose command

Signed-off-by: Aaron Chong <[email protected]>

* Fix zenoh bridge image branch

Signed-off-by: Aaron Chong <[email protected]>

* Use curl for repo tar

Signed-off-by: Aaron Chong <[email protected]>

* Use docker compose command for down too

Signed-off-by: Aaron Chong <[email protected]>

* Setup integration testing with flag, test with workflow

Signed-off-by: Aaron Chong <[email protected]>

* Install docker-compose in ros container

Signed-off-by: Aaron Chong <[email protected]>

* Ommit setup-ros step and fix linting

Signed-off-by: Aaron Chong <[email protected]>

* Revert setup ros step, use cmake -args

Signed-off-by: Aaron Chong <[email protected]>

* Use 1.0.1 API

Signed-off-by: Aaron Chong <[email protected]>

* Using client and router method

Signed-off-by: Aaron Chong <[email protected]>

* Remove command in docker compose

Signed-off-by: Aaron Chong <[email protected]>

* Working locally, commented out zenohd

Signed-off-by: Aaron Chong <[email protected]>

* Spinning up minimal-zenoh too

Signed-off-by: Aaron Chong <[email protected]>

* Moving docker files, trying with client mode

Signed-off-by: Aaron Chong <[email protected]>

* Use official zenoh docker image and compose example, rename client zenoh config, update README, test build docker images

Signed-off-by: Aaron Chong <[email protected]>

* Re-usable workflow actions, split integration testing

Signed-off-by: Aaron Chong <[email protected]>

* Missing docker-compose installation

Signed-off-by: Aaron Chong <[email protected]>

* Fix broken action, rename test job

Signed-off-by: Aaron Chong <[email protected]>

* Fix shell selection, use composite

Signed-off-by: Aaron Chong <[email protected]>

* Set nightly schedule, fix steps in unit-tests

Signed-off-by: Aaron Chong <[email protected]>

* Remove minimal zenoh router dockerfile, add checkout to unit-tests

Signed-off-by: Aaron Chong <[email protected]>

* Isolating tf listner components for testing

Signed-off-by: Aaron Chong <[email protected]>

* Use correct robot name, lint

Signed-off-by: Aaron Chong <[email protected]>

* Clean up imports and fix namespacing

Signed-off-by: Aaron Chong <[email protected]>

* Refactor to TfHandler, added testing

Signed-off-by: Aaron Chong <[email protected]>

* Simplifying API

Signed-off-by: Aaron Chong <[email protected]>

* Moved integration testing to free fleet adapter, added abstract RobotAdapter

Signed-off-by: Aaron Chong <[email protected]>

* Abstract out robot adapter, slight refactor

Signed-off-by: Aaron Chong <[email protected]>

* Robot existense test, with a planned failure to verify that it is running

Signed-off-by: Aaron Chong <[email protected]>

* setup rclpy node for testing too

Signed-off-by: Aaron Chong <[email protected]>

* Add coverage and fix lint

Signed-off-by: Aaron Chong <[email protected]>

* Use unit test test cases

Signed-off-by: Aaron Chong <[email protected]>

* Move tests

Signed-off-by: Aaron Chong <[email protected]>

* Fix launch files

Signed-off-by: Aaron Chong <[email protected]>

* Rename functions

Signed-off-by: Aaron Chong <[email protected]>

* Not to check execution, comment out stop command test

Signed-off-by: Aaron Chong <[email protected]>

* Use helper function for stop

Signed-off-by: Aaron Chong <[email protected]>

* Using all statuses

Signed-off-by: Aaron Chong <[email protected]>

* Badges

Signed-off-by: Aaron Chong <[email protected]>

* Switch to easy-full-control branch before merging

Signed-off-by: Aaron Chong <[email protected]>

* Update readme

Signed-off-by: Aaron Chong <[email protected]>

---------

Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 164 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@0909836). Learn more about missing BASE report.

Files with missing lines Patch % Lines
..._fleet_adapter/free_fleet_adapter/fleet_adapter.py 0.00% 112 Missing ⚠️
...t_adapter/free_fleet_adapter/nav2_robot_adapter.py 72.61% 40 Missing and 6 partials ⚠️
..._fleet_adapter/free_fleet_adapter/robot_adapter.py 79.31% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #145   +/-   ##
=======================================
  Coverage        ?   63.63%           
=======================================
  Files           ?        6           
  Lines           ?      451           
  Branches        ?       59           
=======================================
  Hits            ?      287           
  Misses          ?      158           
  Partials        ?        6           
Flag Coverage Δ
tests 63.63% <63.63%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Signed-off-by: Aaron Chong <[email protected]>
@aaronchongth
Copy link
Member Author

Heads up @xiyuoh when you try it out again

While setting up static and integration tests, I've found that setting up a zenoh router between the bridges and the free_fleet_adapter provides the best stability and repeatability (IRL and in CI). Folks can reference the docker compose file.

I've updated the documentation, tests and architecture diagrams.

This is not a big change as it was already expected that folks will need to use a zenoh router eventually when setting up everything as a distributed system.

* Add ignore to codecov

Signed-off-by: Aaron Chong <[email protected]>

* Test ignore

Signed-off-by: Aaron Chong <[email protected]>

---------

Signed-off-by: Aaron Chong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

4 participants