Update Sim Example Unit Conversions (#265)

Updated Java examples to fix radians/degrees mismatch.

Inspected c++ examples - they create a units::degree_t from the NT value, which should be handled properly inside the PhotonUtils methods.
This commit is contained in:
Chris Gerth
2021-03-23 12:57:32 -05:00
committed by GitHub
parent 1e715ce4bb
commit 49fcdb64ed
2 changed files with 2 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ public class Robot extends TimedRobot {
CAMERA_HEIGHT_METERS,
TARGET_HEIGHT_METERS,
CAMERA_PITCH_RADIANS,
result.getBestTarget().getPitch());
Units.degreesToRadians(result.getBestTarget().getPitch()));
// Use this range as the measurement we give to the PID controller.
// -1.0 required to ensure positive PID controller effort _increases_ range

View File

@@ -81,7 +81,7 @@ public class Robot extends TimedRobot {
CAMERA_HEIGHT_METERS,
TARGET_HEIGHT_METERS,
CAMERA_PITCH_RADIANS,
result.getBestTarget().getPitch());
Units.degreesToRadians(result.getBestTarget().getPitch()));
// Use this range as the measurement we give to the PID controller.
// -1.0 required to ensure positive PID controller effort _increases_ range