piston testing fr
read the title
This commit is contained in:
parent
575f79648a
commit
1cbae5ced1
@ -9,6 +9,8 @@
|
|||||||
#define DRIVE_RATIO 0.75
|
#define DRIVE_RATIO 0.75
|
||||||
#define DRIVE_RPM 450
|
#define DRIVE_RPM 450
|
||||||
|
|
||||||
|
bool ptoEnabled;
|
||||||
|
|
||||||
namespace globals {
|
namespace globals {
|
||||||
extern pros::Controller master;
|
extern pros::Controller master;
|
||||||
|
|
||||||
@ -30,6 +32,8 @@ namespace globals {
|
|||||||
extern pros::Rotation rot_horiz;
|
extern pros::Rotation rot_horiz;
|
||||||
extern pros::Rotation enc_theta;
|
extern pros::Rotation enc_theta;
|
||||||
|
|
||||||
|
extern pros::ADIAnalogOut pto_piston;
|
||||||
|
|
||||||
extern lemlib::TrackingWheel vert_tracking_wheel;
|
extern lemlib::TrackingWheel vert_tracking_wheel;
|
||||||
extern lemlib::TrackingWheel horiz_tracking_wheel;
|
extern lemlib::TrackingWheel horiz_tracking_wheel;
|
||||||
|
|
||||||
|
|||||||
@ -20,5 +20,9 @@ namespace superstruct {
|
|||||||
void turnChassis(double theta, double turnSpeedScale);
|
void turnChassis(double theta, double turnSpeedScale);
|
||||||
void leftSwing(double theta, double swingSpeedScale);
|
void leftSwing(double theta, double swingSpeedScale);
|
||||||
void rightSwing(double theta, double swingSpeedScale);
|
void rightSwing(double theta, double swingSpeedScale);
|
||||||
|
|
||||||
|
//- Structure methods
|
||||||
|
void togglePto();
|
||||||
|
bool getPtoState();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -22,6 +22,7 @@ namespace globals {
|
|||||||
pros::Rotation rot_horiz(1);
|
pros::Rotation rot_horiz(1);
|
||||||
// pros::Rotation enc_right();
|
// pros::Rotation enc_right();
|
||||||
// pros::Rotation enc_theta();
|
// pros::Rotation enc_theta();
|
||||||
|
pros::ADIAnalogOut pto_piston(1);
|
||||||
|
|
||||||
lemlib::Drivetrain_t chassis_odom {
|
lemlib::Drivetrain_t chassis_odom {
|
||||||
&left_drive,
|
&left_drive,
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "lemlib/api.hpp"
|
#include "lemlib/api.hpp"
|
||||||
#include "globals.hpp"
|
#include "globals.hpp"
|
||||||
|
#include "superstructure.hpp"
|
||||||
|
|
||||||
using namespace globals;
|
using namespace globals;
|
||||||
|
using namespace superstruct;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A callback function for LLEMU's center button.
|
* A callback function for LLEMU's center button.
|
||||||
@ -87,6 +89,10 @@ void opcontrol() {
|
|||||||
motor_tlb.move_voltage(0);
|
motor_tlb.move_voltage(0);
|
||||||
motor_trb.move_voltage(0);
|
motor_trb.move_voltage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (globals::master.get_digital_new_press(DIGITAL_LEFT)) {
|
||||||
|
togglePto();
|
||||||
|
}
|
||||||
|
|
||||||
pros::delay(20);
|
pros::delay(20);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
using namespace ary;
|
using namespace ary;
|
||||||
using namespace globals;
|
using namespace globals;
|
||||||
|
|
||||||
|
bool ptoEnabled = false;
|
||||||
namespace superstruct {
|
namespace superstruct {
|
||||||
void configureExitConditions() {
|
void configureExitConditions() {
|
||||||
chassis.set_exit_condition(chassis.turn_exit, 100, 3, 500, 7, 500, 500);
|
chassis.set_exit_condition(chassis.turn_exit, 100, 3, 500, 7, 500, 500);
|
||||||
@ -52,4 +54,15 @@ namespace superstruct {
|
|||||||
//chassis.set_mode(SWING);
|
//chassis.set_mode(SWING);
|
||||||
chassis.set_swing(RIGHT_SWING, theta, SWING_SPEED * swingSpeedScale);
|
chassis.set_swing(RIGHT_SWING, theta, SWING_SPEED * swingSpeedScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Structure methods
|
||||||
|
|
||||||
|
void togglePto() {
|
||||||
|
int state = (ptoEnabled) ? 1 : 0;
|
||||||
|
pto_piston.set_value(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
// bool getPtoState() {
|
||||||
|
// return (pto_piston.get_value() == 1) ? true : false;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user