|
ChoreoLib
|
#include <ChoreoSwerveCommand.h>
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. | |
A frc2::Command that controls a swerve drivetrain using ChoreoTrajectories
| 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
| trajectory | the ChoreoTrajectory to follow |
| poseSupplier | a function that supplies the current pose of the robot |
| controller | a function that consumes a pose and the current trajectory state, and supplies back robot relative ChassisSpeeds |
| outputChassisSpeeds | a function that consumes robot relative ChassisSpeeds |
| mirrorTrajectory | If 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. |
| requirements | subsystem requirements |