Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save newcanopies/f1e80d0f6e7f4e046222e57bc8c4291f to your computer and use it in GitHub Desktop.
Save newcanopies/f1e80d0f6e7f4e046222e57bc8c4291f to your computer and use it in GitHub Desktop.
Rust Libraries for Robotics

Motivation

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.

General Libraries

Libraries that of use to many development practices.

Mathematics

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

Simulation

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:

Collision Detection

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.

Distributed Systems

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.

Graphics (2D and 3D)

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:

Utility/core libraries:

GUI

For tool and UI creation.

Robotics Libraries

Most of these don't exist yet! But that shouldn't stop us. Included are ideas for C/C++ libraries to wrap.

Computer Vision

Libraries to wrap or replicate:

Rigid Body Kinematics and Dynamics

C++ Libraries:

  • DART
    • Used by our research lab
    • Very large API, so would be very difficult to wrap by hand
  • RBDL

Planning

  • OMPL
    • Will probably need to be re-implemented, as I'm not sure how compatible interface/implementation style will be with Rust

Control

  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment