HighStakes-936B is a robotics project utilizing the PROS library and lemlib for advanced chassis control, odometry, and subsystem management. This repository contains code for motor and sensor initialization, chassis configuration, and modular subsystems for movement and autonomous routines. The project uses the Vex-Autonomous-Selector for autonomous routine selection.
- Features
- Installation
- Usage
- Code Structure
- Subsystems Overview
- Adding New Subsystems
- Autonomous Selection
- Contributing
- License
- Contact
- Modular motor and sensor initialization
- Advanced chassis control with lemlib
- Odometry with tracking wheels and IMU
- Subsystem-based architecture for movement and autonomous routines
- Easy-to-extend for new subsystems
- Interactive autonomous routine selector using LVGL
- Pure Pursuit path following with lemlib
- Clone the repository:
git clone https://github.com/yourusername/HighStakes-936B.git cd HighStakes-936B
- Install PROS CLI: PROS Installation Guide
- Install dependencies:
- Ensure lemlib is included in your project (see lemlib documentation)
- Install the Vex-Autonomous-Selector:
prosv5 c fetch autoSelect@2.1.4.zip prosv5 c apply autoSelect
- Open the project in PROS Editor or your preferred IDE.
- Build and upload to your VEX V5 Brain:
pros make pros upload
- Modify
src/globals.cpp
to adjust motor ports, gear settings, or subsystem parameters as needed.
HighStakes-936B/
├── include/ # Header files
├── src/ # Source files
│ ├── globals.cpp # Global motor, sensor, and subsystem initialization
│ ├── subsystems/ # Subsystem implementations
│ └── auton/ # Autonomous routines
├── README.md # Project documentation
└── ...
pros::Motor leftFrontMotor(LEFT_MOTOR_1, pros::E_MOTOR_GEAR_BLUE);
pros::Motor leftMiddleMotor(-LEFT_MOTOR_3, pros::E_MOTOR_GEAR_BLUE);
pros::Motor leftBackMotor(LEFT_MOTOR_2, pros::E_MOTOR_GEAR_BLUE);
pros::MotorGroup leftMotors({leftFrontMotor, leftMiddleMotor, leftBackMotor});
pros::Rotation horizontalEncoder(HORIZONTAL_ENCODER_PORT);
pros::Imu imu(IMU_PORT);
- Movement: Handles chassis movement and path following using lemlib.
- Auton: Manages autonomous routines.
- Selector: Allows selection of autonomous routines.
subsystems::Movement movement(&chassis);
subsystems::Auton auton(&chassis);
subsystems::Selector selector(&auton);
To add a new subsystem:
-
Create a new header file in
include/subsystems/
:// include/subsystems/NewSubsystem.h #pragma once #include "api.h" namespace subsystems { class NewSubsystem { public: NewSubsystem(/* constructor parameters */); void init(); void update(); private: // subsystem-specific members }; }
-
Create the implementation in
src/subsystems/
:// src/subsystems/NewSubsystem.cpp #include "subsystems/NewSubsystem.h" namespace subsystems { NewSubsystem::NewSubsystem(/* parameters */) { // initialization } void NewSubsystem::init() { // setup code } void NewSubsystem::update() { // periodic update code } }
-
Add the subsystem to
globals.cpp
:subsystems::NewSubsystem newSubsystem(/* parameters */);
The project uses the Vex-Autonomous-Selector for autonomous routine selection. The selector provides a user-friendly interface on the V5 Brain's screen.
In selection.h
:
#define HUE 360 // Theme color (0-360)
#define AUTONS "Do Nothing", "Front", "Back" // Autonomous routine names
#define DEFAULT 1 // Default selected routine
-
Include the selector in your main file:
#include "autoSelect/selection.h"
-
Initialize in
initialize()
:void initialize() { selector::init(); }
-
Use in autonomous:
void autonomous() { switch(selector::auton) { case 1: // Red Front // Run front red autonomous break; case 2: // Red Back // Run back red autonomous break; // Add more cases as needed } }
Contributions are welcome! Please open issues or submit pull requests for improvements or bug fixes. Follow best practices for code documentation and formatting.
This project is licensed under the MIT License. See LICENSE for details.
For questions or support, open an issue or contact the maintainer at your.email@example.com.