コード例 #1
0
ファイル: Arm.java プロジェクト: team810/Stronghold
  public double returnPIDInput() {
    // Return your input value for the PID loop
    // e.g. a sensor, like a potentiometer:
    // yourPot.getAverageVoltage() / kYourMaxVoltage;

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=SOURCE
    return angle.get();

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=SOURCE
  }
コード例 #2
0
 public void setIndexWheels(double target) {
   System.out.println("index target is " + target);
   indexTarget = target;
   error = indexTarget - indexPosition.get();
   if (error > 0.04) {
     openIndexWheels.set(Relay.Value.kForward);
   } else if (error < -0.04) {
     openIndexWheels.set(Relay.Value.kReverse);
   } else {
     openIndexWheels.set(Relay.Value.kOff);
   }
 }
コード例 #3
0
ファイル: Hood.java プロジェクト: frc3316/Stronghold2016
  public Hood() {
    // Actuators
    Robot.actuators.HoodActuators();

    hoodMotor = Robot.actuators.hoodMotor;
    addSpeedController(hoodMotor);

    // Sensors
    Robot.sensors.HoodSensors();

    hoodPot = Robot.sensors.hoodPot;
    potAverage =
        new MovingAverage(
            25,
            10,
            () -> {
              return hoodPot.get();
            });

    potOffset = (double) config.get("hood_Pot_Offset");
  }
コード例 #4
0
 public double getIndexPosition() {
   return indexPosition.get();
 }
コード例 #5
0
 public double getLevel() { // Converts raw potentiometer units to inches
   double zeroedPot =
       Constants.elevatorPotLOWLimit
           - elevatorPot.get(); // Maps the low limit to 0 and has a range from 0 to 0.984
   return zeroedPot * ((double) (Constants.elevatorHeight / Constants.elevatorRawLength));
 }
 /**
  * Reads and returns the current range (in inches) from the analog port. -1 is returned if range
  * is not being obtained form the analog port.
  */
 public double getAnalogRangeInches() {
   return null == analogPotentiometer ? -1 : analogPotentiometer.get() / cmPerInch;
 }
 /**
  * Reads and returns the current range (in cm) from the analog port. -1 is returned if range is
  * not being obtained form the analog port.
  */
 public double getAnalogRangeCm() {
   return null == analogPotentiometer ? -1 : analogPotentiometer.get();
 }
コード例 #8
0
 /** Get the value to use when running the PID */
 protected double returnPIDInput() {
   return pot.pidGet();
 }
コード例 #9
0
 public boolean isIntakeClose() {
   return intakePot.get() <= (double) config.get("intake_Pot_LowThresh");
 }
コード例 #10
0
 public boolean isIntakeOpen() {
   return intakePot.get() >= (double) config.get("intake_Pot_HighThresh");
 }