Skip to content

Commit a659007

Browse files
committed
fix measures
1 parent 888845a commit a659007

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
}
1212

1313
group = "org.strykeforce"
14-
version = "25.0.2"
14+
version = "25.0.3"
1515

1616
java {
1717
targetCompatibility = JavaVersion.VERSION_17

src/main/kotlin/org/strykeforce/telemetry/measurable/TalonFXSMeasureable.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.strykeforce.telemetry.measurable
22

33
import com.ctre.phoenix6.hardware.TalonFXS
4+
import edu.wpi.first.math.MathUtil
45
import org.strykeforce.telemetry.talon.*
56
import org.strykeforce.telemetry.talon.ACCELERATION
67
import org.strykeforce.telemetry.talon.ACCEL_SCALE
@@ -126,7 +127,7 @@ class TalonFXSMeasureable @JvmOverloads constructor(
126127
Measure(DIFF_CLOSED_LOOP_REF, "Differential Closed Loop Reference"){talonFXS.differentialClosedLoopReference.valueAsDouble},
127128
Measure(DIFF_CLOSED_LOOP_REF_SLOPE, "Differential Closed Loop Reference Slope"){talonFXS.differentialClosedLoopReferenceSlope.valueAsDouble},
128129
Measure(DIFF_CLOSED_LOOP_SLOT, "Differential Closed Loop Slot"){talonFXS.differentialClosedLoopSlot.valueAsDouble},
129-
Measure(PULSE_WIDTH_POSITION, "Pulse Width Position") {((talonFXS.rawPulseWidthPosition.valueAsDouble).toInt() and 0xFFF).toDouble()}
130+
Measure(PULSE_WIDTH_POSITION, "Pulse Width Position") {((MathUtil.inputModulus(talonFXS.rawPulseWidthPosition.valueAsDouble,0.0, 1.0))}
130131
)
131132

132133
override fun equals(other: Any?): Boolean {

0 commit comments

Comments
 (0)