-
Notifications
You must be signed in to change notification settings - Fork 5
Project overview
The goal of this project is to write firmware for our robots. "Firmware" in this case means the code that is run directly on the microprocessors (MCUs) inside our bots. This means we will be working at a low level, close to hardware. There is no operating system the firmware runs on, so our code has full control over the MCU, and we must handle all IO processing and concurrency. The code is primarily written in C++, although a small amount of Python is used to automate build processes.
The platform we target is the RoboMaster Development Board Type C. It has various useful components including:
- STM32F407IGH6 ARM Cortex-M4 32-bit MCU
- BMI088 IMU (combined accelerometer and gyroscope)
- Two CAN interfaces; these are used for communication with motors.
- Two UART interfaces; these communicate with the Referee System and computer-vision (CV) boards.
Our project is built around two important libraries:
- Taproot: A control library and framework for RoboMaster robot firmware, developed primarily by ARUW. It provides the framework around which we implement features. The library includes a scheduler, abstractions for commands and subsystems, RoboMaster-specific hardware drivers, and much more.
- modm: A library generator for ARM Cortex-M devices. It provides a ton of important boilerplate code, including hardware abstraction layers (HALs) for common chips, drivers for interfacing with hardware, communication protocols like CAN and UART, etc.
The primary folder we'll be working in is ut-robomaster/src/
. There, you'll find the following folders and files:
Name | Description |
---|---|
communication/ |
Communication between the MCU and various other components like CV boards. |
drivers/ |
Custom drivers for hardware components which aren't covered by modm or Taproot. |
robots/ |
Constants and configuration for specific robots. |
subsystems/ |
Logic for the major components (subsystems) of the robots. These include chassis (wheels), turret (yaw and pitch), flywheels (firing projectiles), and agitator (feeding projectiles) |
utils/ |
Various utility functions and classes used by other parts of the code. |
drivers.hpp |
The Drivers class contains references to important hardware drivers which are used all over the code. It is inherited from tap::Drivers and thus includes common drivers provided by Taproot, in addition to our own. |
main.cpp |
This is the starting point of the code. Hardware is initialized, IO is processed, and the command scheduler is run in a loop. |