do more stuff on scrim bot
this is terrible, bad, terrible, and abominable code (it has odom implemented)
This commit is contained in:
parent
a392a03bcd
commit
f027da53a2
8
RELENTLESS-Lite/include/autons.hpp
Normal file
8
RELENTLESS-Lite/include/autons.hpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "arylib/drive/drive.hpp"
|
||||||
|
|
||||||
|
void test_auton();
|
||||||
|
|
||||||
|
void default_constants();
|
||||||
|
void exit_condition_defaults();
|
||||||
24
RELENTLESS-Lite/include/globals.hpp
Normal file
24
RELENTLESS-Lite/include/globals.hpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
#define TRACK_WIDTH 11.5;
|
||||||
|
|
||||||
|
namespace globals {
|
||||||
|
extern pros::Controller master;
|
||||||
|
|
||||||
|
extern pros::Motor motor_fl;
|
||||||
|
extern pros::Motor motor_ml;
|
||||||
|
extern pros::Motor motor_bl;
|
||||||
|
extern pros::Motor motor_fr;
|
||||||
|
extern pros::Motor motor_mr;
|
||||||
|
extern pros::Motor motor_br;
|
||||||
|
|
||||||
|
extern pros::Motor_Group left_drive;
|
||||||
|
extern pros::Motor_Group right_drive;
|
||||||
|
|
||||||
|
extern lemlib::Drivetrain_t chassis_odom;
|
||||||
|
extern Drive chassis;
|
||||||
|
|
||||||
|
extern pros::Rotation enc_left;
|
||||||
|
extern pros::Rotation enc_right;
|
||||||
|
extern pros::Rotation enc_theta;
|
||||||
|
}
|
||||||
3
RELENTLESS-Lite/include/superstructure.hpp
Normal file
3
RELENTLESS-Lite/include/superstructure.hpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
namespace superstruct {
|
||||||
|
|
||||||
|
}
|
||||||
46
RELENTLESS-Lite/src/autons.cpp
Normal file
46
RELENTLESS-Lite/src/autons.cpp
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
#include "globals.hpp"
|
||||||
|
#include "superstructure.hpp"
|
||||||
|
|
||||||
|
using namespace globals;
|
||||||
|
using namespace superstruct;
|
||||||
|
|
||||||
|
// **CONSTANTS** //
|
||||||
|
const int DRIVE_SPEED = 110;
|
||||||
|
const int TURN_SPEED = 90;
|
||||||
|
const int SWING_SPEED = 90;
|
||||||
|
|
||||||
|
void default_constants() {
|
||||||
|
chassis.set_slew_min_power(80, 80);
|
||||||
|
chassis.set_slew_distance(7, 7);
|
||||||
|
chassis.set_pid_constants(&chassis.headingPID, 11, 0, 20, 0);
|
||||||
|
chassis.set_pid_constants(&chassis.forward_drivePID, 0.45, 0, 5, 0);
|
||||||
|
chassis.set_pid_constants(&chassis.backward_drivePID, 0.45, 0, 5, 0);
|
||||||
|
chassis.set_pid_constants(&chassis.turnPID, 4, 0.003, 35, 15);
|
||||||
|
chassis.set_pid_constants(&chassis.swingPID, 6, 0, 40, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void exit_condition_defaults() {
|
||||||
|
chassis.set_exit_condition(chassis.turn_exit, 100, 3, 500, 7, 500, 500);
|
||||||
|
chassis.set_exit_condition(chassis.swing_exit, 100, 3, 500, 7, 500, 500);
|
||||||
|
chassis.set_exit_condition(chassis.drive_exit, 80, 50, 300, 150, 500, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ** other stufff** //
|
||||||
|
|
||||||
|
// ** AUTONS ** //
|
||||||
|
|
||||||
|
void test_auton() {
|
||||||
|
chassis.set_drive_pid(5, DRIVE_SPEED, false, true);
|
||||||
|
chassis.set_swing_pid(e_swing::LEFT_SWING, 50, TURN_SPEED);
|
||||||
|
chassis.set_drive_pid(36, DRIVE_SPEED, true, true);
|
||||||
|
chassis.wait_until(24);
|
||||||
|
/* RUN THE INTAKE */
|
||||||
|
pros::delay(500);
|
||||||
|
chassis.set_drive_pid(-2, DRIVE_SPEED, false, false);
|
||||||
|
chassis.set_turn_pid(130, TURN_SPEED);
|
||||||
|
|
||||||
|
//pros::task_t intakeTask(run_intake_for, (void*) malloc(sizeof(double)), TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "runIntakeFor");
|
||||||
|
}
|
||||||
43
RELENTLESS-Lite/src/globals.cpp
Normal file
43
RELENTLESS-Lite/src/globals.cpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#include "globals.hpp"
|
||||||
|
|
||||||
|
using namespace ary;
|
||||||
|
namespace globals {
|
||||||
|
// Chassis
|
||||||
|
pros::Controller master(CONTROLLER_MASTER);
|
||||||
|
|
||||||
|
pros::Motor motor_fl(4, MOTOR_GEARSET_6, true);
|
||||||
|
pros::Motor motor_ml(4, MOTOR_GEARSET_6, true);
|
||||||
|
pros::Motor motor_bl(4, MOTOR_GEARSET_6, true);
|
||||||
|
pros::Motor motor_fr(4, MOTOR_GEARSET_6, true);
|
||||||
|
pros::Motor motor_mr(4, MOTOR_GEARSET_6, true);
|
||||||
|
pros::Motor motor_br(4, MOTOR_GEARSET_6, true);
|
||||||
|
|
||||||
|
pros::Motor_Group left_drive({ motor_fl, motor_ml, motor_bl });
|
||||||
|
pros::Motor_Group right_drive({ motor_fr, motor_mr, motor_br });
|
||||||
|
|
||||||
|
lemlib::Drivetrain_t chassis_odom {
|
||||||
|
&left_drive,
|
||||||
|
&right_drive,
|
||||||
|
11.5,
|
||||||
|
2.75,
|
||||||
|
450
|
||||||
|
};
|
||||||
|
|
||||||
|
Drive chassis(
|
||||||
|
{-4,-4,-4,-4},
|
||||||
|
{1,1,1,1},
|
||||||
|
16,
|
||||||
|
3.125,
|
||||||
|
600,
|
||||||
|
0.6
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Electronics / Pneumatics / Sensors
|
||||||
|
// pros::Rotation enc_left();
|
||||||
|
// pros::Rotation enc_right();
|
||||||
|
// pros::Rotation enc_theta();
|
||||||
|
|
||||||
|
// Misc
|
||||||
|
|
||||||
|
}
|
||||||
0
RELENTLESS-Lite/src/superstructure.cpp
Normal file
0
RELENTLESS-Lite/src/superstructure.cpp
Normal file
Loading…
x
Reference in New Issue
Block a user