Made a new pneumatics class and implemented it in driver control, also made a few different classes for the rotation sensors. Got all the rotation classes implemented with connection to the physical rotation sensors and the motors. Added another controller to be implemented later.
This commit is contained in:
1 parent
bd0e77e240
commit
b7af93220d
14 files changed
+452
-101
No files matched your search
@@ -0,0 +1,80 @@
|
||||
#pragma once
|
||||
|
||||
#include "api.h"
|
||||
#include "pros/adi.hpp"
|
||||
#include "pros/rotation.hpp"
|
||||
|
||||
namespace ez{
|
||||
|
||||
class ArmMech{
|
||||
private:
|
||||
std::vector<int> armStates;
|
||||
int numArmStates;
|
||||
float armKP;
|
||||
|
||||
public:
|
||||
int currArmState;
|
||||
int armTarget;
|
||||
float armError;
|
||||
float armVelocity;
|
||||
|
||||
ArmMech();
|
||||
ArmMech(std::initializer_list<int> armStates, int numArmStates);
|
||||
|
||||
void cycle_states();
|
||||
void reset_state();
|
||||
void arm_control();
|
||||
|
||||
int get_arm_state();
|
||||
int get_num_arm_states();
|
||||
int get_arm_kp();
|
||||
};
|
||||
|
||||
class LiftMech {
|
||||
private:
|
||||
std::vector<int> liftStates;
|
||||
int numLiftStates;
|
||||
float liftKP;
|
||||
|
||||
public:
|
||||
int currLiftState;
|
||||
int liftTarget;
|
||||
float liftError;
|
||||
float liftVelocity;
|
||||
|
||||
LiftMech();
|
||||
LiftMech(std::initializer_list<int> liftStates, int numLiftStates);
|
||||
|
||||
void cycle_states();
|
||||
void reset_state();
|
||||
void lift_control();
|
||||
|
||||
int get_lift_state();
|
||||
int get_num_lift_states();
|
||||
int get_lift_kp();
|
||||
};
|
||||
|
||||
class WristMech {
|
||||
private:
|
||||
std::vector<int> wristStates;
|
||||
int numWristStates;
|
||||
float wristKP;
|
||||
|
||||
public:
|
||||
int currWristState;
|
||||
int wristTarget;
|
||||
float wristError;
|
||||
float wristVelocity;
|
||||
|
||||
WristMech();
|
||||
WristMech(std::initializer_list<int> wristStates, int numWristStates);
|
||||
|
||||
void cycle_states();
|
||||
void reset_state();
|
||||
void wrist_control();
|
||||
|
||||
int get_wrist_state();
|
||||
int get_num_wrist_states();
|
||||
int get_wrist_kp();
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user