This repository was archived by the owner on Apr 22, 2019. It is now read-only.
File tree 7 files changed +20
-8
lines changed
7 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 4
4
ControlCargo::ControlCargo () {
5
5
// Use Requires() here to declare subsystem dependencies
6
6
Requires (Robot::m_Flap);
7
- this ->pJoyOp = Robot::m_oi->GetJoystickOperator ();
7
+ this ->pJoyDrive = Robot::m_oi->GetJoystickDrive ();
8
8
}
9
9
10
10
// Called just before this Command runs the first time
@@ -15,11 +15,12 @@ void ControlCargo::Initialize() {}
15
15
void ControlCargo::Execute () {
16
16
17
17
// Control piston
18
- if (this ->pJoyOp -> GetTriggerAxis (Hand:: kLeftHand ) > 0.8 ){
18
+ if (this ->pJoyDrive -> GetYButton () ){
19
19
Robot::m_Flap->Deploy ();
20
20
}else {
21
21
Robot::m_Flap->Retract ();
22
22
}
23
+
23
24
}
24
25
25
26
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ void ControlHatchGripper::Execute() {
25
25
}
26
26
}
27
27
28
-
28
+
29
29
bool ControlHatchGripper::IsFinished () { return false ; }
30
30
31
31
// Called once after isFinished returns true
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ void TriggerDrive::Initialize() {
17
17
// set Speed and Rotation
18
18
this ->speed = 0.0 ;
19
19
this ->rotation = 0.0 ;
20
+ this ->rotationOutput = 0.0 ;
21
+ this ->speedOutput = 0.0 ;
20
22
}
21
23
22
24
// Called repeatedly when this Command is scheduled to run
@@ -50,10 +52,16 @@ void TriggerDrive::Execute() {
50
52
}else if (change < (-SLEW_LIMIT)){
51
53
change = -SLEW_LIMIT;
52
54
};
53
-
54
55
this ->speedOutput += change;
55
- Log (change);
56
- Log (this ->speedOutput + change);
56
+
57
+ // // Rotation slew
58
+ // double rchange = this->rotation - this->rotationOutput;
59
+ // if (change > R_SLEW_LIMIT) {
60
+ // rchange = R_SLEW_LIMIT;
61
+ // }else if(change < (-R_SLEW_LIMIT)){
62
+ // rchange = -R_SLEW_LIMIT;
63
+ // };
64
+ // this->rotationOutput += rchange;
57
65
58
66
Robot::m_DriveTrain->ArcadeDrive (this ->speedOutput , this ->rotation );
59
67
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class ControlCargo : public frc::Command {
27
27
void Interrupted () override ; // !< Runs once if the command is forced to stop
28
28
29
29
private:
30
- frc::XboxController* pJoyOp ; // !< A mnemonic for the operator's controller because we are lazy
30
+ frc::XboxController* pJoyDrive ; // !< A mnemonic for the operator's controller because we are lazy
31
31
};
32
32
33
33
#endif // _ControlCargo_HG_
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class TriggerDrive : public frc::Command {
33
33
double speed; // !< Speed value that will be passed into DriveTrain::ArcadeDrive
34
34
double rotation; // !< Rotation value that will be passed into DriveTrain::ArcadeDrive
35
35
double speedOutput = 0.0 ;
36
+ double rotationOutput = 0.0 ;
36
37
37
38
frc::XboxController* pJoyDrive; // !< A mnemonic for the driver's controller because we are lazy
38
39
};
Original file line number Diff line number Diff line change 32
32
#define ARCADE_KP 0.25
33
33
#define ARCADE_KI 0.0
34
34
#define ARCADE_KD 0.0
35
- #define SLEW_LIMIT 0.05
35
+
36
+ #define SLEW_LIMIT 0.06
37
+ #define R_SLEW_LIMIT 0.04
36
38
37
39
// DriveTrain motor invertions
38
40
#define DRIVETRAIN_LEFT_FRONT_MOTOR_INVERT false
You can’t perform that action at this time.
0 commit comments