Communication between fleet_adapter and fleet_manager (#585)

Posted by @akshay-ka:

Hello,

I’m new to Open-RMF and trying to understand the framework by following the source code of the demo
ros2 launch rmf_demos_gz_classic office.launch.xml.

Currently, i want to understand at what part of the source code is the communication between fleet_adapter and fleet_manager happening ?

Could anyone provide guidance or clarification? Any help would be appreciated.

Chosen answer

Answer chosen by @akshay-ka at 2025-02-03T05:05:19Z.
Answered by @xiyuoh:

Thanks for clarifying, I misunderstood the question. The demos fleet adapter is communicating with the fleet manager in the following callbacks: navigate (travel to a specific coordinate x, y, z), stop (command the robot to stop moving), execute_action (trigger a custom action for the robot to perform) and update_robot (retrieve the robot’s latest state information). These are RMF EasyFullControl’s API.

You’ll see that in each callback we’re calling self.api.navigate, self.api.stop, etc., which points to the respective callbacks in RobotClientAPI. This is a class where we store REST API requests that will be sent to the fleet manager. You could opt to fill in these APIs directly in the EasyFullControl callbacks if you’d like, we just implemented it this way for neatness and clarity.

The rmf_demos fleet manager REST endpoints are being set up to receive requests from RobotClientAPI. Specifically they are navigate, stop, start_activity and status.

When filling out your own fleet adapter, you mainly want to update the RobotClientAPI with your chosen robot API for these 4 important callbacks. I hope this answers your question.

Posted by @xiyuoh:

Hello! The fleet adapter is used to bridge RMF with your robots’ API, so that RMF can send navigation commands to your robots as well as receive status updates. In rmf_demos, we demonstrate how a fleet adapter can be implemented for a fleet of robots managed by a fleet manager that uses REST API for communication. There are many ways to implement fleet adapters, we have a collated list of adapters here that integrate with various types of robot APIs.

Though it is not updated with documentation on EasyFullControl, this section of The Book illustrates how a fleet adapter can be written to communicate with your chosen robot API using rmf_demos_fleet_adapter as a case study.

In other words, the rmf_demos_fleet_adapter package is not really part of the RMF core library; fleet_adapter.py is a sample implementation of RMF fleet adapter using the core libraries, while fleet_manager.py is written to demonstrate this integration for REST API.

Let me know if you have further questions.

Posted by @akshay-ka:

@xiyuoh Thank you for your reply.

As i told earlier, I’m understanding the source code of rmf_demo_fleet_adapters in order to integrate one of the robots we have in our facility with RMF.

Please if you could explain where exactly in the source code, the communication between fleet_adapter and fleet_manager happens.

Thanks in advance.

Posted by @xiyuoh:

Thanks for clarifying, I misunderstood the question. The demos fleet adapter is communicating with the fleet manager in the following callbacks: navigate (travel to a specific coordinate x, y, z), stop (command the robot to stop moving), execute_action (trigger a custom action for the robot to perform) and update_robot (retrieve the robot’s latest state information). These are RMF EasyFullControl’s API.

You’ll see that in each callback we’re calling self.api.navigate, self.api.stop, etc., which points to the respective callbacks in RobotClientAPI. This is a class where we store REST API requests that will be sent to the fleet manager. You could opt to fill in these APIs directly in the EasyFullControl callbacks if you’d like, we just implemented it this way for neatness and clarity.

The rmf_demos fleet manager REST endpoints are being set up to receive requests from RobotClientAPI. Specifically they are navigate, stop, start_activity and status.

When filling out your own fleet adapter, you mainly want to update the RobotClientAPI with your chosen robot API for these 4 important callbacks. I hope this answers your question.


This is the chosen answer.