This commit is contained in:
ary 2023-10-18 00:30:28 -04:00
parent 445c9dcf35
commit 1f3e2bb685
3 changed files with 29 additions and 46 deletions

View File

@ -22,7 +22,7 @@ namespace ary {
/**
* Prints our branding all over your pros terminal
*/
void print_ez_template();
void printScr();
/**
* Prints to the brain screen in one string. Splits input between lines with

View File

@ -11,7 +11,7 @@ pros::Controller master(pros::E_CONTROLLER_MASTER);
namespace ary {
int mode = DISABLE;
void print_ez_template() {
void printScr() {
std::cout << R"(

View File

@ -1,3 +1,9 @@
/*
main.cpp
The entry point for the bot
*/
#include "main.h"
#include "wings.h"
@ -13,17 +19,27 @@ e_controlsch currentuser = RENU;
* to keep execution time for this mode under a few seconds.
*/
void initialize() {
ary::print_ez_template();
ary::printScr();
pros::delay(500); // legacy ports configure
pros::delay(500); // Give time for legacy ports configure
/*
Construct the chassis and it's constants
chassisInit() -> Adjusts drive curves, active brake constants, among other things
configureConstants() -> Sets PID constants on the chassis
configureExitConditions() -> Sets default values for PID Exit conditions
*/
chassisInit();
configureConstants();
configureExitConditions();
/*
Add autonomous paths to the auto selection
*/
ary::autonselector::auton_selector.add_autons({
Auton("Near side (close to alliance goal) \n\nTo run when near alliance goal", near_side), // TODO: Change this before putting this in the notebook LOL
Auton("Far side (far from alliance goal) \n\nTo run hwhen far from alliance goal", far_side)
Auton("Near side (close to alliance goal) \n\nTo run when near alliance goal", near_side),
Auton("Far side (far from alliance goal) \n\nTo run when far from alliance goal", far_side)
});
motorsCoast(); // Allow the motors to coast initially
@ -32,57 +48,24 @@ void initialize() {
ary::autonselector::initialize();
}
/**
* Runs while the robot is in the disabled state of Field Management System or
* the VEX Competition Switch, following either autonomous or opcontrol. When
* the robot is enabled, this task will exit.
*/
void disabled() {}
/**
* Runs after initialize(), and before autonomous when connected to the Field
* Management System or the VEX Competition Switch. This is intended for
* competition-specific initialization routines, such as an autonomous selector
* on the LCD.
*
* This task will exit when the robot is enabled and autonomous or opcontrol
* starts.
*/
void competition_initialize() {}
/**
* Runs the user autonomous code. This function will be started in its own task
* with the default priority and stack size whenever the robot is enabled via
* the Field Management System or the VEX Competition Switch in the autonomous
* mode. Alternatively, this function may be called in initialize or opcontrol
* for non-competition testing purposes.
*
* If the robot is disabled or communications is lost, the autonomous task
* will be stopped. Re-enabling the robot will restart the task, not re-start it
* from where it left off.
*/
void autonomous() {
autonomousResets();
ary::autonselector::auton_selector.call_selected_auton();
}
/**
* Runs the operator control code. This function will be started in its own task
* with the default priority and stack size whenever the robot is enabled via
* the Field Management System or the VEX Competition Switch in the operator
* control mode.
*
* If no competition control is connected, this function will run immediately
* following initialize().
*
* If the robot is disabled or communications is lost, the
* operator control task will be stopped. Re-enabling the robot will restart the
* task, not resume it from where it left off.
*/
void opcontrol() {
opControlInit();
opControlInit(); // Configure the chassis for driver control
while (true) {
/*
Handle controls for whoever is driving the bot at the moment, each available user a respective set of controls'
Available Options:
RENU, RIA, CHRIS
*/
if (currentuser == RENU) {
chassis.tank_control();
renu_control();