1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! # Antaeus
//!
//! Antaeus is a versatile robotics framework built on top of [Vexide](https://vexide.dev).
//! It provides a comprehensive set of tools for VEX V5 robot programming, including:
//!
//! - **Drivetrain Control**: Support for differential drivetrains with tank, arcade, and
//! reverse control schemes.
//! - **Motion Control**: PID-based movement systems, odometry tracking, and path following
//! using the Candidate-Based Pursuit algorithm.
//! - **Display Graphics**: An [`embedded-graphics`](https://crates.io/crates/embedded-graphics)
//! compatible driver for the V5 Brain display, with pre-loaded fonts and logo rendering.
//! - **Operator Control**: Utilities for mapping controller buttons to motors and ADI devices.
//! - **Logging**: A file-based logger for debugging and telemetry.
//!
//! ## Quick Start
//!
//! ```ignore
//! use antaeus::peripherals::drivetrain::Differential;
//! use vexide::prelude::*;
//!
//! #[vexide::main]
//! async fn main(peripherals: Peripherals) {
//! let drivetrain = Differential::new(
//! [
//! Motor::new(peripherals.port_1, Gearset::Green, Direction::Forward),
//! Motor::new(peripherals.port_2, Gearset::Green, Direction::Forward),
//! ],
//! [
//! Motor::new(peripherals.port_3, Gearset::Green, Direction::Reverse),
//! Motor::new(peripherals.port_4, Gearset::Green, Direction::Reverse),
//! ],
//! );
//!
//! let controller = Controller::new(ControllerId::Primary);
//! loop {
//! drivetrain.tank(&controller);
//! }
//! }
//! ```
//!
//! ## Modules
//!
//! - [`peripherals::drivetrain`]: Differential drivetrain control with multiple drive modes.
//! - [`motion`]: Autonomous motion algorithms including PID, localization, and pursuit.
//! - [`display`]: V5 Brain display graphics using `embedded-graphics`.
//! - [`peripherals`]: Controller input mapping to motors, pneumatics, and sensors.
//! - [`fs`]: Filesystem utilities including logging.
use ;
use Mutex;
/// Autonomous motion control module.
///
/// Provides algorithms for precise robot movement during autonomous periods:
///
/// - **PID Control**: Proportional-Integral-Derivative controllers for linear
/// and rotational movement.
/// - **Odometry**: Position tracking using tracking wheels and an inertial sensor.
/// - **Pursuit**: Path following using the Candidate-Based Pursuit algorithm,
/// a robust variant of pure pursuit.
/// Operator control utilities module.
///
/// Simplifies controller input handling during driver control periods.
/// Maps controller buttons to motor voltages and ADI digital outputs
/// with support for toggle, momentary, and dual-button controls.
/// V5 Brain display graphics module.
///
/// Provides an [`embedded-graphics`](https://crates.io/crates/embedded-graphics)
/// compatible [`DrawTarget`](embedded_graphics_core::draw_target::DrawTarget)
/// for rendering graphics on the V5 Brain display. Includes:
///
/// - Pre-loaded TTF fonts for text rendering.
/// - Antaeus logo and badge display utilities.
/// Miscellaneous utilities module.
/// File-based logging for the V5 Brain.
///
/// Provides a logger implementation that writes to both the console
/// and a file on the SD card.
/// Makes an object clonable by wrapping it in `Rc` and `RefCell`
/// Turns a object into a mutex