5 ms·
Is anyone working on flight controllers in Rust? Now that the STM targets are maturing it seems like a perfect target. I can only find stub projects and blog po
by bri3d 8y ago
Is anyone working on flight controllers in Rust? Now that the STM targets are maturing it seems like a perfect target. I can only find stub projects and blog posts right now.
- Varcht 8y agoI've been on sabbatical for a while but a while back it was pretty much C, C or C.
- copterust 8y agothere is https://github.com/copterust/ https://github.com/copterust/, it's somewhat flying, but still a lot of work. we're in process of porting f3-eva repo to rtfm, so a lot of things are different now, and we have to rethink and reimplement a lot. we also working on writing drivers and supporting libs as we need them: we've implemented drivers for accelerometers, magnetrometers, pressure sensor, tof sensor, and ported dcmimu algorithm to rust.
- bri3d 8y agoThis is amazing and exactly what I was looking for, thank you! I had trouble finding it because I was searching for "quadcopter" and not "quadrocopter," I think.
- blt 8y agoA low level flight controller needs only statically allocated memory, so one of the main benefits of Rust is irrelevant. The syntax is still nice though.
- StavrosK 8y agoAnd the much more stringent error checking, as I don't want a null pointer making my quad mow people down.
- bluejekyll 8y ago> so one of the main benefits of Rust is irrelevant Not sure what you mean with this comment. Even in a context like this, Rust has a lot of safety benefits, but yes you don't have access to the stdlib, and are restricted to core.
- perennate 8y agoI think parent meant "one of the main benefits" = safety not as useful because anyway no dynamic allocations are needed to implement a basic flight control algorithm.
- bluejekyll 8y agoIt also helps with other references, shared mutability, UB, etc. Allocation and deallocation focuses on small sliver of safety, but yes, That’s not a concern in that context.
- vvillena 8y agoThere was a comment in another thread that talked about the benefits of using the ownership mechanism to control access to all the I/O. It's possible that Rust is useful to manage not just memory, but all kinds of hardware resources.
- Matthias247 8y agoAs someone who has reviewed, debugged and fixed ton of issues in embedded code before, I strongly have to disagree. There are tons of memory issues that can also happen without dynamic allocations. Invalidated pointers to the stack are a prime example. Multithreading issues (on an RTOS) another one. And forgetting to release resources (e.g. a RTOS mutex lock) is yet another one.
- m-ou-se 8y agoYes! I'm founder of a start-up (about 10 employees now) that makes flight controllers for Drones, and all the software that runs on them is written in Rust. We don't use STM chips though. Since the way we do state estimation and fault tolerant control requires a lot of computational power, we settled on 64-bit ARM Cortex A series processors. Since there was nothing available that fit our requirements, we produce the hardware ourselves as well. When we started a bit more than two years ago, we started in C++, but have been slowly switching to Rust starting less than a year later. Now that everything is in Rust, our productivity went up a lot, together with the reliability of our systems (which is our main selling point). The thing we miss most from C++ is the Eigen library, but the alternatives in Rust are pretty okay, though less complete. We are adding features and optimizations to some of these libraries, which we'll publish open source in a few months probably.
- janywer 8y agoDo you have a website?
- m-ou-se 8y agoWe do, but it's very minimal for now: https://dronesforwork.nl/ https://dronesforwork.nl/ We'll be changing our company name in a few weeks, followed by the launch of a new website which should have a lot more information than the current one.
- drewm1980 8y agoMe and the company I am at are on the fence with Rust because the type system still can't do Eigen but probably will eventually. I worry all of the current array libraries for Rust will go obsolete in a year or ten and Rust will only then start building up a convincing ecosystem for numerical computing.
- steveklabnik 8y agoGetting const generics finished up is on this year’s roadmap.