AUTONS
This commit is contained in:
parent
b8efdc8e10
commit
28dc7ea7eb
@ -1,7 +1,7 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#define DRIVE_SPEED 110
|
#define DRIVE_SPEED 110
|
||||||
#define TURN_SPEED 90
|
#define TURN_SPEED 127
|
||||||
#define SWING_SPEED 90
|
#define SWING_SPEED 90
|
||||||
// R1 -> WINGS, L1 -> CATA, L2 -> PTO, R2 -> INTAKE
|
// R1 -> WINGS, L1 -> CATA, L2 -> PTO, R2 -> INTAKE
|
||||||
// Renu's control preferences
|
// Renu's control preferences
|
||||||
|
|||||||
@ -21,26 +21,38 @@ using namespace superstruct;
|
|||||||
void near_side() {
|
void near_side() {
|
||||||
// Score the triball preload
|
// Score the triball preload
|
||||||
toggleIntake(true);
|
toggleIntake(true);
|
||||||
driveSync(100, true);
|
driveSync(90, true);
|
||||||
turnSync(90);
|
turnSync(90);
|
||||||
|
|
||||||
toggleIntake(false);
|
toggleIntake(false);
|
||||||
pros::delay(50);
|
pros::delay(50);
|
||||||
driveSync(22, true);
|
driveSync(22, true);
|
||||||
driveSync(-22, true);
|
driveSync(-19, true);
|
||||||
|
|
||||||
turnSync(-120);
|
turnSync(-118);
|
||||||
driveSync(48.5, true);
|
driveSync(50, true);
|
||||||
pros::delay(150);
|
pros::delay(150);
|
||||||
toggleIntake(true);
|
toggleIntake(true);
|
||||||
pros::delay(100);
|
pros::delay(100);
|
||||||
|
|
||||||
driveSync(-35, true);
|
driveSync(-35, true);
|
||||||
turnSync(90);
|
turnSync(75);
|
||||||
|
|
||||||
pros::delay(100);
|
pros::delay(100);
|
||||||
toggleIntake(false);
|
toggleIntake(false);
|
||||||
driveSync(55, true);
|
driveSync(35, true);
|
||||||
|
driveSync(-20, true);
|
||||||
|
|
||||||
|
turnSync(300);
|
||||||
|
driveSync(50, true);
|
||||||
|
pros::delay(400);
|
||||||
|
toggleIntake(true);
|
||||||
|
driveSync(-31, true);
|
||||||
|
turnSync(90);
|
||||||
|
toggleIntake(false);
|
||||||
|
wings.open();
|
||||||
|
driveSync(50, true);
|
||||||
|
wings.close();
|
||||||
driveSync(-20, true);
|
driveSync(-20, true);
|
||||||
|
|
||||||
//driveSync(100, true);
|
//driveSync(100, true);
|
||||||
@ -49,32 +61,24 @@ void near_side() {
|
|||||||
|
|
||||||
void far_side() {
|
void far_side() {
|
||||||
toggleIntake(true);
|
toggleIntake(true);
|
||||||
driveSync(100, true);
|
wings.open();
|
||||||
turnSync(-90);
|
|
||||||
|
|
||||||
toggleIntake(false);
|
|
||||||
pros::delay(250);
|
|
||||||
driveSync(31, true);
|
|
||||||
driveSync(-30, true);
|
|
||||||
|
|
||||||
turnSync(-160);
|
|
||||||
driveSync(125, true);
|
|
||||||
pros::delay(1000);
|
pros::delay(1000);
|
||||||
driveSync(-35, true);
|
turnSync(-180);
|
||||||
|
|
||||||
turnSync(55);
|
|
||||||
driveSync(70, true);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void far_side() {
|
||||||
|
// driveSync(20, true);
|
||||||
|
// rightSwing(25);
|
||||||
|
// chassis.wait_drive();
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
void skills() {
|
void skills() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_seq() {
|
void test_seq() {
|
||||||
driveSync(10, true);
|
driveSync(20, true);
|
||||||
turnSync(90);
|
|
||||||
turnSync(90);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void odom_test() {
|
void odom_test() {
|
||||||
|
|||||||
@ -65,7 +65,7 @@ void autonomous() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void opcontrol() {
|
void opcontrol() {
|
||||||
Gif gif(chip_gif, lv_scr_act());
|
//Gif gif(chip_gif, lv_scr_act());
|
||||||
opControlInit(); // Configure the chassis for driver control
|
opControlInit(); // Configure the chassis for driver control
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|||||||
@ -37,8 +37,8 @@ namespace superstruct {
|
|||||||
chassis.set_joystick_drivescale(1.0);
|
chassis.set_joystick_drivescale(1.0);
|
||||||
chassis.set_joystick_turnscale(1.0);
|
chassis.set_joystick_turnscale(1.0);
|
||||||
|
|
||||||
chassis_odom.calibrate();
|
// chassis_odom.calibrate();
|
||||||
chassis_odom.setPose(0, 0, 0);
|
// chassis_odom.setPose(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void telemetry() {
|
void telemetry() {
|
||||||
@ -68,9 +68,9 @@ namespace superstruct {
|
|||||||
chassis.set_slew_min_power(80, 80);
|
chassis.set_slew_min_power(80, 80);
|
||||||
chassis.set_slew_distance(7, 7);
|
chassis.set_slew_distance(7, 7);
|
||||||
chassis.set_pid_constants(&chassis.headingPID, 16, 0, 32, 0);
|
chassis.set_pid_constants(&chassis.headingPID, 16, 0, 32, 0);
|
||||||
chassis.set_pid_constants(&chassis.forward_drivePID, 0.55, 0, 5, 0);
|
chassis.set_pid_constants(&chassis.forward_drivePID, 0.5, 0, 5, 0);
|
||||||
chassis.set_pid_constants(&chassis.backward_drivePID, 0.55, 0, 5, 0);
|
chassis.set_pid_constants(&chassis.backward_drivePID, 0.5, 0, 5, 0);
|
||||||
chassis.set_pid_constants(&chassis.turnPID, 6.5, 0.003, 35, 15);
|
chassis.set_pid_constants(&chassis.turnPID, 6.25, 0.003, 57, 15);
|
||||||
chassis.set_pid_constants(&chassis.swingPID, 8.5, 0, 50, 0);
|
chassis.set_pid_constants(&chassis.swingPID, 8.5, 0, 50, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user