Expand description
§RRTK: Rust Robotics ToolKit
A data flow-based robotics framework designed for embedded systems.
RRTK works almost entirely without std and alloc. It is not specific to any device or API,
but support is available though feature flags for libm and
micromath for extended float math.
§Feature Flags
alloc- Enable items requiring dynamic allocation through Rust’s builtinalloccrate.std- Enable items requiring the Rust standard library. Requiresallocfeature. Enabled by default.devices- Enable RRTK’s graph-based device system.libm- Uselibmfor float exponentiation whenstdis not available.micromath- Usemicromathfor float exponentiation whenstdandlibmare unavailable.internal_enhanced_float- Do not enable this yourself.
RRTK prefers std over libm and libm over micromath when multiple are
available.
Re-exports§
pub use dimensions::*;
Modules§
- compile_
time_ integer - RRTK’s compile-time integer system. This is basically a simpler version of Typenum. It is used for compile-time dimensional analysis.
- devices
- A graph-based system for tracking the rotational states of mechanical components throughout your robot.
- dimensions
- RRTK’s compile-time dimensional analysis system. This system is simpler than ones like
uom, but it serves a similar purpose: to protect users from dimension mismatch errors at compile time without runtime overhead. - error
- Error types used for a few things in RRTK.
- prelude
- Re-exports some of the most important RRTK items as well as all its extension traits.
- streams
- There are some special
Getters that hold otherGetters that they use as input for some form of data processing. These are called streams. - stulta
- “The stupid things” (Latin). These items really shouldn’t exist but currently must, mostly either due to language limitations or a desire to minimize external dependencies.
Macros§
- div
- Gets the resulting type from dividing values of two types. (Alias for
<$a as Div<$b>>::Output.) - mul
- Gets the resulting type from multiplying values of two types. (Alias for
<$a as Mul<$b>>::Output.)
Structs§
- Angular
State - A one-dimensional motion state with position, velocity, and acceleration.
- Constant
Getter - Getter for returning a constant value.
- Datum
- Holds a timestamp and something else, usually an
f32, aQuantity, or one of the state types. - Feeder
- Feeds the output of a
Getterinto aSettable. - Getter
From Chronology - As
Chronologytypes return values at times, we can ask them to return values at the current time or at the current time with a delta. This is the recommended way of followingMotionProfiles. - Linear
State - A one-dimensional motion state with position, velocity, and acceleration.
- Motion
Profile - A motion profile for getting from one state to another.
- None
Getter - Getter always returning
Ok(None). - PIDK
Values - Coefficients for a PID controller.
- Pointer
Dereferencer Updatable,Getter,Settable, andTimeGetterare passed throughBox,Rc<RefCell<T>>,Arc<RwLock<T>>, andArc<Mutex<T>>, but this cannot be done safely for references involving raw pointer dereferencing. This is a wrapper struct that provides this functionality for*mut T,*const RwLock<T>, and*const Mutex<T>. It’s constructor isunsafe fn, so this is considered sound.- Position
Derivative DependentPIDK Values - A set of PID k-values for controlling each position derivative.
- Time
Getter From Getter - Because
Getters always return a timestamp (as long as they don’t returnErr(_)orOk(None)), we can use this to treat them likeTimeGetters.
Enums§
- Angular
Command - A command for a motor to perform: go to a position, run at a velocity, or accelerate at a rate.
- Linear
Command - A command for a motor to perform: go to a position, run at a velocity, or accelerate at a rate.
- Motion
Profile Piece - Where you are in following a motion profile.
- Position
Derivative - A derivative of position: position, velocity, or acceleration.
Traits§
- Chronology
- An object that can return a value, like a
Getter, for a given time. UnlikeGetter,Chronologyis infallible. - Generic
Command - This trait allows one to write code generically over
LinearCommandandAngularCommand. Each of those has a corresponding method to each method of this trait without thegeneric_prefix. This is necessary because many of the implementations should be const fn and can’t be in a trait. Calling the direct methods (withoutgeneric_) is preferred where possible. - Generic
State - This trait allows one to write code generically over
LinearStateandAngularState. Each of those has a corresponding method to each method of this trait without thegeneric_prefix. This is necessary because many of the implementations should be const fn and can’t be in a trait. Calling the direct methods (withoutgeneric_) is preferred where possible. - Getter
- An object that can be updated and can return timestamped values. This is one of the most fundamental traits to RRTK.
- Nothing
OrError Ext - An extension trait for
NothingOrError. - Option
Datum Ext - Extension trait for
Option<Datum<T>>. - Output
Ext - Extension trait for
Output<T, E>, a type alias toResult<Option<Datum<T>>, E>. - Settable
- An object that can be updated and can be set to or given values, potentially erroring when this is done.
- Time
Getter - An object for getting the absolute time.
- Updatable
- An object that can be updated, potentially erroring when this is done. This is one of the most fundamental traits to RRTK.
Functions§
Type Aliases§
- Nothing
OrError - Returned when something may return either nothing or an error.
- Output
- A generic output type when something may return an error, nothing, or something with a
timestamp. The most common use for this is as the output of
Getter::get. - Time
Output - Returned from
TimeGetterobjects, which may return either a time or an error.