From b330d4fffe211ee1cbc9f9298b8493f28fb84fde Mon Sep 17 00:00:00 2001 From: Matthew Choulas Date: Tue, 5 Dec 2023 21:09:00 -0500 Subject: [PATCH] fix status frame implementation --- build.gradle | 2 +- .../org/team4099/lib/units/MechanismUnits.kt | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 5cbc9cf..488f7c1 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ publishing { release(MavenPublication) { groupId = 'org.team4099' artifactId = 'falconutils' - version = '1.1.25' + version = '1.1.26' from(components["kotlin"]) } diff --git a/src/main/kotlin/org/team4099/lib/units/MechanismUnits.kt b/src/main/kotlin/org/team4099/lib/units/MechanismUnits.kt index 4eeeb66..c8881bc 100644 --- a/src/main/kotlin/org/team4099/lib/units/MechanismUnits.kt +++ b/src/main/kotlin/org/team4099/lib/units/MechanismUnits.kt @@ -310,14 +310,17 @@ fun ctreLinearMechanismSensor( diameter: Length, compensationVoltage: ElectricalPotential ): LinearMechanismSensor { + val velocitySignal = controller.velocity + val positionSignal = controller.velocity + return LinearMechanismSensor( diameter, ratio, Timescale.PHOENIX_PRO, 1.0, compensationVoltage, - { controller.velocity.value }, - { controller.position.value }, + { velocitySignal.value }, + { positionSignal.value }, ) } @@ -326,13 +329,16 @@ fun ctreAngularMechanismSensor( ratio: Double, compensationVoltage: ElectricalPotential ): AngularMechanismSensor { + val velocitySignal = controller.velocity + val positionSignal = controller.velocity + return AngularMechanismSensor( ratio, Timescale.PHOENIX_PRO, 1.0, compensationVoltage, - { controller.velocity.value }, - { controller.position.value }, + { velocitySignal.value }, + { positionSignal.value }, ) }