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
//! Operator control utilities for driver control periods.
//!
//! This module simplifies mapping controller inputs to robot actions
//! during the driver-controlled portion of a match.
//!
//! # Features
//!
//! - **Button-to-ADI mapping**: Control pneumatics with button presses.
//! - **Button-to-Motor mapping**: Control mechanisms with button holds.
//! - **Control button modifiers**: Combine buttons for extended controls.
//!
//! # Example
//!
//! ```ignore
//! use antaeus::peripherals::controller::{ControllerControl, ControllerButton};
//!
//! let controller = Controller::new(ControllerId::Primary);
//! let control = ControllerControl::new(&controller, ControllerButton::ButtonA);
//!
//! // Button B toggles a piston
//! control.button_to_adi_toggle(
//! ControllerButton::ButtonB,
//! vec![&mut piston],
//! false,
//! );
//!
//! // L1 runs intake forward, L2 runs it backward
//! control.dual_button_to_motors(
//! ControllerButton::ButtonL1,
//! ControllerButton::ButtonL2,
//! vec![&mut intake],
//! 12.0, -12.0, 0.0, false,
//! );
//! ```
/// Legacy Controller input mapping utilities.
///
/// Provides [`ControllerControl`](controller::ControllerControl) for
/// mapping buttons to motors and ADI devices.
/// Differential drivetrain control module.
///
/// Provides the [`Differential`](drivetrain::Differential) struct for controlling
/// robots with left and right motor groups. Supports multiple control schemes:
///
/// - **Tank**: Each joystick controls one side of the robot.
/// - **Arcade**: Left stick for forward/backward, right stick for turning.
/// - **Reverse**: Inverted controls for driving in reverse.