mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user