Skip to content

Commit

Permalink
Get angular velocity in degrees
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrott committed Sep 19, 2024
1 parent f446388 commit 592d047
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,17 @@ class AngularRampLogger(val dvf: DriveViewFactory) : LinearOpMode() {
}

t.addSplit()
val av = view.imu.get().getRobotAngularVelocity(AngleUnit.RADIANS)
// Use degrees here to work around https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/1070
val av = view.imu.get().getRobotAngularVelocity(AngleUnit.DEGREES)
val time = t.addSplit()

data.angVels[0].times.add(time)
data.angVels[1].times.add(time)
data.angVels[2].times.add(time)

data.angVels[0].values.add(av.xRotationRate.toDouble())
data.angVels[1].values.add(av.yRotationRate.toDouble())
data.angVels[2].values.add(av.zRotationRate.toDouble())
data.angVels[0].values.add(Math.toRadians(av.xRotationRate.toDouble()))
data.angVels[1].values.add(Math.toRadians(av.yRotationRate.toDouble()))
data.angVels[2].values.add(Math.toRadians(av.zRotationRate.toDouble()))
}

for (m in view.motors) {
Expand Down

0 comments on commit 592d047

Please sign in to comment.