mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Camera works, untested binelevator changes
This commit is contained in:
parent
c77ee7a548
commit
0831c1084b
@ -13,8 +13,7 @@ DentRobot::DentRobot(){
|
||||
elevator=new Elevator();
|
||||
binElevator=new BinElevator();
|
||||
aut=new Autonomous();
|
||||
CameraServer::GetInstance()->SetQuality(50);
|
||||
//the camera name (ex "cam0") can be found through the roborio web interface
|
||||
CameraServer::GetInstance()->SetQuality(25);
|
||||
CameraServer::GetInstance()->StartAutomaticCapture("cam0");
|
||||
printf("Initialized");
|
||||
}
|
||||
|
@ -9,12 +9,16 @@
|
||||
#define ELEVATOR_COLELCT_TOTE_DIO 1
|
||||
#define ELEVATOR_READY_TOTE_DIO 2
|
||||
#define ELEVATOR_TOP_DIO 5
|
||||
#define ELEVATOR_ENCODERA 0
|
||||
#define ELEVATOR_ENCODERB 1
|
||||
|
||||
// BinElevator
|
||||
#define BINELEVATOR_CAN 11
|
||||
#define BINELEVATOR_BOTTOM_DIO 6
|
||||
#define BINELEVATOR_COLELCT_BIN_DIO 7
|
||||
#define BINELEVATOR_TOP_DIO 8
|
||||
#define BINELEVATOR_ENCODERA 2
|
||||
#define BINELEVATOR_ENCODERB 3
|
||||
|
||||
// Drivetrain
|
||||
#define DRIVE_FRONT_LEFT_CAN 2
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "../RobotMap.h"
|
||||
BinElevator::BinElevator(){
|
||||
motor=new CANTalon(BINELEVATOR_CAN);
|
||||
elevatorEncoder=new Encoder(0,1,false);
|
||||
elevatorEncoder=new Encoder(BINELEVATOR_ENCODERA,BINELEVATOR_ENCODERB,false);
|
||||
offset=0;
|
||||
height=0;
|
||||
elevatorBottom=new DigitalInput(BINELEVATOR_BOTTOM_DIO);
|
||||
|
@ -2,26 +2,20 @@
|
||||
#include "../RobotMap.h"
|
||||
Elevator::Elevator(){
|
||||
motor=new CANTalon(ELEVATOR_CAN);
|
||||
elevatorEncoder=new Encoder(0,1,false);
|
||||
offset=0;
|
||||
height=0;
|
||||
elevatorEncoder=new Encoder(ELEVATOR_ENCODERA,ELEVATOR_ENCODERB,false);
|
||||
elevatorBottom=new DigitalInput(ELEVATOR_BOTTOM_DIO);
|
||||
elevatorTop=new DigitalInput(ELEVATOR_TOP_DIO);
|
||||
//SetAbsoluteTolerance(0.004);
|
||||
}
|
||||
void Elevator::InitDefaultCommand(){
|
||||
}
|
||||
void Elevator::Run(double power){
|
||||
motor->Set(power);
|
||||
}
|
||||
void Elevator::SetOffset(double ht){
|
||||
offset=ht;
|
||||
}
|
||||
void Elevator::ResetEncoder(){
|
||||
elevatorEncoder->Reset();
|
||||
}
|
||||
double Elevator::GetHeight(){
|
||||
return elevatorEncoder->Get()+offset;
|
||||
return elevatorEncoder->Get();
|
||||
}
|
||||
bool Elevator::GetElevatorBottom(){
|
||||
return elevatorBottom->Get();
|
||||
|
@ -8,13 +8,11 @@ class Elevator{
|
||||
CANTalon *motor;
|
||||
Encoder *elevatorEncoder;
|
||||
static constexpr double kP_real=4, kI_real=.0f, kP_simulation=18, kI_simulation=.2;
|
||||
double offset, height;
|
||||
DigitalInput *elevatorBottom, *elevatorTop;
|
||||
public:
|
||||
Elevator();
|
||||
void InitDefaultCommand();
|
||||
void Run(double);
|
||||
void SetOffset(double);
|
||||
void ResetEncoder();
|
||||
double GetHeight();
|
||||
bool GetElevatorTop();
|
||||
|
Loading…
Reference in New Issue
Block a user