# Rust and Robotics?

**URL:** <https://discourse.openrobotics.org/t/rust-and-robotics/23344>\
**Category:** ROS General\
**Tags:** rust, wg-rust\
**Created:** [December 3, 2021, 1:19pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344 "2021-12-03T13:19:00Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![msadowski](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/msadowski/32/33950_2.png) [@msadowski](https://discourse.openrobotics.org/u/msadowski)\
**Post date:** [December 3, 2021, 1:19pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/1 "2021-12-03T13:19:00Z")

</div>

Hi everyone!

In our last Weekly Robotics meetup with [Tangram Vision](https://www.tangramvision.com/) we briefly started discussing using Rust in robotics development. It seemed that lots of people were interested in the and we thought it might be a good idea to have a meetup where people could discuss their experience using Rust.

Anyone would have any experiences they would like to share? Let me know and I will try to come up with some idea on running this session.

If anyone from the Rust WG would be interested in presenting too that would be amazing!

---

<div class="post-metadata">

**Author:** ![zmk5](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/zmk5/32/24981_2.png) [@zmk5](https://discourse.openrobotics.org/u/zmk5)\
**Post date:** [December 4, 2021, 3:50pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/2 "2021-12-04T15:50:18Z")

</div>

Currently there are two projects exploring the use of Rust with ROS:

- [GitHub - ros2-rust/ros2\_rust: Rust bindings for ROS 2](https://github.com/ros2-rust/ros2_rust)
- [GitHub - sequenceplanner/r2r: Minimal ROS 2 Rust bindings](https://github.com/sequenceplanner/r2r)

In addition, I do believe there is a monthly working group that meets about getting Rust working with ROS. @esteve and @ruffsl would know more about this working group.

---

<div class="post-metadata">

**Author:** ![kristoferB](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/kristoferb/32/2895_2.png) [@kristoferB](https://discourse.openrobotics.org/u/kristoferB)\
**Post date:** [December 7, 2021, 5:41am UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/3 "2021-12-07T05:41:09Z")

</div>

Hi  
We at Chalmers University of Technology are working quite a lot with rust and ros2, and have developed r2r. We are mainly working with various automation projects using automated planning and ros2. Most of our work is located under the [Sequence Planner · GitHub](https://github.com/sequenceplanner) organisation. We started working with rust, 2-3 years ago and really like it. Especially writing async rust when writing our ros nodes is great.

We are fully booked this year, but maybe we can share something related to r2r next year.

---

<div class="post-metadata">

**Author:** ![jhdcs](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/jhdcs/32/8074_2.png) [@jhdcs](https://discourse.openrobotics.org/u/jhdcs)\
**Post date:** [December 7, 2021, 1:37pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/4 "2021-12-07T13:37:01Z")

</div>

> [@zmk5](#):
>
> In addition, I do believe there is a monthly working group that meets about getting Rust working with ROS. @esteve and @ruffsl would know more about this working group.

At the moment, we’re at more of an “as-needed” meeting schedule, though I just floated the idea of meeting a bit more regularly. If you would like to listen in or join in our discussions, you’re always welcome to join our [matrix channel](https://matrix.to/#/+rosorg-rust:matrix.org)!

At the moment, our big focus area (apart from the client library linked by @zmk5) is getting Rust build support integrated with cargo via the [`colcon-cargo`](https://github.com/colcon/colcon-cargo) plugin.

---

<div class="post-metadata">

**Author:** ![jhelovuo](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/jhelovuo/32/11983_2.png) [@jhelovuo](https://discourse.openrobotics.org/u/jhelovuo)\
**Post date:** [February 4, 2022, 2:47pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/5 "2022-02-04T14:47:06Z")

</div>

> [@zmk5](#):
>
> Currently there are two projects exploring the use of Rust with ROS:

Now three!

- [ROS2-client](https://github.com/jhelovuo/ros2-client)

This is still a work-in-progress, but feedback is welcome.

---

<div class="post-metadata">

**Author:** ![alexkaravaev](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/alexkaravaev/32/12573_2.png) [@alexkaravaev](https://discourse.openrobotics.org/u/alexkaravaev)\
**Post date:** [February 8, 2022, 7:38am UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/6 "2022-02-08T07:38:41Z")

</div>

Hi everyone!

Are there any conceptual big differences between these 3 client libraries? I am asking because I see that if there is so much people wanting to write the client libraries, then seems like a lot of people want to write ROS applications in Rust 😄 .  
Are there any plans on consolidating the efforts on one particular library?

I wish to be part of rust working group, because it really looks like this language is perfect fit for robotics, but seems like I can not join matrix group (@jhdcs) with element web ui, is there any direct invitation required?

---

<div class="post-metadata">

**Author:** ![esteve](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/esteve/32/12_2.png) [@esteve](https://discourse.openrobotics.org/u/esteve)\
**Post date:** [February 8, 2022, 12:57pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/7 "2022-02-08T12:57:06Z")

</div>

Hi @alexkaravaev !

> [@alexkaravaev](#):
>
> Are there any conceptual big differences between these 3 client libraries?

Good question! Disclaimer: I’m the original author of `ros2-rust` and was a member of the ROS2 core team, but I’ll try to be as unbiased as possible.

All three projects have their merits and different goals:

- `ros2-rust` has a strong emphasis on being integrated into the ROS2 ecosystem (that includes the build system, message generation, etc.) with the eventual goal of being part of the standard ROS distribution. Hence it leverages the ROS2 infrastructure (e.g. the message generation pipeline, integration of Cargo as a build system into ROS via ament, allowing it to be built via colcon, etc.).

- `r2r` is a crate that uses `rcl` as the common layer for integrating with ROS, but foregoes some of the ROS infrastructure. For example, it does not do message generation in the traditional ROS way, but leverages `bindgen` to generate bindings for messages at compile time. This has the advantage that it’s not so tied to ROS and can implement features without certain constraints.

- `ROS2-client` bypasses the ROS infrastructure entirely and uses RustDDS directly as a transport layer, it doesn’t do any message generation, but uses the DDS API to send messages. This has the advantage that you can write an application that only uses Rust and no external libraries. The drawback is that you’re tied to DDS as your transport layer (e.g. if you want to use zenoh or any other alternative RMW implementation, you can’t)

Hope this helped to clarify the differences between the three projects

> [@alexkaravaev](#):
>
> I wish to be part of rust working group, because it really looks like this language is perfect fit for robotics, but seems like I can not join matrix group (@jhdcs) with element web ui, is there any direct invitation required?

I believe @jhdcs has sent you an invite to the channel, hope to see you there!

---

<div class="post-metadata">

**Author:** ![esteve](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/esteve/32/12_2.png) [@esteve](https://discourse.openrobotics.org/u/esteve)\
**Post date:** [February 8, 2022, 1:01pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/8 "2022-02-08T13:01:17Z")

</div>

> [@alexkaravaev](#):
>
> I wish to be part of rust working group, because it really looks like this language is perfect fit for robotics, but seems like I can not join matrix group (@jhdcs) with element web ui, is there any direct invitation required?

If you haven’t received Jacob’s message, I think you (and everyone else) can join via the following link:

> **[You're invited to talk on Matrix](https://matrix.to/#/!AiYXdTWExqamTdatBl:matrix.org?via=matrix.org&via=matrix.bobedibob.de)**
>
> You're invited to talk on Matrix. If you don't already have a client this link will help you pick one, and join the conversation. If you already have one, this link will help you join the conversation

---

<div class="post-metadata">

**Author:** ![alexkaravaev](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/alexkaravaev/32/12573_2.png) [@alexkaravaev](https://discourse.openrobotics.org/u/alexkaravaev)\
**Post date:** [February 8, 2022, 1:45pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/9 "2022-02-08T13:45:59Z")

</div>

Thank you @esteve !

Now the whole situation is clear to me.

---

<div class="post-metadata">

**Author:** ![tomkimsour](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/tomkimsour/32/13143_2.png) [@tomkimsour](https://discourse.openrobotics.org/u/tomkimsour)\
**Post date:** [April 13, 2022, 9:17am UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/10 "2022-04-13T09:17:19Z")

</div>

Hi, it looks like the ros/rust community is working well towards putting ros as a standard programming language. Why did you all choose to work toward using rust instead of using golang ? I felt like these two languages were pretty similar, while go is easier to learn hence would attract more people towards shifting to this language.

---

<div class="post-metadata">

**Author:** ![grey](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/grey/32/10444_2.png) [@grey](https://discourse.openrobotics.org/u/grey)\
**Post date:** [April 13, 2022, 10:07am UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/11 "2022-04-13T10:07:02Z")

</div>

Programming language preferences are almost always going to be a highly subjective matter, with a particularly strong bias towards familiarity. The idea that Golang is easier to learn than Rust may be heavily influence by a person’s past experiences, learning styles, and the environment that they work in.

I’ve found the official free online Rust documentation to be extremely easy to follow, and the Rust compiler gives amazingly helpful error messages often with enough guidance to fix the problem without needing to do any research. I haven’t tried Go myself, but even if it’s “easier” to learn than Rust, that wouldn’t be a factor for me since Rust has been easy enough to learn that the learning curve has never been a blocker for me.

At a glance from looking at Go, the most obvious advantage that Rust has over Go is that Rust does not do runtime garbage collection, meaning the performance of Rust-compiled code should be closer to C++ while the performance of Go-compiled code should be closer to Java. There may be many applications where that doesn’t matter, but robotics is often striving to have deterministic performance in resource constrained environments, so that immediately makes Rust more appealing than Go.

I’ll reiterate that I’ve never used Go, so I don’t know if I’m making a fair comparison, but some other things I really like about Rust is the way variants are first-class citizens of the language and pattern matching is built into the language syntax in an amazingly ergonomic way. It doesn’t look to me like Go offers that convenience. Variants and pattern matching are extremely helpful for defining state machines, and state machines are a mainstay of robotic systems programming.

---

<div class="post-metadata">

**Author:** ![bkolligs](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/bkolligs/32/16636_2.png) [@bkolligs](https://discourse.openrobotics.org/u/bkolligs)\
**Post date:** [March 18, 2023, 8:10pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/12 "2023-03-18T20:10:21Z")

</div>

Any updates on the status here? I’d love to see Rust included as a third LTS supported language for ROS.

---

<div class="post-metadata">

**Author:** ![jhdcs](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/jhdcs/32/8074_2.png) [@jhdcs](https://discourse.openrobotics.org/u/jhdcs)\
**Post date:** [March 20, 2023, 1:11pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/13 "2023-03-20T13:11:08Z")

</div>

We are currently working on adding in lifecycle nodes, actions, and parameters to ROS 2 Rust. Additionally, we intend to start up regular meetings in the near future, so that the community can come and ask questions, as well as coordinate our efforts in bringing the client library up to speed.

---

<div class="post-metadata">

**Author:** ![Immanuel\_Jzv](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/immanuel_jzv/32/14100_2.png) [@Immanuel\_Jzv](https://discourse.openrobotics.org/u/Immanuel_Jzv)\
**Post date:** [July 13, 2023, 11:23am UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/14 "2023-07-13T11:23:02Z")

</div>

Hey how is this wonderful project coming , Thank You to all the devs working on this part-time/full-time.  
😄  
Waiting eagerly for ros2-rust to be shipped with standard distro

---

<div class="post-metadata">

**Author:** ![Immanuel\_Jzv](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/immanuel_jzv/32/14100_2.png) [@Immanuel\_Jzv](https://discourse.openrobotics.org/u/Immanuel_Jzv)\
**Post date:** [February 29, 2024, 4:20pm UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/15 "2024-02-29T16:20:00Z")

</div>

[https://www.whitehouse.gov/wp-content/uploads/2024/02/Final-ONCD-Technical-Report.pdf](https://www.whitehouse.gov/wp-content/uploads/2024/02/Final-ONCD-Technical-Report.pdf)

The US Government released a detailed [article](https://www.whitehouse.gov/oncd/briefing-room/2024/02/26/press-release-technical-report/) outlining the NEED for a memory safe language in cyber-security and mission-critical software. In doing so, they mention RUST.

[Ferrocene](https://ferrous-systems.com/ferrocene/) an industrial standard compliant compiler.

For those who don’t want to read the long article by the US Gov, here is a [video](https://www.youtube.com/watch?v=T4ZUMvALdKI) by LowLevelLearning, a Cybersecurity Researcher.

---

<div class="post-metadata">

**Author:** ![Immanuel\_Jzv](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/immanuel_jzv/32/14100_2.png) [@Immanuel\_Jzv](https://discourse.openrobotics.org/u/Immanuel_Jzv)\
**Post date:** [June 13, 2024, 8:31am UTC](https://discourse.openrobotics.org/t/rust-and-robotics/23344/16 "2024-06-13T08:31:01Z")

</div>

Just an important update of Rust in Robotics.

A fully stable library for a wide range of microcontrollers uses async + embedded rust.

> **[Embassy](https://embassy.dev/)**
>
> The next-generation framework for embedded applications. Write safe, correct and energy-efficient embedded code faster, using the Rust programming language, its async facilities, and the Embassy libraries.

[![](https://us1.discourse-cdn.com/flex022/uploads/ros/original/3X/b/6/b64683cf946804ea1aa083c05c70879fb68ac35e.jpeg "Rust: Embedded, Async, All the Way") ](https://www.youtube.com/watch?v=NeMYLJHxESg)

There are other embedded rust libraries as well, but this seemed particularly interesting as it seemed most finished and was async.

[Full List Of Embedded Libraries On RUST](https://arewertosyet.com)
