8
8
from wpimath .controller import PIDController , ProfiledPIDControllerRadians
9
9
from wpimath .geometry import Pose2d , Rotation2d , Translation2d
10
10
from wpimath .trajectory import TrajectoryConfig , TrajectoryGenerator
11
+ from wpimath .controller import HolonomicDriveController
11
12
12
13
from constants import AutoConstants , DriveConstants , OIConstants
13
14
from subsystems .drivesubsystem import DriveSubsystem
@@ -88,24 +89,14 @@ def getAutonomousCommand(self) -> commands2.Command:
88
89
config ,
89
90
)
90
91
91
- thetaController = ProfiledPIDControllerRadians (
92
- AutoConstants .kPThetaController ,
93
- 0 ,
94
- 0 ,
95
- AutoConstants .kThetaControllerConstraints ,
96
- )
97
- thetaController .enableContinuousInput (- math .pi , math .pi )
98
-
99
92
swerveControllerCommand = commands2 .SwerveControllerCommand (
100
93
exampleTrajectory ,
101
94
self .robotDrive .getPose , # Functional interface to feed supplier
102
95
DriveConstants .kDriveKinematics ,
103
96
# Position controllers
104
- PIDController (AutoConstants .kPXController , 0 , 0 ),
105
- PIDController (AutoConstants .kPYController , 0 , 0 ),
106
- thetaController ,
97
+ AutoConstants .kPIDController ,
107
98
self .robotDrive .setModuleStates ,
108
- (self .robotDrive ,),
99
+ (self .robotDrive ,)
109
100
)
110
101
111
102
# Reset odometry to the starting pose of the trajectory.
@@ -117,4 +108,4 @@ def getAutonomousCommand(self) -> commands2.Command:
117
108
lambda : self .robotDrive .drive (0 , 0 , 0 , False , False ),
118
109
self .robotDrive ,
119
110
)
120
- )
111
+ )
0 commit comments