How to interpret and compute reference_coordinate transforms between RMF coordinate systems and my robot ? (#622)

Posted by @akshay-ka:

Hello,
I’m new to open Open-RMF and have been working on integrating diadem-robot with Open-RMF.

Firstly, I would like to understand how to interpret the coordinate transforms given in the Nav2 Single turtlebot3 world simulation example (from the free_fleet package.)

Secondly, I have overlayed the scan from my robot on top of the base floor plan (see image below). Now, I would like to understand how to compute the transform between RMF coordiante system and my robot, given the scale and X and Y offsets I have provided to match the floor plan with the scan image.

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

Chosen answer

Answer chosen by @aaronchongth at 2025-03-13T08:46:27Z.
Answered by @akshay-ka:

@aaronchongth sorry for deviating from the original topic of this issue.
Actually, I have tried and tested the bare rmf_demos together with rmf_web.
So, I have move forwarded to integrate my robot using free_fleet_adapter and want to visualize/give commands through rmf-web
I have also tested the free_fleet_examples separately.
Btw, the failed to obtain transforms issue is now solved. The problem was that base-footprint was hard-coded in the code base of free_fleet_adapter.

Now, that the current issues are solved, I still need some support for rmf-web integration with free_fleet_adapter for my actual robot.
Is it ok if I open a new Discussion/Q&A for that separately.

Thanks for your support, I’ve been able to solve many issues of free_fleet + rmf_web.

Posted by @aaronchongth:

Hey @akshay-ka, please go through Traffic Editor - Programming Multiple Robots with ROS 2, regarding how to use the traffic editor, especially the part about measurements, Traffic Editor - Programming Multiple Robots with ROS 2. This measurement allows us to get a .building.yaml that describes how to map the pixels to meters. After saving the measurement, make sure to restart the traffic editor (load the saved .building.yaml) for it to take effect.

For computing the reference coordinates, take a look at https://github.com/open-rmf/rmf/discussions/590#discussioncomment-12115874, where we’ve described a way to get the reference coordinates. That applies only to ROS / ROS 2 robots using navigation packages.

Another way to do it is to follow these steps in the book as well, Traffic Editor - Programming Multiple Robots with ROS 2.

If a custom navigation stack is used, the key things to do, is to

  • select recognizable features in the robot’s map (e.g. corner of pillar, corner of room, etc)
  • get the RMF coordinate of that feature from traffic-editor (easiest way is to add a vertex at that location, and get the coordinates in meters from the vertex’s properties)
  • from the custom navigation stack get the coordinates of that same exact feature (depending on the tools of the software stack, the worst case scenario is to drive the localized robot to that location and get the robot’s coordinates)

Since free_fleet is part of the Open-RMF organization, please remember to check if these topics have been covered under the main Open-RMF discussions.


Edited by @aaronchongth at 2025-02-18T01:17:25Z

Posted by @akshay-ka:

@aaronchongth

I have created a reference_coordinates in the fleet config file for my robot fleet_adapter as follows:

As shown in the above screenshot, the rmf coordinates are four corners of a room of size 6 meter x 5 meter. The corresponding robot coordinates from the occupancy grid map are filled accordingly.

Is this way of writing the coordinate transformations correct ?

For the above transformations, I’m getting a tf translation, rotation and scale as shown in the screenshot below.
Screenshot from 2025-03-11 15-49-41
As a result I’m not able to get transform between base link and map.

Further, the local connection to rmf_web fails as shown in the figure.

Could anyone provide guidance or clarifications to these issues ? Any help would be appreciated.

Posted by @aaronchongth:

Nice! The transformation error is 0 now, which is good.

As a result I’m not able to get transform between base link and map.

There is a short amount of time required for all the required transforms to filter in from the robot for the fleet adapter to obtain a proper transform between the robot and the map, thus seeing a few error messages is fine. Sanity check, can you provide as much logs as you can in a https://gist.github.com?

As a reference, see our passing end-to-end integration tests, nightly · open-rmf/free_fleet@3b3cfa0 · GitHub, where the robot finally gets added to the fleet, but before that there are several error messages about failing to obtain the transforms.

Further, the local connection to rmf_web fails as shown in the figure.

How are you launching the API server? If it is on localhost, can you use a browser and navigate to http://localhost:8000/docs to verify that the API server is running?

Posted by @akshay-ka:

@aaronchongth thanks for your reply.
In my case, the failing to obtain transforms remains for long time and doesn’t go away.

Below is the link to the log for ros2 launch fleet_adapter_diadem1 diadem_fleet_adapter.launch.xml server_uri:="ws://localhost:8000/_internal"

How are you launching the API server? If it is on localhost, can you use a browser and navigate to http://localhost:8000/docs to verify that the API server is running?

I’m launching API server through the argument server_uri:="ws://localhost:8000/_internal".
I couldn’t connect to http://localhost:8000/docs, means the API server is not running i guess.

Could you please provide more guidance or clarification?

Posted by @aaronchongth:

Thanks for the logs. Have you been able to listen to the transforms of your robot over zenoh? As well as giving it navigation goals?

ros2 run free_fleet_examples nav2_get_tf.py \
    --namespace diadem1

Please ensure that the zenoh router is running, and the zenoh bridge is running on your robot as well.

Setting the launch argument server_uri:="ws://localhost:8000/_internal" just tells the fleet adapters where the API server is running, it does not start the API server. Please see GitHub - open-rmf/rmf-web

Posted by @akshay-ka:

@aaronchongth

Thanks for the logs. Have you been able to listen to the transforms of your robot over zenoh? As well as giving it navigation goals?

ros2 run free_fleet_examples nav2_get_tf.py \
    --namespace diadem1

I was not able to listen to the transforms, but i was able to give it a navigation goal using ros2 run free_fleet_examples nav2_send_navigate_to_pose.py --frame-id map --namespace diadem1 -x 1.808 -y 0.503 and the robot moved to the goal successfully.

Please ensure that the zenoh router is running, and the zenoh bridge is running on your robot as well.

Yes, I have ensured that both are running on the robot.

Setting the launch argument server_uri:="ws://localhost:8000/_internal" just tells the fleet adapters where the API server is running, it does not start the API server. Please see GitHub - open-rmf/rmf-web

I’m trying to install the dependencies for the rmf-web by running pnpm install -w --filter api-server..., but i get the error message as ERROR --workspace-root may only be used inside a workspace.


Edited by @akshay-ka at 2025-03-12T08:14:27Z

Posted by @aaronchongth:

if you are able to send a navigation goal, but not listen to transforms, your robot might be using different TFs than the standardized ones. The script listens to base_footprint by default. You can check the frames of your robot by running ros2 run tf2_tools view_frames on the robot itself, and verify what are the frames used by the robot. Then you can check with the script again by using the --base-footprint-frame argument, free_fleet/free_fleet_examples/free_fleet_examples/nav2_get_tf.py at main · open-rmf/free_fleet · GitHub

I’m trying to install the dependencies for the rmf-web by running pnpm install -w --filter api-server…, but i get the error message as ERROR --workspace-root may only be used inside a workspace.

Sounds like you are trying to run that without being in the directory

git clone https://github.com/open-rmf/rmf-web
cd rmf-web
pnpm install -w --filter api-server...

Posted by @akshay-ka:

frames_2025-03-12_09.30.39.pdf
@aaronchongth I have attached the tf tree for your reference. I have tried setting the --base-footprint-frame to base_link. However i am still not be able to get the transforms.

Sounds like you are trying to run that without being in the directory

git clone https://github.com/open-rmf/rmf-web
cd rmf-web
pnpm install -w --filter api-server...

I get the following error the while i install the pnpm install -w --filter api-server...

Posted by @aaronchongth:

Hi @akshay-ka

I have attached the tf tree for your reference. I have tried setting the --base-footprint-frame to base_link. However i am still not be able to get the transforms.

in this case, I’m unsure what the cause of the issue could be. The usual culprits are RMW_IMPLEMENTATION not being rmw_cyclonedds_cpp, and ROS_DOMAIN_ID being different. However seeing that the navigation example works, I’m a little out of ideas. Our nightly end-to-end tests are working, nightly · open-rmf/free_fleet@3b3cfa0 · GitHub, so it is possible that there is something on your setup that is inherently different from a usual turtlebot navigation stack. I don’t think I can help much on that.

I get the following error the while i install the pnpm install -w --filter api-server…

I just verified that the installation works on a fresh ubuntu docker image, so this is due to your setup. On closer inspection, the installation is failing to find pipenv in the local virtual environment, so this means that the user most likely failed the installation a first time due to not performing sudo apt install python3-pip python3-venv as mentioned in the instructions, and tried again, which causes the installation to find an already existing empty virtual environment. Please run these commands before running the installation, which deletes the existing empty virtual environment,

cd rmf-web
rm -rf .venv
pnpm install -w --filter api-server...

Posted by @akshay-ka:

cd rmf-web
rm -rf .venv
pnpm install -w --filter api-server...

@aaronchongth I removed the .venv and then tried to install. I’m unsure if the installation is done correctly. (Please see the screenshot below)

Posted by @aaronchongth:

Yes that looks good.

Posted by @akshay-ka:

@aaronchongth I’m unable to run the rmf_api_server command even after the installation. Please see the screenshot below.

Posted by @aaronchongth:

Please read through the instructions of running the API server standalone, GitHub - open-rmf/rmf-web.

source ~/rmf_ws/install/setup.bash
# set up your RMW implementation and ROS DOMAIN ID to be the same as the free fleet adapter

# Start the API server, this will need to be restarted for any changes to be reflected
cd ~/rmf-web/packages/api-server
pnpm start

@akshay-ka, we might be veering off topic here. And it would be a more constructive discussion as well, if you can go through the documentation properly, or perhaps try out the bare rmf_demos together with rmf-web to get a better idea how things fit together, before trying free_fleet + rmf-web. The free fleet examples can be tried out without integrating with rmf-web for now, and only when the issues with your free fleet adapter and connection is resolved should you delve into integrating rmf-web. This discussion may need to be closed if we continue going back-and-forth with debugging logs and screenshots unrelated to the original topic or already covered in documentation.

Posted by @akshay-ka:

@aaronchongth sorry for deviating from the original topic of this issue.
Actually, I have tried and tested the bare rmf_demos together with rmf_web.
So, I have move forwarded to integrate my robot using free_fleet_adapter and want to visualize/give commands through rmf-web
I have also tested the free_fleet_examples separately.
Btw, the failed to obtain transforms issue is now solved. The problem was that base-footprint was hard-coded in the code base of free_fleet_adapter.

Now, that the current issues are solved, I still need some support for rmf-web integration with free_fleet_adapter for my actual robot.
Is it ok if I open a new Discussion/Q&A for that separately.

Thanks for your support, I’ve been able to solve many issues of free_fleet + rmf_web.


Edited by @akshay-ka at 2025-03-13T08:02:21Z


This is the chosen answer.

Posted by @aaronchongth:

Yes, it is hard coded now with a TODO, free_fleet/free_fleet_adapter/free_fleet_adapter/nav2_robot_adapter.py at main · open-rmf/free_fleet · GitHub. Would you like to contribute to make it configurable? It could be a good first issue to resolve.

Is it ok if I open a new Discussion/Q&A for that separately.

That would be a good idea. As mentioned, please go ahead and try using rmf_demos (or the free_fleet examples) with rmf-web first to verify that things are working, and understand better how the integration works, before attempting to debug what could be going wrong with your integration/setup, and before posting a question.

Posted by @akshay-ka:

Yes, it is hard coded now with a TODO, free_fleet/free_fleet_adapter/free_fleet_adapter/nav2_robot_adapter.py at main · open-rmf/free_fleet · GitHub. Would you like to contribute to make it configurable? It could be a good first issue to resolve.

I would be happy to do that. But it might take some time.

Posted by @akshay-ka:

@aaronchongth I would like to contribute. Should i fork the main branch OR will there be a new branch created from your end ?


Edited by @akshay-ka at 2025-03-13T09:52:30Z

Posted by @aaronchongth:

Awesome to hear @akshay-ka. I’ve opened an enhancement issue ticket with more details of this, [Feature request]: Make TfHandler target frames configurable · Issue #178 · open-rmf/free_fleet · GitHub, and will put it up on our usual PMC development project board, PMC Board · GitHub

Should i fork the main branch OR will there be a new branch created from your end ?

Forking it would be the way to go, since you won’t have write access to push any branches upstream.

I would be happy to do that. But it might take some time.

Don’t worry about it, this is good start.


Edited by @aaronchongth at 2025-03-13T10:46:56Z