mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Fix deprecation warnings in PhotonLib examples (#1699)
The following deprecation warnings have been fixed: - `SwerveModuleState.optimize(desiredState, currentRotation);`, which is now an instance method - `AprilTagFields.kDefaultField.loadAprilTagLayoutField();`, which is now `AprilTagFieldLayout.loadField(AprilTagFields.kDefaultField);` WIP: - [x] C++ - [x] Python
This commit is contained in:
@@ -46,7 +46,7 @@ public class Constants {
|
||||
|
||||
// The layout of the AprilTags on the field
|
||||
public static final AprilTagFieldLayout kTagLayout =
|
||||
AprilTagFields.kDefaultField.loadAprilTagLayoutField();
|
||||
AprilTagFieldLayout.loadField(AprilTagFields.kDefaultField);
|
||||
|
||||
// The standard deviations of our vision estimated poses, which affect correction rate
|
||||
// (Fake values. Experiment and determine estimation noise on an actual robot.)
|
||||
|
||||
@@ -108,7 +108,7 @@ public class SwerveModule {
|
||||
SwerveModuleState desiredState, boolean openLoop, boolean steerInPlace) {
|
||||
Rotation2d currentRotation = getAbsoluteHeading();
|
||||
// Avoid turning more than 90 degrees by inverting speed on large angle changes
|
||||
desiredState = SwerveModuleState.optimize(desiredState, currentRotation);
|
||||
desiredState.optimize(currentRotation);
|
||||
|
||||
this.desiredState = desiredState;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user