Software Architecture
The software architecture of the motor controller is structured into three main levels, each focusing on different aspects of interaction with the motor controller and the connected hardware:
-
Hardware Level: This level includes a set of commands that interact directly with the hardware components connected to the motor controller. These commands cover motor control, encoder readings, and GPIO operations, allowing for precise control and monitoring of the physical hardware. The key components at this level are:
- Motor Commands: Initialize, control, and monitor individual motors.
- Encoder Commands: Initialize encoders, read their values, and manage odometry.
- GPIO Commands: Manage the state and configuration of general-purpose input/output pins.
-
Controller Level: At this level, the focus is on interacting with the motor controller's logic to manage motor velocities and read current motor states. This level is critical for tasks that require precise control over motor performance and feedback. The key components at this level are:
- Velocity Motor Controller: Commands for setting and reading motor target speeds and states.
- Motor Odometry: Commands for starting, stopping, and resetting odometry calculations related to individual motors.
-
Platform Level: This level provides commands for higher-level control over entire platforms, such as differential drive, omni, or mecanum platforms. It allows the initialization and management of complex movement strategies, as well as reading platform-wide odometry and velocities. The key components at this level are:
- Platform Controller: Commands for initializing and controlling platforms in different drive modes.
- Platform Odometry: Commands for calculating and retrieving the odometry of the entire platform, which is essential for navigation and positioning in autonomous systems.
Below is a diagram representing the software architecture of the motor controller:

This structured approach ensures that each level of the architecture can be managed independently, providing flexibility and clarity in how different parts of the system interact, from direct hardware manipulation to complex platform-level control.