[examples] C++ RamseteCommand: Fix units (#4954)

Also fix the memory leak in the command-based auto.
This commit is contained in:
Starlight220
2023-01-22 21:20:35 +02:00
committed by GitHub
parent b95d0e060d
commit 893320544a
6 changed files with 25 additions and 33 deletions

View File

@@ -7,11 +7,8 @@
#include <frc/XboxController.h>
#include <frc/controller/PIDController.h>
#include <frc/smartdashboard/SendableChooser.h>
#include <frc2/command/Command.h>
#include <frc2/command/CommandPtr.h>
#include <frc2/command/InstantCommand.h>
#include <frc2/command/PIDCommand.h>
#include <frc2/command/ParallelRaceGroup.h>
#include <frc2/command/RunCommand.h>
#include "Constants.h"
#include "subsystems/DriveSubsystem.h"
@@ -27,7 +24,7 @@ class RobotContainer {
public:
RobotContainer();
frc2::Command* GetAutonomousCommand();
frc2::CommandPtr GetAutonomousCommand();
private:
// The driver's controller
@@ -38,13 +35,11 @@ class RobotContainer {
// The robot's subsystems
DriveSubsystem m_drive;
// RobotContainer-owned commands
frc2::InstantCommand m_driveHalfSpeed{[this] { m_drive.SetMaxOutput(0.5); },
{}};
frc2::InstantCommand m_driveFullSpeed{[this] { m_drive.SetMaxOutput(1); },
{}};
// The chooser for the autonomous routines
frc::SendableChooser<frc2::Command*> m_chooser;
void ConfigureButtonBindings();
};