mirror of
https://github.com/team2059/Zaphod
synced 2024-12-18 20:12:28 -05:00
Trying to get this to work on robot... Not working right now
This commit is contained in:
parent
09b056c64b
commit
b28fb4d93e
@ -5,8 +5,7 @@ HHRobot::HHRobot():
|
|||||||
shooter(new HHShooter()),
|
shooter(new HHShooter()),
|
||||||
collector(new HHCollector()),
|
collector(new HHCollector()),
|
||||||
compressorSystem(new HHCompressor()),
|
compressorSystem(new HHCompressor()),
|
||||||
dashboard(new HHDashboard()),
|
dashboard(new HHDashboard()){
|
||||||
sonar(new HHSonar()){
|
|
||||||
}
|
}
|
||||||
bool HHRobot::CheckJoystickValues(){
|
bool HHRobot::CheckJoystickValues(){
|
||||||
float x=ControlSystem->rightJoystickAxisValues[1];
|
float x=ControlSystem->rightJoystickAxisValues[1];
|
||||||
@ -16,7 +15,6 @@ bool HHRobot::CheckJoystickValues(){
|
|||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
dashboard->PutBoolValue("Joysticks Valid", false);
|
dashboard->PutBoolValue("Joysticks Valid", false);
|
||||||
return true;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,22 +8,17 @@ class HHShooter;
|
|||||||
class HHCollector;
|
class HHCollector;
|
||||||
class HHCompressor;
|
class HHCompressor;
|
||||||
class HHDashboard;
|
class HHDashboard;
|
||||||
class HHSonar;
|
|
||||||
class HHRobot;
|
class HHRobot;
|
||||||
class HHRobot{
|
class HHRobot{
|
||||||
private:
|
private:
|
||||||
Jaguar *right1, *right2, *right3, *left1, *left2, *left3;
|
Jaguar *right1, *right2, *right3, *left1, *left2, *left3;
|
||||||
DigitalOutput *frontSonarLeftD, *frontSonarRightD, *rearSonarLeftD, *rearSonarRightD;
|
|
||||||
AnalogChannel *frontSonarLeftA, *frontSonarRightA, *rearSonarLeftA, *rearSonarRightA;
|
|
||||||
JoystickController *ControlSystem;
|
JoystickController *ControlSystem;
|
||||||
HHShooter *shooter;
|
HHShooter *shooter;
|
||||||
HHCollector *collector;
|
HHCollector *collector;
|
||||||
HHCompressor *compressorSystem;
|
HHCompressor *compressorSystem;
|
||||||
HHDashboard *dashboard;
|
HHDashboard *dashboard;
|
||||||
HHSonar *sonar;
|
|
||||||
public:
|
public:
|
||||||
HHRobot();
|
HHRobot();
|
||||||
float frontSonarLeftV, frontSonarRightV, rearSonarLeftV, rearSonarRightV;
|
|
||||||
bool CheckJoystickValues();
|
bool CheckJoystickValues();
|
||||||
void DriveRobot(float,float);
|
void DriveRobot(float,float);
|
||||||
void UpdateDashboard();
|
void UpdateDashboard();
|
||||||
|
@ -9,15 +9,20 @@ void HHCompressor::CompressorSystemPeriodic(){
|
|||||||
case EXTENDED:
|
case EXTENDED:
|
||||||
solenoid1->Set(false);
|
solenoid1->Set(false);
|
||||||
solenoid2->Set(true);
|
solenoid2->Set(true);
|
||||||
|
e_CollectorSolenoidState = IDLE;
|
||||||
break;
|
break;
|
||||||
case RETRACTED:
|
case RETRACTED:
|
||||||
solenoid1->Set(true);
|
solenoid1->Set(true);
|
||||||
solenoid2->Set(false);
|
solenoid2->Set(false);
|
||||||
|
e_CollectorSolenoidState = IDLE;
|
||||||
|
break;
|
||||||
|
case IDLE:
|
||||||
|
e_CollectorSolenoidState = IDLE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
e_CollectorSolenoidState=IDLE;
|
//e_CollectorSolenoidState=IDLE;
|
||||||
}
|
}
|
||||||
void HHCompressor::StartCompressing(){
|
void HHCompressor::StartCompressing(){
|
||||||
compressor->Start();
|
compressor->Start();
|
||||||
|
@ -28,8 +28,7 @@ void HHShooter::Lower(float desiredAngle){
|
|||||||
if(GetAngle() >= desiredAngle){
|
if(GetAngle() >= desiredAngle){
|
||||||
ShootRaw(-0.1f);
|
ShootRaw(-0.1f);
|
||||||
e_ShooterState=LOWERING;
|
e_ShooterState=LOWERING;
|
||||||
}
|
}else{
|
||||||
else{
|
|
||||||
ShootRaw(0.0f);
|
ShootRaw(0.0f);
|
||||||
e_ShooterState=IDLE_PRESHOT;
|
e_ShooterState=IDLE_PRESHOT;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user