Skip to content

Commit

Permalink
Merge branch 'master' into compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinsonZ authored Jan 19, 2018
2 parents 08a4cd0 + c6db12c commit 0db8b26
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions src/main/java/org/team1540/base/wrappers/ChickenTalon.java
Original file line number Diff line number Diff line change
Expand Up @@ -748,18 +748,42 @@ public void selectProfileSlot(int slotIdx) {
* In PercentOutput, the output is between -1.0 and 1.0, with 0.0 as
* stopped. In Voltage mode, output value is in volts. In Current mode,
* output value is in amperes. In Speed mode, output value is in position
* change / 100ms. In Position mode, output value is in encoder ticks or an
* analog value, depending on the sensor. In Follower mode, the output value
* is the integer device ID of the talon to duplicate.
* change / 100ms. In Position mode, output value is in revolutions if
* {@link #setEncoderCodesPerRev(double)} has been called, otherwise it is in native sensor units.
* In Velocity mode, output value is in RPM if {@link #setEncoderCodesPerRev(double)} has been
* called, otherwise it is in native units per minute. In Follower mode, the output value is the
* integer device ID of the talon to duplicate.
*
* @param outputValue The setpoint value, as described above.
*/
public void set(double outputValue) {
super.set(controlMode, outputValue);
set(controlMode, outputValue);
}

public void set(double demand0, double demand1) {
super.set(controlMode, demand0, demand1);
/**
* Sets the appropriate output on the talon, depending on the mode. <p> In PercentOutput, the
* output is between -1.0 and 1.0, with 0.0 as stopped. In Voltage mode, output value is in volts.
* In Current mode, output value is in amperes. In Speed mode, output value is in position change
* / 100ms. In Position mode, output value is in revolutions if {@link
* #setEncoderCodesPerRev(double)} has been called, otherwise it is in native sensor units. In
* Velocity mode, output value is in RPM if {@link #setEncoderCodesPerRev(double)} has been
* called, otherwise it is in native units per minute. In Follower mode, the output value is the
* integer device ID of the talon to duplicate.
*
* @param outputValue The setpoint value, as described above.
* @param mode The mode to use. Note that while this overrides the mode set via {@link
* #setControlMode(ControlMode)}, it does not change it for subsequent calls to {@link
* #set(double)}.
*/
@Override
public void set(ControlMode mode, double outputValue) {
if (mode == ControlMode.Position) {
outputValue *= encoderCodesPerRev;
} else if (mode == ControlMode.Velocity) {
outputValue /= 600;
outputValue *= encoderCodesPerRev;
}
super.set(mode, outputValue);
}

/**
Expand Down

0 comments on commit 0db8b26

Please sign in to comment.