mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpimath] Deprecate RamseteController (#6494)
LTVUnicycleController is a drop-in replacement with better tuning knobs. The RamseteCommand examples were removed instead of retrofitted with LTVUnicycleController because we're planning on removing the command controller classes anyway, so it would be wasted effort. The SimpleDifferentialDriveSimulation example shows direct LTVUnicycleController usage.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include <frc/TimedRobot.h>
|
||||
#include <frc/Timer.h>
|
||||
#include <frc/XboxController.h>
|
||||
#include <frc/controller/RamseteController.h>
|
||||
#include <frc/controller/LTVUnicycleController.h>
|
||||
#include <frc/filter/SlewRateLimiter.h>
|
||||
#include <frc/trajectory/TrajectoryGenerator.h>
|
||||
|
||||
@@ -29,7 +29,7 @@ class Robot : public frc::TimedRobot {
|
||||
void AutonomousPeriodic() override {
|
||||
auto elapsed = m_timer.Get();
|
||||
auto reference = m_trajectory.Sample(elapsed);
|
||||
auto speeds = m_ramsete.Calculate(m_drive.GetPose(), reference);
|
||||
auto speeds = m_feedback.Calculate(m_drive.GetPose(), reference);
|
||||
m_drive.Drive(speeds.vx, speeds.omega);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class Robot : public frc::TimedRobot {
|
||||
|
||||
Drivetrain m_drive;
|
||||
frc::Trajectory m_trajectory;
|
||||
frc::RamseteController m_ramsete;
|
||||
frc::LTVUnicycleController m_feedback{20_ms};
|
||||
frc::Timer m_timer;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user