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
//! Robot drivetrain configurations.
//!
//! This crate provides types for describing and modeling different mobile robot drivetrain
//! configurations. A *drivetrain* in evian is the combination of hardware components (e.g. motors,
//! wheels, and sensors) that enables a robot to both *move* and *track its motion*. This importantly
//! means that drivetrains are a collection of **both** motors and sensors.
//!
//! At the heart of this crate is the [`Drivetrain`] struct, which bundles together some motors and a
//! *tracking system* — a system that measures something about the drivetrain as it moves around.
//! The [`Drivetrain`] type could represent many different types of robot drivetrains depending on how
//! the motor and tracking logic is implemented.
//!
//! # Supported Configurations
//!
//! At the moment, this crate currently provides built-in support for [differential drivetrains],
//! however the [`Drivetrain`] struct could in theory be configured to accept any arrangement of motors
//! with your own custom type if you require something else.
//!
//! [differential drivetrains]: crate::differential
extern crate alloc;
/// A mobile robot drivetrain capable of measuring data about itself.
/// Creates a shared motor array.
///
/// This macro simplifies the creation of an `Rc<RefCell<[Motor; N]>>` array, which is a shareable
/// wrapper around vexide's non-copyable [`Motor`](vexide::devices::smart::motor::Motor) struct.
///
/// # Examples
///
/// ```
/// let motors = shared_motors![motor1, motor2, motor3];
/// ```