update something or something
This commit is contained in:
parent
fdce6c75c7
commit
575f79648a
@ -7,37 +7,7 @@
|
|||||||
using namespace globals;
|
using namespace globals;
|
||||||
using namespace superstruct;
|
using namespace superstruct;
|
||||||
|
|
||||||
// **CONSTANTS** //
|
|
||||||
|
|
||||||
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() {
|
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");
|
//pros::task_t intakeTask(run_intake_for, (void*) malloc(sizeof(double)), TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "runIntakeFor");
|
||||||
|
|||||||
@ -34,18 +34,22 @@ namespace superstruct {
|
|||||||
|
|
||||||
// motion and stuff
|
// motion and stuff
|
||||||
void driveChassis(double dist, double speedScale, bool useHeadingCorrection) {
|
void driveChassis(double dist, double speedScale, bool useHeadingCorrection) {
|
||||||
|
//chassis.set_mode(ary::DRIVE);
|
||||||
chassis.set_drive(dist, DRIVE_SPEED * speedScale, (dist > 14.0) ? true : false, useHeadingCorrection);
|
chassis.set_drive(dist, DRIVE_SPEED * speedScale, (dist > 14.0) ? true : false, useHeadingCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void turnChassis(double theta, double turnSpeedScale) {
|
void turnChassis(double theta, double turnSpeedScale) {
|
||||||
|
//chassis.set_mode(ary::TURN);
|
||||||
chassis.set_turn(theta, TURN_SPEED * turnSpeedScale);
|
chassis.set_turn(theta, TURN_SPEED * turnSpeedScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void leftSwing(double theta, double swingSpeedScale) {
|
void leftSwing(double theta, double swingSpeedScale) {
|
||||||
|
//chassis.set_mode(SWING);
|
||||||
chassis.set_swing(LEFT_SWING, theta, SWING_SPEED * swingSpeedScale);
|
chassis.set_swing(LEFT_SWING, theta, SWING_SPEED * swingSpeedScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rightSwing(double theta, double swingSpeedScale) {
|
void rightSwing(double theta, double swingSpeedScale) {
|
||||||
|
//chassis.set_mode(SWING);
|
||||||
chassis.set_swing(RIGHT_SWING, theta, SWING_SPEED * swingSpeedScale);
|
chassis.set_swing(RIGHT_SWING, theta, SWING_SPEED * swingSpeedScale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user