wings, debugging, and depression
This commit is contained in:
parent
dc962af095
commit
2a8364adae
@ -3,14 +3,12 @@
|
||||
#include "lemlib/api.hpp"
|
||||
#include "ary-lib/drive/drive.hpp"
|
||||
|
||||
#define TRACK_WDITH 11.5
|
||||
#define TRACK_WIDTH 11.5
|
||||
#define PLACEHOLDER_TC_OFFSET 2.5
|
||||
#define WHEEL_SIZE 2.75
|
||||
#define DRIVE_RATIO 0.75
|
||||
#define DRIVE_RPM 450
|
||||
|
||||
bool ptoEnabled;
|
||||
|
||||
namespace globals {
|
||||
extern pros::Controller master;
|
||||
|
||||
@ -32,7 +30,10 @@ namespace globals {
|
||||
extern pros::Rotation rot_horiz;
|
||||
extern pros::Rotation enc_theta;
|
||||
|
||||
extern pros::ADIAnalogOut pto_piston;
|
||||
extern pros::ADIDigitalOut pto_piston;
|
||||
|
||||
extern pros::ADIPort left_wing_piston;
|
||||
extern pros::ADIPort right_wing_piston;
|
||||
|
||||
extern lemlib::TrackingWheel vert_tracking_wheel;
|
||||
extern lemlib::TrackingWheel horiz_tracking_wheel;
|
||||
|
||||
@ -24,6 +24,6 @@ namespace superstruct {
|
||||
//- Structure methods
|
||||
void togglePto();
|
||||
void runCata();
|
||||
void controlCata();
|
||||
void cataControl();
|
||||
|
||||
}
|
||||
@ -8,8 +8,10 @@ class Wings {
|
||||
Wings();
|
||||
void open();
|
||||
void close();
|
||||
void toggleLeft(int value);
|
||||
void toggleRight(int value);
|
||||
void openFor(double duration);
|
||||
bool getState();
|
||||
std::uint8_t getState();
|
||||
|
||||
private:
|
||||
std::uint8_t wingsopen;
|
||||
|
||||
@ -5,6 +5,14 @@ double JOYSTICK_TURN_SCALE = 1;
|
||||
|
||||
double cata_active_brake_kp = 0.1;
|
||||
|
||||
void Drive::save_l_curve_sd() {
|
||||
return;
|
||||
}
|
||||
|
||||
void Drive::save_r_curve_sd() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set curve defaults
|
||||
void Drive::set_curve_default(double left, double right) {
|
||||
left_curve_scale = left;
|
||||
|
||||
@ -20,9 +20,14 @@ namespace globals {
|
||||
// Electronics / Pneumatics / Sensors
|
||||
pros::Rotation rot_vert(0);
|
||||
pros::Rotation rot_horiz(1);
|
||||
// pros::Rotation enc_right();
|
||||
// pros::Rotation enc_theta();
|
||||
pros::ADIAnalogOut pto_piston('A');
|
||||
|
||||
pros::ADIDigitalOut pto_piston('A');
|
||||
|
||||
// pros::ADIDigitalOut left_wing_piston(2);
|
||||
// pros::ADIDigitalOut right_wing_piston(3);
|
||||
|
||||
pros::ADIPort left_wing_piston('B', pros::E_ADI_DIGITAL_OUT);
|
||||
pros::ADIPort right_wing_piston('C', pros::E_ADI_DIGITAL_OUT);
|
||||
|
||||
lemlib::Drivetrain_t chassis_odom {
|
||||
&left_drive,
|
||||
|
||||
@ -82,7 +82,7 @@ void autonomous() {}
|
||||
void opcontrol() {
|
||||
while (true) {
|
||||
chassis.tank();
|
||||
superstruct::controlCata();
|
||||
superstruct::cataControl();
|
||||
pros::delay(20);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
#include "main.h"
|
||||
#include "globals.hpp"
|
||||
#include "superstructure.hpp"
|
||||
#include "wings.h"
|
||||
|
||||
using namespace globals;
|
||||
|
||||
Wings::Wings() {
|
||||
close();
|
||||
wingsopen = 0;
|
||||
};
|
||||
|
||||
void Wings::open() {
|
||||
left_wing_piston.set_value(1);
|
||||
right_wing_piston.set_value(1);
|
||||
}
|
||||
|
||||
void Wings::close() {
|
||||
left_wing_piston.set_value(0);
|
||||
right_wing_piston.set_value(0);
|
||||
}
|
||||
|
||||
void Wings::toggleLeft(int value) {
|
||||
left_wing_piston.set_value(value);
|
||||
}
|
||||
|
||||
void Wings::toggleRight(int value) {
|
||||
right_wing_piston.set_value(value);
|
||||
}
|
||||
|
||||
void Wings::openFor(double duration) {
|
||||
open();
|
||||
pros::delay(duration * 1000);
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
0 -> Both wings closed
|
||||
1 -> Only right wing opened
|
||||
2 -> Only left wing opened
|
||||
3-> Both wings open
|
||||
*/
|
||||
std::uint8_t getState() {
|
||||
// int stateLeft = left_wing_pisto;
|
||||
// int stateRight = right_wing_piston.get_value();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user