A reactive runtime for embedded systems.

Related tags

Utilities actuate
Overview

Actuate

Crates.io version docs.rs docs CI status

A reactive diagram for robotics and control systems. Actuate leverages Rust's type system to create an efficient diagram that connects your application's systems. It can then render that diagram to a mermaid graph.

This crate provides a library that can run on embedded systems with #![no_std].

Example

graph TD
  Input[Input] --> |"app::TargetState"| A
  Input[Input] --> |"app::State"| A

  Input[Input] --> |"Time"| A
  Input[Input] --> |"Time"| C
  
  A["app::state_pid_controller"]
  A --> |"app::State"| B
  A --> |"app::State"| C
  B["app::debugger"]
  C["app::pendulum_output"]
  C --> |"app::State"| A
use actuate::{
    control::PidController,
    plant::PendulumPlant,
    time::{Time, TimePlugin},
    Diagram,
};

struct State(f64);

struct TargetState(f64);

#[derive(Default)]
struct StatePidController(PidController);

#[derive(Default)]
struct ExamplePendulumPlant(PendulumPlant);

fn state_pid_controller(
    State(state): &mut State,
    TargetState(target): &TargetState,
    Time(time): &Time,
    StatePidController(pid): &mut StatePidController,
) {
    pid.control(*time, state, target)
}

fn pendulum_plant(
    Time(time): &Time,
    State(state): &State,
    ExamplePendulumPlant(pendulum): &mut ExamplePendulumPlant,
) {
    pendulum.update(*time, *state)
}

fn debugger(State(state): &State) {
    dbg!(state);
}

fn main() {
    let diagram = Diagram::builder()
        .add_plugin(TimePlugin)
        .add_input(State(1.))
        .add_input(TargetState(5.))
        .add_state(StatePidController::default())
        .add_state(ExamplePendulumPlant::default())
        .add_system(state_pid_controller)
        .add_system(pendulum_plant)
        .add_system(debugger)
        .build();

    println!("{}", diagram.visualize());
}

How it works

Actuate connects systems together by their inputs and outputs. A system taking &T as a parameter will be linked to another system taking &mut T.

Output: &mut T -> Input: &T

Installation

On a device with std support:

cargo add actuate

In a #![no_std] enviornment:

cargo add actuate --no-default-features

Inspiration

This crate is inspired by Drake and aims to provide a similar model of connecting systems together to form a complete diagram of your program. Similar to Bevy, Actuate uses function parameter types to connect systems. In contrast to the ECS pattern, however, this crate requires each type be unique per Diagram.

You might also like...
diff successive buffers with embedded ansi codes in rust, outputting a minimal change

ansi-diff diff successive buffers with embedded ansi codes in rust, outputting a minimal change You can use this crate to build command-line interface

TI LDC1312/LDC1314/LDC1612/LDC1614 inductance-to-digital converter driver for Rust embedded-hal

ldc1x1x Rust embedded-hal 1.x driver for Texas Instruments (TI) I²C inductance-to-digital converters (LDC): LDC1312/LDC1314, LDC1612/LDC1614. Includes

Ector is an open source async, no-alloc actor framework for embedded devices

Ector is an open source async, no-alloc actor framework for embedded devices. Ector is an open source async, no-alloc actor framework for embedded dev

An embedded-hal driver for the TT21100 multi-touch touchscreen controller

tt21100 An embedded-hal driver for the TT21100 multi-touch touchscreen controller. If there is a feature which has not yet been implemented and which

Embedded-hal simulator.

hal-sim - embedded-hal Simulator (WIP - UNFINISHED) This crate simulates a small portion of the embedded-hal traits. Namely: GPIO ADC Additionally, it

Port of the fantastic Iconoir Icon Pack to Rust embedded devices, with a focus on speed, usability, and completeness.
Port of the fantastic Iconoir Icon Pack to Rust embedded devices, with a focus on speed, usability, and completeness.

embedded-iconoir - Icons for every device, ever. What is embedded-iconor? embedded-iconoir is a library that allows you to use Iconoir on embedded dev

Drop-in embedded database
Drop-in embedded database

Struct DB 🔧 🔩 Provides a drop-in, fast, and embedded database solution, focusing on maintaining coherence between Rust types and stored data with mi

Runtime dependency injection in Rust

This library provides an easy to use dependency injection container with a focus on ergonomics and configurability at the cost of runtime performance. For a more performance-oriented container, look for a compile-time dependency injection library.

microtemplate - A fast, microscopic helper crate for runtime string interpolation.

microtemplate A fast, microscopic helper crate for runtime string interpolation. Design Goals Very lightweight: I want microtemplate to do exactly one

Owner
null
Freebsd-embedded-hal - Like linux-embedded-hal but FreeBSD

freebsd-embedded-hal Implementation of embedded-hal traits for FreeBSD devices: gpio: using libgpio, with stateful and toggleable support, with suppor

null 2 Oct 1, 2022
A reactive DOM library for Rust in WASM

maple A VDOM-less web library with fine-grained reactivity. Getting started The recommended build tool is Trunk. Start by adding maple-core to your Ca

Luke Chu 1.8k Jan 3, 2023
Auto Fan Management Utility in Linux Systems for Monster Laptops

Auto Fan Management Utility in Linux Systems for Monster Laptops Monster Laptoplar için Linux Sistemlerde Oto Fan Yönetimi TR Monster laptoplar gömülü

null 2 Aug 22, 2022
Artifact collection tool for *nix systems

fennec is an artifact collection tool written in Rust to be used during incident response on *nix based systems. fennec allows you to write a configuration file that contains how to collect artifacts.

AbdulRhman Alfaifi 147 Dec 19, 2022
A simple to use rust package to generate or parse Twitter snowflake IDs,generate time sortable 64 bits unique ids for distributed systems

A simple to use rust package to generate or parse Twitter snowflake IDs,generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)

houseme 5 Oct 6, 2022
Concrete is a simple programming language specifically crafted for creating highly scalable systems that are reliable, efficient, and easy to maintain.

The Concrete Programming Language Most ideas come from previous ideas - Alan C. Kay, The Early History Of Smalltalk In the realm of low-level programm

Lambdaclass 126 Nov 22, 2024
Crate of GitHub’s collection of gitignores, embedded, automatically updated

Gitignores GitHub’s collection of gitignores, embedded, automatically updated. API documentation. Public Domain via CC0-1.0 (same as source data). MSR

null 3 May 3, 2022
C API to SpringQL (for embedded mode)

SpringQL C Client This repository is a C client for SpringQL and provides it provides: springql.h: C header file. libspringql_client.{so,dylib}: Share

SpringQL 4 Jun 8, 2022
A compatibility layer to smooth the transition between different versions of embedded-hal

Embedded HAL Compatibility Layer A compatibility layer to smooth the transition between different versions of embedded-hal (specifically 0.2.x and 1.0

Ryan 7 Sep 11, 2022
⚙️ Crate to discover embedded programming with uno r3 project

⚙️ Crate to discover embedded programming with uno r3 project

null 0 Feb 3, 2022