tl;dr I want to use Rust to program robots. Help me find the best core libraries to build on.
Robotic systems require high performance and reliability, but also have enormous complexity in terms of algorithms employed, number of subsystems, embedded hardware control, and other metrics. Development is mostly split between C++ for performance and safety critical components, and MatLab or Python for quick research or task iteration.
Rust is a strong/statically typed systems-level language designed with safety, performance, and expressiveness in mind. Given the nature of robotics development, I believe Rust to be the perfect fit for both research and product grade development. However, there are many high quality, fundamental libraries in C++ (as well as Python and MatLab) that must exist before serious robotics-focused libraries are possible.
I can write robotics libraries and systems, but I cannot rebuild the universe from scratch. With this article I hope to draw on the fabulous Rust community to help in determining the current state-of-the-art in several areas of Rust. In particular, robotics development overlaps with game and embedded development, so I am hopeful there will be many sources to draw from.
Please comment with your input and I will keep this article updated with all your suggestions.
Libraries that of use to many development practices.
These libraries need to be fast, as all other systems will be built on top of them.
Top contenders:
- nalgebra
- Best option for general (low-dimension) linear algebra
- Extension to at least 7D would enhance usefulness
- RustAlgebloat
- petgraph
- Data structures and algorithms
Others to consider:
Non-starters:
- vecmath
- No linear algebra or quaternions
The critical consideration here is flexibility. How much control do the simulations allow, and how many kinds of meshes and objects are supported. But again, the faster the better.
Top contenders:
This is an active area of research, but having a usable and reasonably quick starting point would help with bootstrapping some other libraries and applications.
Most robotics systems are distributed, even if only very local embedded systems. A highly reliable pub/sub and RPC style communication system is the usual solution.
Rendering robot state and simulation models is incredibly valuable in development, demonstration, and field usage. Graphics libraries need to handle model rendering well (read "correctly support standards"), be viably fast, and preferably cross-platform. A simple/user-friendly API is an important "extra," as many of us are not graphics specialists. Cross-platform input handling would be nice.
High-level libraries:
- gfx
- rust-sdl2
- piston2d-graphics
- 2D only
rust-sfml
Utility/core libraries:
For tool and UI creation.
Most of these don't exist yet! But that shouldn't stop us. Included are ideas for C/C++ libraries to wrap.
Libraries to wrap or replicate:
- OpenCV
- Already has C API wrapping C++ implementation
- Point Cloud Library
- No C bindings
C++ Libraries:
- OMPL
- Will probably need to be re-implemented, as I'm not sure how compatible interface/implementation style will be with Rust
- A controls helper library will need to be written in pure Rust.
- standard control algorithms
- task-based control framework (TODO explain this better when I have time)
- Common communication protocols will need implemented or wrapped
- CANBus
- Ethernet (UDP in std::net for non-embedded)
- EtherCAT
Piston has separate libraries for quaterions, in addition to
vecmath
: https://github.com/PistonDevelopers/quaternion, https://github.com/PistonDevelopers/dual_quaternionAlso, for collision detection there is https://github.com/csherratt/collision-rs