# \[First Release\] Asyncio For Robotics: Asyncio interface for ROS 2

**URL:** <https://discourse.openrobotics.org/t/first-release-asyncio-for-robotics-asyncio-interface-for-ros-2/50795>\
**Category:** ROS General\
**Tags:** release, ros2, python\
**Created:** [November 3, 2025, 6:53am UTC](https://discourse.openrobotics.org/t/first-release-asyncio-for-robotics-asyncio-interface-for-ros-2/50795 "2025-11-03T06:53:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![2lian](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/2lian/32/32163_2.png) [@2lian](https://discourse.openrobotics.org/u/2lian)\
**Post date:** [November 3, 2025, 6:53am UTC](https://discourse.openrobotics.org/t/first-release-asyncio-for-robotics-asyncio-interface-for-ros-2/50795/1 "2025-11-03T06:53:29Z")

</div>

Hello fellow ROS 2 users,

I wanted to use asyncio with ROS 2 for a while, but didn’t find anything good enough. So I made a library: `asyncio_for_robotics`: [https://github.com/2lian/asyncio-for-robotics](https://github.com/2lian/asyncio-for-robotics)

I am looking for feedback from the community, especially as this is my first release 💦. What would you like to see? What is missing? What do you find confusing? What should I put forward?

# VVV About the project VVV

## Why asyncio?

- Asyncio (native python) syntax is easier, with extensive support and documentation.
- My lab sees many short term students, enable to grasp the Future/Callback and executor of ROS 2.
  - I am very used to it, but what is it the point if the people I code with never understand it?

- We work on multi-robots coordination and synchronization.
  - The ROS 2 syntax becomes bloated and unreadable fast.
  - I for example need to wait for a set of robots (or motors) to reach their target, adding a timeout on top of that.

- Asyncio does not have dependencies, is usable with other communication systems. So I can for example, ask a team to process images using RTSP transport (no ROS code), while I work with ROS transport, and we can merge our work.

## Other solutions

I’ve seen several discussions, and people asking for asyncio+ROS 2. Many good solution have been proposed! However, I feel none was polished and reliable enough, usually they increase the barrier of entry instead of lowering it:

- [`ros2-asyncio`: Fantastic read.](https://github.com/m2-farzan/ros2-asyncio). This is similar to [this solution](https://robotics.stackexchange.com/questions/24304/how-to-bridge-rclpy-with-pythons-asyncio)
- [`ros2_asyncio`: This solution is very good](https://github.com/tlangmo/ros2_asyncio), but necessitates calling `executor.create_task(...)` and the code is executed by the ros executor not asyncio. I have actually used this one a lot.
- [`rclpy_async`: Incredible work! However it replaces the ROS node, instead of interfacing with one](https://github.com/microsoft/rclpy_async/tree/main). I want to be able to call `Node.get_parameters()` and such, just like normal ros. It is also missing the Publisher and Service Server.

## How `asyncio_for_robotics` works? What’s different?

I spin the ROS node in a background thread (similarly to [`rclpy_async`](https://github.com/microsoft/rclpy_async/tree/main)). The user can directly provide a – possibly custom – node to spin in the background, and the user can still interact with the node object – it is just a standard ros node.

This background node sends data onto the main asyncio thread. I provide the user with only a `subscription` object that exposes several ways to wait for data: wait for data, wait for new data, wait for next data, `async for` loop to process all data. This object exposes the data stream of ROS objects: `Timer`, `Subscriber`, `Service Server` (`Action Server` is not implemented yet). On the other hand, `Publisher` doesn’t need to be implemented, because the user can directly use the node to create one. `Service Client` has a very small implementation returning an asyncio future of the call.

Finally, it is named `asyncio_for_robotics` because it can be used with other transport protocol (like `zenoh`), if you make an interface for it – there’s a quick tutorial on how to do that.

---

<div class="post-metadata">

**Author:** ![mjcarroll](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/mjcarroll/32/35469_2.png) [@mjcarroll](https://discourse.openrobotics.org/u/mjcarroll)\
**Post date:** [November 3, 2025, 1:55pm UTC](https://discourse.openrobotics.org/t/first-release-asyncio-for-robotics-asyncio-interface-for-ros-2/50795/2 "2025-11-03T13:55:45Z")

</div>

Howdy @2lian! Looks like an interesting development. Would you care to join in our client library working group, because this has been a very hot topic there over the last several meetings. @nadavelkabets has been working on an asyncio executor that should land in the upstream `rclpy` in time for Lyrical. Would be great to combine efforts there.

---

<div class="post-metadata">

**Author:** ![2lian](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/2lian/32/32163_2.png) [@2lian](https://discourse.openrobotics.org/u/2lian)\
**Post date:** [November 3, 2025, 2:08pm UTC](https://discourse.openrobotics.org/t/first-release-asyncio-for-robotics-asyncio-interface-for-ros-2/50795/3 "2025-11-03T14:08:02Z")

</div>

Yes I would gladly join!

Actually I have used @nadavelkabets new executor. I installed it from his PR branch, had a little fun with it, interfaced it with my `asyncio_for_robotics` and ran a (very very) basic benchmark. It seems to improve performances!

Moreover – maybe I did something wrong but – `asyncio_for_robotics` + `AsyncioExecutor` scored better on my benchmark than just the `AsyncioExecutor`. That was very strange.

---

<div class="post-metadata">

**Author:** ![2lian](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/2lian/32/32163_2.png) [@2lian](https://discourse.openrobotics.org/u/2lian)\
**Post date:** [February 3, 2026, 4:42am UTC](https://discourse.openrobotics.org/t/first-release-asyncio-for-robotics-asyncio-interface-for-ros-2/50795/4 "2026-02-03T04:42:07Z")

</div>

@nadavelkabets @mjcarroll quick update: Sorry I wanted to join many times (and joined once) the client library working group, but it’s at 1-2 am in my timezone. I am always too tired and especially recently, my PhD+work is taking a lot of my time and energy. I will try to follow the Lyrical asyncio PR as I can. Anyway, let me know if you guys need help on anything.
