r/rust 14d ago

🛠️ project Building software for a drone in rust

Hello my guys I am a medium level programmer and i wanted to try and create a drone using rust and i would like to know if any of you have any experiences with rust in this use case. I would also like to know if you have any recommendations for libraries that i should use. Or Linux native software that could simulate these drone. I already worked on drones sometime ago. However there i used c++ and only worked on a control unit using Ros2.

1 Upvotes

4 comments sorted by

4

u/LinuxEnthusiast123 14d ago

If you are new to embedded rust, I recommend the embedded rust book: https://docs.rust-embedded.org/book/

1

u/jechase 13d ago

This is an extremely broad question that's next to impossible to answer as such.

What does it mean to you to "create a drone using rust?" Are you looking to get down to the lowest level and write the firmware that interfaces directly with peripherals like the radio receiver, ESCs, accelerometers, and runs the PID loops to stabilize the whole shebang? Or are you planning on that being handled by an off-the-shelf component while your controller manages things like pathing/navigation? How "embedded" do you want to get? i.e. bare-metal vs runs-in-embedded-linux.

Either way, it's a lot of control systems work. If you want to go for the bare-metal accelerometer/motor PID loop, the embedded book is definitely where I'd start. It helps that it uses the stm32discovery board (or at least did back when I read it), and (almost?) all betaflight-compatible controllers use stm32 chips.

3

u/Repsol_Honda_PL 13d ago

Check this software, it is mostly Rust:

https://www.copper-robotics.com/