Skip to content

Commit

Permalink
fix velocity feedforward units + update wpilib
Browse files Browse the repository at this point in the history
  • Loading branch information
sswadkar committed Feb 26, 2023
1 parent 93d0f1d commit b041b0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "idea"
id 'maven-publish'
id "org.jetbrains.kotlin.jvm" version "1.6.10"
id "edu.wpi.first.GradleRIO" version "2023.2.1"
id "edu.wpi.first.GradleRIO" version "2023.4.2"
id "com.diffplug.spotless" version "6.3.0"
id "com.peterabeles.gversion" version "1.10"
id "org.jetbrains.kotlinx.kover" version "0.4.2"
Expand All @@ -21,8 +21,8 @@ dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib"

implementation "edu.wpi.first.wpimath:wpimath-java:2023.2.1"
implementation "edu.wpi.first.wpiutil:wpiutil-java:2023.2.1"
implementation "edu.wpi.first.wpimath:wpimath-java:2023.4.2"
implementation "edu.wpi.first.wpiutil:wpiutil-java:2023.4.2"

implementation wpi.java.deps.wpilib()
implementation wpi.java.vendor.java()
Expand All @@ -39,7 +39,7 @@ publishing {
release(MavenPublication) {
groupId = 'org.team4099'
artifactId = 'falconutils'
version = '1.1.13'
version = '1.1.14'

from(components["kotlin"])
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/org/team4099/lib/units/MechanismUnits.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ interface MechanismSensor<U : UnitKey> {
derivativeGain: DerivativeGain<Velocity<U>, Volt>,
): Double

fun velocityFeedforwardToRawUnits(velocityFeedforward: VelocityFeedforward<U, Volt>): Double
fun velocityFeedforwardToRawUnits(velocityFeedforward: VelocityFeedforward<Velocity<U>, Volt>): Double
}

class LinearMechanismSensor(
Expand Down Expand Up @@ -157,7 +157,7 @@ class LinearMechanismSensor(
}

override inline fun velocityFeedforwardToRawUnits(
velocityFeedforward: VelocityFeedforward<Meter, Volt>
velocityFeedforward: VelocityFeedforward<Velocity<Meter>, Volt>
): Double {
return velocityFeedforward.value * velocityToRawUnits(1.0.meters.perSecond) /
compensationVoltage.inVolts * fullPowerThrottle
Expand Down Expand Up @@ -246,7 +246,7 @@ class AngularMechanismSensor(
}

override inline fun velocityFeedforwardToRawUnits(
velocityFeedforward: VelocityFeedforward<Radian, Volt>
velocityFeedforward: VelocityFeedforward<Velocity<Radian>, Volt>
): Double {
return velocityFeedforward.value * velocityToRawUnits(1.0.radians.perSecond) /
compensationVoltage.inVolts * fullPowerThrottle
Expand Down

0 comments on commit b041b0d

Please sign in to comment.