Read-only robot status in rmf-web (#606)

Posted by @sabbysim:

Hi, I noticed that read-only robots are not returned by GET Fleets API (http://localhost:8000/fleets) but they can be seen on the map as icons. How can I display the read-only robots from fleet_states topic on rmf-web UI?

Posted by @aaronchongth:

Hey there @sabbysim! That’s strange indeed, the robot icon locations are derived from the same fleet updates that should be available from the api-server.

Could you double check that API calls from http://localhost:8000/docs do not return the read-only robots?

If your project is open source, it would be super helpful for us to reproduce and look into this as well

Posted by @sabbysim:

Hi @aaronchongth
I can recreate using the airport terminal RMF Demo.
ros2 launch rmf_demos_gz_classic airport_terminal.launch.xml server_uri:=“ws://localhost:8000/_internal”
In this demo, there should be a read-only caddy fleet but http://localhost:8000/fleets does not return it.

This is the response from http://localhost:8000/fleets. It returns only the full control fleets.

[
{
“name”: “tinyRobot”,
“robots”: {
“tinyRobot_0”: {
“name”: “tinyRobot_0”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120965,
“location”: {
“map”: “L1”,
“x”: 28.719661712646484,
“y”: -51.19288635253906,
“yaw”: -1.5676981210708618
},
“battery”: 1,
“issues”:
},
“tinyRobot_1”: {
“name”: “tinyRobot_1”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120965,
“location”: {
“map”: “L1”,
“x”: 67.96710205078125,
“y”: -49.361324310302734,
“yaw”: -1.5979739427566528
},
“battery”: 1,
“issues”:
},
“tinyRobot_2”: {
“name”: “tinyRobot_2”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120965,
“location”: {
“map”: “L1”,
“x”: 86.49716186523438,
“y”: -9.632567405700684,
“yaw”: -0.0017068698070943356
},
“battery”: 1,
“issues”:
},
“tinyRobot_3”: {
“name”: “tinyRobot_3”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120965,
“location”: {
“map”: “L1”,
“x”: 21.77650260925293,
“y”: -27.45104217529297,
“yaw”: 1.5823876857757568
},
“battery”: 1,
“issues”:
}
}
},
{
“name”: “deliveryRobot”,
“robots”: {
“deliveryRobot_0”: {
“name”: “deliveryRobot_0”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120728,
“location”: {
“map”: “L1”,
“x”: 96.59527587890625,
“y”: -51.96450424194336,
“yaw”: -0.01639716327190399
},
“battery”: 1,
“issues”:
},
“deliveryRobot_1”: {
“name”: “deliveryRobot_1”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120728,
“location”: {
“map”: “L1”,
“x”: 152.3477325439453,
“y”: -44.31863021850586,
“yaw”: 0.03110901266336441
},
“battery”: 1,
“issues”:
},
“deliveryRobot_2”: {
“name”: “deliveryRobot_2”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120728,
“location”: {
“map”: “L1”,
“x”: 14.776845932006836,
“y”: -9.279278755187988,
“yaw”: 0.0047278208658099174
},
“battery”: 1,
“issues”:
}
}
},
{
“name”: “cleanerBotA”,
“robots”: {
“cleanerBotA_0”: {
“name”: “cleanerBotA_0”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120751,
“location”: {
“map”: “L1”,
“x”: 117.41259765625,
“y”: -49.48040008544922,
“yaw”: -1.5729585886001587
},
“battery”: 1,
“issues”:
}
}
},
{
“name”: “cleanerBotE”,
“robots”: {
“cleanerBotE_0”: {
“name”: “cleanerBotE_0”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120728,
“location”: {
“map”: “L1”,
“x”: 159.69854736328125,
“y”: -55.561195373535156,
“yaw”: 1.5709528923034668
},
“battery”: 1,
“issues”:
},
“cleanerBotE_1”: {
“name”: “cleanerBotE_1”,
“status”: “idle”,
“task_id”: “”,
“unix_millis_time”: 120728,
“location”: {
“map”: “L1”,
“x”: 163.4232635498047,
“y”: -55.62590789794922,
“yaw”: 1.5625743865966797
},
“battery”: 1,
“issues”:
}
}
}
]

Posted by @sabbysim:

Hi @aaronchongth
Any updates on this?

  1. GET Fleets API does not return read-only robot status
  2. Map view displays the green path of read-only robots but does not show the robot icon
    The above have been verified on Airport terminal RMF demo.
    I am using Humble-release (binary) and the default launch command shown below:
    ros2 launch rmf_demos_gz_classic airport_terminal.launch.xml server_uri:=“ws://localhost:8000/_internal”
    For rmf-web, I downloaded from Main a few days ago.

Posted by @aaronchongth:

Hello @sabbysim! Thanks for pinging again, upon checking our demo’s implementation and our previous motivation for read-only fleets (especially in this airport_terminal demo), the purpose was to insert non-controllable agents into the schedule, which will allow all other robots to be routed out of the way.

There are no fleet based updates arising from the read-only fleet over ROS 2 or over websockets, as these robots/agents, do not necessary provide RMF with any information at all, other than their assumed positions and direction. rmf-web obtains robot fleet updates via websockets, and it makes sense that this read-only fleet will be excluded. (Can’t be queried over API and doesn’t show up as a robot on the dashboard)

The reason trajectory shows up, is that the trajectory server operates separately from the fleet adapters and already provides the trajectories in the schedule over websocket, hence the dashboard is able to display it. However all the users would see is the potential trajectory of the read-only fleet, which all other robots will avoid.

Since the read-only fleet do not contribute to an open-rmf setup other than ensure all traffic is routed out of their way, I would say it is by-design that we should not be displaying anything related to the read-only fleet on the web dashboard, hope that clarifies things


Edited by @aaronchongth at 2024-02-02T17:10:59Z

Posted by @sabbysim:

Hi @aaronchongth, thanks for looking into the issue. Noted that read-only fleet updates are not essential to the open rmf setup, hence they will not be displayed.

For our application, we are integrating a robotic arm mounted on a linear conveyor belt as a read-only robot. We hope to display the status and position (from fleet_states topic) to the rmf web UI. Noted that the existing websockets and API, will not work. Is it possible to read from the fleet_states topic directly? Appreciate if you can give me some guidance (which part of the code should I modify) so that I can customize the UI for our application.

Posted by @aaronchongth:

There is currently no way to use the fleet_states topic for the UI, as we have already deprecated it in favor of using websockets for fleet state updates.

The best way forward would be to implement the updates in websockets for your readonly fleet adapter,
you can see some examples on how the current fleet adapters handle it using the BroadcastClient