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()),
|
||||
collector(new HHCollector()),
|
||||
compressorSystem(new HHCompressor()),
|
||||
dashboard(new HHDashboard()),
|
||||
sonar(new HHSonar()){
|
||||
dashboard(new HHDashboard()){
|
||||
}
|
||||
bool HHRobot::CheckJoystickValues(){
|
||||
float x=ControlSystem->rightJoystickAxisValues[1];
|
||||
@ -16,7 +15,6 @@ bool HHRobot::CheckJoystickValues(){
|
||||
return true;
|
||||
}else{
|
||||
dashboard->PutBoolValue("Joysticks Valid", false);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -8,22 +8,17 @@ class HHShooter;
|
||||
class HHCollector;
|
||||
class HHCompressor;
|
||||
class HHDashboard;
|
||||
class HHSonar;
|
||||
class HHRobot;
|
||||
class HHRobot{
|
||||
private:
|
||||
Jaguar *right1, *right2, *right3, *left1, *left2, *left3;
|
||||
DigitalOutput *frontSonarLeftD, *frontSonarRightD, *rearSonarLeftD, *rearSonarRightD;
|
||||
AnalogChannel *frontSonarLeftA, *frontSonarRightA, *rearSonarLeftA, *rearSonarRightA;
|
||||
JoystickController *ControlSystem;
|
||||
HHShooter *shooter;
|
||||
HHCollector *collector;
|
||||
HHCompressor *compressorSystem;
|
||||
HHDashboard *dashboard;
|
||||
HHSonar *sonar;
|
||||
public:
|
||||
HHRobot();
|
||||
float frontSonarLeftV, frontSonarRightV, rearSonarLeftV, rearSonarRightV;
|
||||
bool CheckJoystickValues();
|
||||
void DriveRobot(float,float);
|
||||
void UpdateDashboard();
|
||||
|
@ -9,15 +9,20 @@ void HHCompressor::CompressorSystemPeriodic(){
|
||||
case EXTENDED:
|
||||
solenoid1->Set(false);
|
||||
solenoid2->Set(true);
|
||||
e_CollectorSolenoidState = IDLE;
|
||||
break;
|
||||
case RETRACTED:
|
||||
solenoid1->Set(true);
|
||||
solenoid2->Set(false);
|
||||
e_CollectorSolenoidState = IDLE;
|
||||
break;
|
||||
case IDLE:
|
||||
e_CollectorSolenoidState = IDLE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
e_CollectorSolenoidState=IDLE;
|
||||
//e_CollectorSolenoidState=IDLE;
|
||||
}
|
||||
void HHCompressor::StartCompressing(){
|
||||
compressor->Start();
|
||||
|
@ -28,8 +28,7 @@ void HHShooter::Lower(float desiredAngle){
|
||||
if(GetAngle() >= desiredAngle){
|
||||
ShootRaw(-0.1f);
|
||||
e_ShooterState=LOWERING;
|
||||
}
|
||||
else{
|
||||
}else{
|
||||
ShootRaw(0.0f);
|
||||
e_ShooterState=IDLE_PRESHOT;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user