Exemple #1
0
 public void setPositionGoal(double distance, double angle, double speed) {
   profile.setMaxVelocity(speed);
   profile.setTimeToMaxV(.2);
   straightController.setGoal(distance);
   straightController.enable();
   turnController.setGoal(angle);
   turnController.enable();
 }
Exemple #2
0
 public void setSpeedGoal(double speed, double angle) {
   profile.setMaxVelocity(Math.abs(speed));
   profile.setTimeToMaxV(0.001);
   straightController.setGoal(speed < 0 ? -1000 : 1000);
   straightController.enable();
   turnController.setGoal(angle);
   turnController.enable();
 }
Exemple #3
0
 public void setStraightProfile(MotionProfile profile) {
   straightController.setProfile(profile);
 }
Exemple #4
0
 public void resetControllers() {
   straightController.setProfile(profile);
 }
Exemple #5
0
 public boolean onTarget() {
   return straightController.onTarget() && turnController.onTarget();
 }
Exemple #6
0
 public void setTurnGoal(double angle) {
   straightController.disable();
   lastStraight = 0;
   turnController.setGoal(angle);
   turnController.enable();
 }
Exemple #7
0
 public void updatePositionGoal(double distance) {
   straightController.setGoalRaw(distance);
 }
Exemple #8
0
 public void disableControllers() {
   straightController.disable();
   turnController.disable();
   setLeftRightPower(0, 0);
 }
Exemple #9
0
 public void shift(boolean highGear) {
   isHighGear = highGear;
   shifter.set(!isHighGear);
   straightController.setGains(highGear ? highStraightGains : lowStraightGains);
   turnController.setGains(highGear ? highTurnGains : lowTurnGains);
 }