6#include <frc2/command/Command.h>
7#include <frc2/command/CommandHelper.h>
11#include "choreo/lib/ChoreoTrajectory.h"
16using ChoreoControllerFunction =
17 std::function<frc::ChassisSpeeds(frc::Pose2d, ChoreoTrajectoryState)>;
23 :
public frc2::CommandHelper<frc2::Command, ChoreoSwerveCommand> {
41 ChoreoControllerFunction controller,
42 std::function<
void(frc::ChassisSpeeds)> outputChassisSpeeds,
43 std::function<
bool(
void)> mirrorTrajectory,
44 frc2::Requirements requirements = {});
53 void End(
bool interrupted)
override;
61 std::function<frc::Pose2d()> m_pose;
62 ChoreoControllerFunction m_controller;
63 std::function<void(frc::ChassisSpeeds)> m_outputChassisSpeeds;
64 std::function<bool(
void)> m_mirrorTrajectory;
Definition ChoreoSwerveCommand.h:23
void Execute() override
Runs every robot periodic loop while the command is running.
Definition ChoreoSwerveCommand.cpp:28
void End(bool interrupted) override
Runs once after IsFinished() returns true.
Definition ChoreoSwerveCommand.cpp:36
bool IsFinished() override
Command will end once this returns true.
Definition ChoreoSwerveCommand.cpp:41
ChoreoSwerveCommand(ChoreoTrajectory trajectory, std::function< frc::Pose2d()> poseSupplier, ChoreoControllerFunction controller, std::function< void(frc::ChassisSpeeds)> outputChassisSpeeds, std::function< bool(void)> mirrorTrajectory, frc2::Requirements requirements={})
Definition ChoreoSwerveCommand.cpp:9
void Initialize() override
Runs once before the first call to Execute()
Definition ChoreoSwerveCommand.cpp:23
Definition ChoreoTrajectory.h:13