ChoreoLib
Loading...
Searching...
No Matches
choreolib::ChoreoSwerveCommand Class Reference

#include <ChoreoSwerveCommand.h>

Inheritance diagram for choreolib::ChoreoSwerveCommand:

Public Member Functions

 ChoreoSwerveCommand (ChoreoTrajectory trajectory, std::function< frc::Pose2d()> poseSupplier, ChoreoControllerFunction controller, std::function< void(frc::ChassisSpeeds)> outputChassisSpeeds, std::function< bool(void)> mirrorTrajectory, frc2::Requirements requirements={})
 
void Initialize () override
 Runs once before the first call to Execute()
 
void Execute () override
 Runs every robot periodic loop while the command is running.
 
void End (bool interrupted) override
 Runs once after IsFinished() returns true.
 
bool IsFinished () override
 Command will end once this returns true.
 

Detailed Description

A frc2::Command that controls a swerve drivetrain using ChoreoTrajectories

Constructor & Destructor Documentation

◆ ChoreoSwerveCommand()

ChoreoSwerveCommand::ChoreoSwerveCommand ( ChoreoTrajectory trajectory,
std::function< frc::Pose2d()> poseSupplier,
ChoreoControllerFunction controller,
std::function< void(frc::ChassisSpeeds)> outputChassisSpeeds,
std::function< bool(void)> mirrorTrajectory,
frc2::Requirements requirements = {} )

Creates a new ChoreoSwerveCommand that controls a swerve drivetrain

Parameters
trajectorythe ChoreoTrajectory to follow
poseSuppliera function that supplies the current pose of the robot
controllera function that consumes a pose and the current trajectory state, and supplies back robot relative ChassisSpeeds
outputChassisSpeedsa function that consumes robot relative ChassisSpeeds
mirrorTrajectoryIf this returns true, the path will be mirrored to the opposite side, while keeping the same coordinate system origin. This will be called every loop during the command.
requirementssubsystem requirements

The documentation for this class was generated from the following files: