114 for (
size_t i = 0; i < modulesToApply.size(); ++i) {
115 modulesToApply[i]->Apply(moduleRequest.WithVelocity({0_mps, parameters.moduleLocations[i].Angle()}));
131 this->DriveRequestType = std::move(newDriveRequestType);
144 this->DriveRequestType = std::move(newDriveRequestType);
145 return std::move(*
this);
158 this->SteerRequestType = std::move(newSteerRequestType);
171 this->SteerRequestType = std::move(newSteerRequestType);
172 return std::move(*
this);
249 Translation2d tmp{toApplyX * 1_s, toApplyY * 1_s};
251 toApplyX = tmp.X() / 1_s;
252 toApplyY = tmp.Y() / 1_s;
255 if (wpi::units::math::hypot(toApplyX, toApplyY) <
Deadband) {
260 toApplyOmega = 0_rad_per_s;
263 auto const velocity = ChassisVelocities{toApplyX, toApplyY, toApplyOmega}
264 .ToRobotRelative(parameters.
currentPose.Rotation())
276 for (
size_t i = 0; i < modulesToApply.size(); ++i) {
277 modulesToApply[i]->Apply(moduleRequest.WithVelocity(moduleVelocities[i]));
294 this->VelocityX = std::move(newVelocityX);
308 this->VelocityX = std::move(newVelocityX);
309 return std::move(*
this);
324 this->VelocityY = std::move(newVelocityY);
339 this->VelocityY = std::move(newVelocityY);
340 return std::move(*
this);
354 this->RotationalRate = std::move(newRotationalRate);
368 this->RotationalRate = std::move(newRotationalRate);
369 return std::move(*
this);
382 this->Deadband = std::move(newDeadband);
395 this->Deadband = std::move(newDeadband);
396 return std::move(*
this);
409 this->RotationalDeadband = std::move(newRotationalDeadband);
422 this->RotationalDeadband = std::move(newRotationalDeadband);
423 return std::move(*
this);
437 this->CenterOfRotation = std::move(newCenterOfRotation);
451 this->CenterOfRotation = std::move(newCenterOfRotation);
452 return std::move(*
this);
465 this->DriveRequestType = std::move(newDriveRequestType);
478 this->DriveRequestType = std::move(newDriveRequestType);
479 return std::move(*
this);
492 this->SteerRequestType = std::move(newSteerRequestType);
505 this->SteerRequestType = std::move(newSteerRequestType);
506 return std::move(*
this);
520 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
534 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
535 return std::move(*
this);
548 this->ForwardPerspective = std::move(newForwardPerspective);
561 this->ForwardPerspective = std::move(newForwardPerspective);
562 return std::move(*
this);
632 if (wpi::units::math::hypot(toApplyX, toApplyY) <
Deadband) {
637 toApplyOmega = 0_rad_per_s;
639 ChassisVelocities
const velocity{toApplyX, toApplyY, toApplyOmega};
650 for (
size_t i = 0; i < modulesToApply.size(); ++i) {
651 modulesToApply[i]->Apply(moduleRequest.WithVelocity(moduleVelocities[i]));
668 this->VelocityX = std::move(newVelocityX);
682 this->VelocityX = std::move(newVelocityX);
683 return std::move(*
this);
698 this->VelocityY = std::move(newVelocityY);
713 this->VelocityY = std::move(newVelocityY);
714 return std::move(*
this);
728 this->RotationalRate = std::move(newRotationalRate);
742 this->RotationalRate = std::move(newRotationalRate);
743 return std::move(*
this);
756 this->Deadband = std::move(newDeadband);
769 this->Deadband = std::move(newDeadband);
770 return std::move(*
this);
783 this->RotationalDeadband = std::move(newRotationalDeadband);
796 this->RotationalDeadband = std::move(newRotationalDeadband);
797 return std::move(*
this);
811 this->CenterOfRotation = std::move(newCenterOfRotation);
825 this->CenterOfRotation = std::move(newCenterOfRotation);
826 return std::move(*
this);
839 this->DriveRequestType = std::move(newDriveRequestType);
852 this->DriveRequestType = std::move(newDriveRequestType);
853 return std::move(*
this);
866 this->SteerRequestType = std::move(newSteerRequestType);
879 this->SteerRequestType = std::move(newSteerRequestType);
880 return std::move(*
this);
894 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
908 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
909 return std::move(*
this);
938 for (
size_t i = 0; i < modulesToApply.size(); ++i) {
939 modulesToApply[i]->Apply(moduleRequest.WithVelocity({0_mps, ModuleDirection}));
956 this->ModuleDirection = std::move(newModuleDirection);
970 this->ModuleDirection = std::move(newModuleDirection);
971 return std::move(*
this);
984 this->DriveRequestType = std::move(newDriveRequestType);
997 this->DriveRequestType = std::move(newDriveRequestType);
998 return std::move(*
this);
1011 this->SteerRequestType = std::move(newSteerRequestType);
1024 this->SteerRequestType = std::move(newSteerRequestType);
1025 return std::move(*
this);
1095 for (
size_t i = 0; i < modulesToApply.size(); ++i) {
1100 modulesToApply[i]->Apply(moduleRequest.WithVelocity(moduleVelocities[i]));
1117 this->Velocity = std::move(newVelocity);
1131 this->Velocity = std::move(newVelocity);
1132 return std::move(*
this);
1152 this->WheelForceFeedforwardsX = std::move(newWheelForceFeedforwardsX);
1172 this->WheelForceFeedforwardsX = std::move(newWheelForceFeedforwardsX);
1173 return std::move(*
this);
1193 this->WheelForceFeedforwardsY = std::move(newWheelForceFeedforwardsY);
1213 this->WheelForceFeedforwardsY = std::move(newWheelForceFeedforwardsY);
1214 return std::move(*
this);
1228 this->CenterOfRotation = std::move(newCenterOfRotation);
1242 this->CenterOfRotation = std::move(newCenterOfRotation);
1243 return std::move(*
this);
1256 this->DriveRequestType = std::move(newDriveRequestType);
1269 this->DriveRequestType = std::move(newDriveRequestType);
1270 return std::move(*
this);
1283 this->SteerRequestType = std::move(newSteerRequestType);
1296 this->SteerRequestType = std::move(newSteerRequestType);
1297 return std::move(*
this);
1311 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
1325 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
1326 return std::move(*
this);
1393 fieldVelocity.vx = tmp.X() / 1_s;
1394 fieldVelocity.vy = tmp.Y() / 1_s;
1397 auto const robotVelocity = fieldVelocity
1398 .ToRobotRelative(parameters.
currentPose.Rotation())
1411 for (
size_t i = 0; i < modulesToApply.size(); ++i) {
1416 Translation2d tmp{wheelForceFeedforwardX * 1_m/1_N, wheelForceFeedforwardY * 1_m/1_N};
1422 tmp = tmp.RotateBy(-parameters.
currentPose.Rotation());
1424 wheelForceFeedforwardX = tmp.X() * 1_N/1_m;
1425 wheelForceFeedforwardY = tmp.Y() * 1_N/1_m;
1427 moduleRequest.WithWheelForceFeedforwardX(wheelForceFeedforwardX)
1428 .WithWheelForceFeedforwardY(wheelForceFeedforwardY);
1431 modulesToApply[i]->Apply(moduleRequest.WithVelocity(moduleVelocities[i]));
1447 this->Velocity = std::move(newVelocity);
1460 this->Velocity = std::move(newVelocity);
1461 return std::move(*
this);
1481 this->WheelForceFeedforwardsX = std::move(newWheelForceFeedforwardsX);
1501 this->WheelForceFeedforwardsX = std::move(newWheelForceFeedforwardsX);
1502 return std::move(*
this);
1522 this->WheelForceFeedforwardsY = std::move(newWheelForceFeedforwardsY);
1542 this->WheelForceFeedforwardsY = std::move(newWheelForceFeedforwardsY);
1543 return std::move(*
this);
1557 this->CenterOfRotation = std::move(newCenterOfRotation);
1571 this->CenterOfRotation = std::move(newCenterOfRotation);
1572 return std::move(*
this);
1585 this->DriveRequestType = std::move(newDriveRequestType);
1598 this->DriveRequestType = std::move(newDriveRequestType);
1599 return std::move(*
this);
1612 this->SteerRequestType = std::move(newSteerRequestType);
1625 this->SteerRequestType = std::move(newSteerRequestType);
1626 return std::move(*
this);
1640 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
1654 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
1655 return std::move(*
this);
1668 this->ForwardPerspective = std::move(newForwardPerspective);
1681 this->ForwardPerspective = std::move(newForwardPerspective);
1682 return std::move(*
this);
1786 HeadingController.EnableContinuousInput(-wpi::units::constants::detail::PI_VAL, wpi::units::constants::detail::PI_VAL);
1802 parameters.
currentPose.Rotation().Radians().value(),
1803 angleToFace.Radians().value(),
1825 .
Apply(parameters, modulesToApply);
1845 this->HeadingController.
SetPID(kP, kI, kD);
1860 this->VelocityX = std::move(newVelocityX);
1876 this->VelocityY = std::move(newVelocityY);
1892 this->TargetDirection = std::move(newTargetDirection);
1909 this->TargetRateFeedforward = std::move(newTargetRateFeedforward);
1923 this->Deadband = std::move(newDeadband);
1937 this->RotationalDeadband = std::move(newRotationalDeadband);
1952 this->MaxAbsRotationalRate = std::move(newMaxAbsRotationalRate);
1967 this->CenterOfRotation = std::move(newCenterOfRotation);
1981 this->DriveRequestType = std::move(newDriveRequestType);
1995 this->SteerRequestType = std::move(newSteerRequestType);
2010 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
2024 this->ForwardPerspective = std::move(newForwardPerspective);
2040 this->TargetDirectionPerspective = std::move(newTargetDirectionPerspective);
2141 HeadingController.EnableContinuousInput(-wpi::units::constants::detail::PI_VAL, wpi::units::constants::detail::PI_VAL);
2154 parameters.
currentPose.Rotation().Radians().value(),
2155 angleToFace.Radians().value(),
2176 .
Apply(parameters, modulesToApply);
2196 this->HeadingController.
SetPID(kP, kI, kD);
2211 this->VelocityX = std::move(newVelocityX);
2227 this->VelocityY = std::move(newVelocityY);
2243 this->TargetDirection = std::move(newTargetDirection);
2260 this->TargetRateFeedforward = std::move(newTargetRateFeedforward);
2274 this->Deadband = std::move(newDeadband);
2288 this->RotationalDeadband = std::move(newRotationalDeadband);
2303 this->MaxAbsRotationalRate = std::move(newMaxAbsRotationalRate);
2318 this->CenterOfRotation = std::move(newCenterOfRotation);
2332 this->DriveRequestType = std::move(newDriveRequestType);
2346 this->SteerRequestType = std::move(newSteerRequestType);
2361 this->DesaturateWheelVelocities = std::move(newDesaturateWheelVelocities);
2376 this->ForwardPerspective = std::move(newForwardPerspective);
2394 for (
size_t i = 0; i < modulesToApply.size(); ++i) {
2395 switch (modulesToApply[i]->GetSteerClosedLoopOutputType()) {
2397 modulesToApply[i]->Apply(
2403 modulesToApply[i]->Apply(
2421 this->VoltsToApply = volts;
2432 this->VoltsToApply = volts;
2433 return std::move(*
this);
2461 for (
size_t i = 0; i < modulesToApply.size(); ++i) {
2463 auto const driveVoltage = velocity / parameters.
kMaxSpeed * 12_V;
2465 auto const angle = parameters.
moduleLocations[i].Angle() + Rotation2d{90_deg};
2467 switch (modulesToApply[i]->GetSteerClosedLoopOutputType()) {
2469 modulesToApply[i]->Apply(
2475 modulesToApply[i]->Apply(
2493 this->RotationalRate = rotationalRate;
2504 this->RotationalRate = rotationalRate;
2505 return std::move(*
this);
2522 for (
size_t i = 0; i < modulesToApply.size(); ++i) {
2536 this->VoltsToApply = volts;
2547 this->VoltsToApply = volts;
2548 return std::move(*
this);
Request coast neutral output of actuator.
Definition CoastOut.hpp:21
Requires Phoenix Pro; Request PID to target position with torque current feedforward.
Definition PositionTorqueCurrentFOC.hpp:27
Request PID to target position with voltage feedforward.
Definition PositionVoltage.hpp:26
Request a specified voltage.
Definition VoltageOut.hpp:24
Phoenix-centric PID controller taken from WPI's wpi::math::PIDController class.
Definition PhoenixPIDController.hpp:22
void SetPID(double Kp, double Ki, double Kd)
Sets the PID Controller gain parameters.
WheelVelocities ToSwerveModuleVelocities(ChassisVelocities const &chassisVelocities, Translation2d const ¢erOfRotation=Translation2d{}) const
Performs inverse kinematics to return the module states from a desired chassis velocity.
static WheelVelocities DesaturateWheelVelocities(WheelVelocities const &moduleVelocities, wpi::units::meters_per_second_t attainableMaxVelocity)
Renormalizes the wheel velocities if any individual velocity is above the specified maximum.
Accepts a generic field-centric ChassisVelocities to apply to the drivetrain.
Definition SwerveRequest.hpp:1335
ChassisVelocities Velocity
The field-centric chassis velocity to apply to the drivetrain.
Definition SwerveRequest.hpp:1340
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:1386
ApplyFieldVelocity && WithWheelForceFeedforwardsY(std::vector< wpi::units::newton_t > newWheelForceFeedforwardsY) &&
Modifies the WheelForceFeedforwardsY parameter and returns itself.
Definition SwerveRequest.hpp:1540
ApplyFieldVelocity & WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1583
ApplyFieldVelocity & WithCenterOfRotation(Translation2d newCenterOfRotation) &
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:1555
bool DesaturateWheelVelocities
Whether to desaturate wheel velocities before applying.
Definition SwerveRequest.hpp:1379
ApplyFieldVelocity && WithVelocity(ChassisVelocities newVelocity) &&
Modifies the Velocity parameter and returns itself.
Definition SwerveRequest.hpp:1458
std::vector< wpi::units::newton_t > WheelForceFeedforwardsY
Field-centric wheel force feedforwards to apply in the Y direction.
Definition SwerveRequest.hpp:1362
ApplyFieldVelocity && WithCenterOfRotation(Translation2d newCenterOfRotation) &&
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:1569
impl::SteerRequestType SteerRequestType
The type of control request to use for the steer motor.
Definition SwerveRequest.hpp:1374
impl::DriveRequestType DriveRequestType
The type of control request to use for the drive motor.
Definition SwerveRequest.hpp:1370
Translation2d CenterOfRotation
The center of rotation to rotate around.
Definition SwerveRequest.hpp:1366
ApplyFieldVelocity & WithForwardPerspective(ForwardPerspectiveValue newForwardPerspective) &
Modifies the ForwardPerspective parameter and returns itself.
Definition SwerveRequest.hpp:1666
ApplyFieldVelocity & WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities) &
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:1638
ApplyFieldVelocity & WithWheelForceFeedforwardsY(std::vector< wpi::units::newton_t > newWheelForceFeedforwardsY) &
Modifies the WheelForceFeedforwardsY parameter and returns itself.
Definition SwerveRequest.hpp:1520
ApplyFieldVelocity && WithForwardPerspective(ForwardPerspectiveValue newForwardPerspective) &&
Modifies the ForwardPerspective parameter and returns itself.
Definition SwerveRequest.hpp:1679
ApplyFieldVelocity && WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &&
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1596
ApplyFieldVelocity & WithWheelForceFeedforwardsX(std::vector< wpi::units::newton_t > newWheelForceFeedforwardsX) &
Modifies the WheelForceFeedforwardsX parameter and returns itself.
Definition SwerveRequest.hpp:1479
ApplyFieldVelocity && WithWheelForceFeedforwardsX(std::vector< wpi::units::newton_t > newWheelForceFeedforwardsX) &&
Modifies the WheelForceFeedforwardsX parameter and returns itself.
Definition SwerveRequest.hpp:1499
ApplyFieldVelocity & WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1610
ApplyFieldVelocity & WithVelocity(ChassisVelocities newVelocity) &
Modifies the Velocity parameter and returns itself.
Definition SwerveRequest.hpp:1445
ApplyFieldVelocity && WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities) &&
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:1652
std::vector< wpi::units::newton_t > WheelForceFeedforwardsX
Field-centric wheel force feedforwards to apply in the X direction.
Definition SwerveRequest.hpp:1351
ApplyFieldVelocity && WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &&
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1623
ForwardPerspectiveValue ForwardPerspective
The perspective to use when determining which direction is forward.
Definition SwerveRequest.hpp:1384
Accepts a generic robot-centric ChassisVelocities to apply to the drivetrain.
Definition SwerveRequest.hpp:1037
ApplyRobotVelocity & WithWheelForceFeedforwardsY(std::vector< wpi::units::newton_t > newWheelForceFeedforwardsY) &
Modifies the WheelForceFeedforwardsY parameter and returns itself.
Definition SwerveRequest.hpp:1191
ApplyRobotVelocity && WithCenterOfRotation(Translation2d newCenterOfRotation) &&
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:1240
ApplyRobotVelocity && WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &&
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1267
ApplyRobotVelocity & WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities) &
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:1309
ApplyRobotVelocity && WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &&
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1294
impl::DriveRequestType DriveRequestType
The type of control request to use for the drive motor.
Definition SwerveRequest.hpp:1073
ApplyRobotVelocity && WithWheelForceFeedforwardsY(std::vector< wpi::units::newton_t > newWheelForceFeedforwardsY) &&
Modifies the WheelForceFeedforwardsY parameter and returns itself.
Definition SwerveRequest.hpp:1211
ApplyRobotVelocity && WithVelocity(ChassisVelocities newVelocity) &&
Modifies the Velocity parameter and returns itself.
Definition SwerveRequest.hpp:1129
std::vector< wpi::units::newton_t > WheelForceFeedforwardsY
Robot-centric wheel force feedforwards to apply in the Y direction.
Definition SwerveRequest.hpp:1065
Translation2d CenterOfRotation
The center of rotation to rotate around.
Definition SwerveRequest.hpp:1069
ApplyRobotVelocity && WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities) &&
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:1323
ApplyRobotVelocity & WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1281
std::vector< wpi::units::newton_t > WheelForceFeedforwardsX
Robot-centric wheel force feedforwards to apply in the X direction.
Definition SwerveRequest.hpp:1054
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:1084
ChassisVelocities Velocity
The robot-centric chassis velocity to apply to the drivetrain.
Definition SwerveRequest.hpp:1043
ApplyRobotVelocity & WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1254
bool DesaturateWheelVelocities
Whether to desaturate wheel velocities before applying.
Definition SwerveRequest.hpp:1082
ApplyRobotVelocity & WithWheelForceFeedforwardsX(std::vector< wpi::units::newton_t > newWheelForceFeedforwardsX) &
Modifies the WheelForceFeedforwardsX parameter and returns itself.
Definition SwerveRequest.hpp:1150
impl::SteerRequestType SteerRequestType
The type of control request to use for the steer motor.
Definition SwerveRequest.hpp:1077
ApplyRobotVelocity && WithWheelForceFeedforwardsX(std::vector< wpi::units::newton_t > newWheelForceFeedforwardsX) &&
Modifies the WheelForceFeedforwardsX parameter and returns itself.
Definition SwerveRequest.hpp:1170
ApplyRobotVelocity & WithVelocity(ChassisVelocities newVelocity) &
Modifies the Velocity parameter and returns itself.
Definition SwerveRequest.hpp:1115
ApplyRobotVelocity & WithCenterOfRotation(Translation2d newCenterOfRotation) &
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:1226
TargetDirectionPerspectiveValue TargetDirectionPerspective
The perspective to use when determining which direction is forward for the TargetDirection.
Definition SwerveRequest.hpp:1771
FieldCentricFacingAngle & WithTargetRateFeedforward(wpi::units::radians_per_second_t newTargetRateFeedforward)
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:1907
wpi::units::meters_per_second_t Deadband
The allowable deadband of the request.
Definition SwerveRequest.hpp:1732
FieldCentricFacingAngle & WithTargetDirectionPerspective(TargetDirectionPerspectiveValue newTargetDirectionPerspective)
Modifies the TargetDirectionPerspective parameter and returns itself.
Definition SwerveRequest.hpp:2038
FieldCentricFacingAngle & WithSteerRequestType(impl::SteerRequestType newSteerRequestType)
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1993
wpi::units::radians_per_second_t MaxAbsRotationalRate
The maximum absolute rotational rate to allow.
Definition SwerveRequest.hpp:1741
Rotation2d TargetDirection
The desired direction to face.
Definition SwerveRequest.hpp:1720
bool DesaturateWheelVelocities
Whether to desaturate wheel velocities before applying.
Definition SwerveRequest.hpp:1760
FieldCentricFacingAngle & WithForwardPerspective(ForwardPerspectiveValue newForwardPerspective)
Modifies the ForwardPerspective parameter and returns itself.
Definition SwerveRequest.hpp:2022
FieldCentricFacingAngle & WithTargetDirection(Rotation2d newTargetDirection)
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:1890
FieldCentricFacingAngle & WithDeadband(wpi::units::meters_per_second_t newDeadband)
Modifies the Deadband parameter and returns itself.
Definition SwerveRequest.hpp:1921
impl::SteerRequestType SteerRequestType
The type of control request to use for the steer motor.
Definition SwerveRequest.hpp:1755
FieldCentricFacingAngle & WithRotationalDeadband(wpi::units::radians_per_second_t newRotationalDeadband)
Modifies the RotationalDeadband parameter and returns itself.
Definition SwerveRequest.hpp:1935
FieldCentricFacingAngle & WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities)
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:2008
wpi::units::meters_per_second_t VelocityY
The velocity in the Y direction.
Definition SwerveRequest.hpp:1713
PhoenixPIDController HeadingController
The PID controller used to maintain the desired heading.
Definition SwerveRequest.hpp:1782
impl::DriveRequestType DriveRequestType
The type of control request to use for the drive motor.
Definition SwerveRequest.hpp:1751
Translation2d CenterOfRotation
The center of rotation the robot should rotate around.
Definition SwerveRequest.hpp:1746
FieldCentricFacingAngle & WithMaxAbsRotationalRate(wpi::units::radians_per_second_t newMaxAbsRotationalRate)
Modifies the MaxAbsRotationalRate parameter and returns itself.
Definition SwerveRequest.hpp:1950
FieldCentricFacingAngle()
Definition SwerveRequest.hpp:1784
wpi::units::radians_per_second_t TargetRateFeedforward
The rotational rate feedforward to add to the output of the heading controller, in radians per second...
Definition SwerveRequest.hpp:1727
FieldCentricFacingAngle & WithVelocityX(wpi::units::meters_per_second_t newVelocityX)
Modifies the VelocityX parameter and returns itself.
Definition SwerveRequest.hpp:1858
wpi::units::radians_per_second_t RotationalDeadband
The rotational deadband of the request.
Definition SwerveRequest.hpp:1736
FieldCentricFacingAngle & WithVelocityY(wpi::units::meters_per_second_t newVelocityY)
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:1874
FieldCentricFacingAngle & WithDriveRequestType(impl::DriveRequestType newDriveRequestType)
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1979
wpi::units::meters_per_second_t VelocityX
The velocity in the X direction.
Definition SwerveRequest.hpp:1707
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:1789
FieldCentricFacingAngle & WithCenterOfRotation(Translation2d newCenterOfRotation)
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:1965
FieldCentricFacingAngle & WithHeadingPID(double kP, double kI, double kD)
Modifies the PID gains of the HeadingController parameter and returns itself.
Definition SwerveRequest.hpp:1843
ForwardPerspectiveValue ForwardPerspective
The perspective to use when determining which direction is forward.
Definition SwerveRequest.hpp:1765
Drives the swerve drivetrain in a field-centric manner.
Definition SwerveRequest.hpp:189
FieldCentric & WithRotationalRate(wpi::units::radians_per_second_t newRotationalRate) &
Modifies the RotationalRate parameter and returns itself.
Definition SwerveRequest.hpp:352
FieldCentric && WithCenterOfRotation(Translation2d newCenterOfRotation) &&
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:449
wpi::units::meters_per_second_t Deadband
The allowable deadband of the request.
Definition SwerveRequest.hpp:211
FieldCentric & WithCenterOfRotation(Translation2d newCenterOfRotation) &
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:435
wpi::units::meters_per_second_t VelocityY
The velocity in the Y direction.
Definition SwerveRequest.hpp:201
FieldCentric && WithDeadband(wpi::units::meters_per_second_t newDeadband) &&
Modifies the Deadband parameter and returns itself.
Definition SwerveRequest.hpp:393
FieldCentric && WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &&
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:503
bool DesaturateWheelVelocities
Whether to desaturate wheel velocities before applying.
Definition SwerveRequest.hpp:234
FieldCentric & WithForwardPerspective(ForwardPerspectiveValue newForwardPerspective) &
Modifies the ForwardPerspective parameter and returns itself.
Definition SwerveRequest.hpp:546
FieldCentric & WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities) &
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:518
FieldCentric && WithRotationalDeadband(wpi::units::radians_per_second_t newRotationalDeadband) &&
Modifies the RotationalDeadband parameter and returns itself.
Definition SwerveRequest.hpp:420
FieldCentric & WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:490
FieldCentric && WithVelocityY(wpi::units::meters_per_second_t newVelocityY) &&
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:337
FieldCentric && WithForwardPerspective(ForwardPerspectiveValue newForwardPerspective) &&
Modifies the ForwardPerspective parameter and returns itself.
Definition SwerveRequest.hpp:559
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:241
impl::DriveRequestType DriveRequestType
The type of control request to use for the drive motor.
Definition SwerveRequest.hpp:225
FieldCentric & WithRotationalDeadband(wpi::units::radians_per_second_t newRotationalDeadband) &
Modifies the RotationalDeadband parameter and returns itself.
Definition SwerveRequest.hpp:407
FieldCentric && WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities) &&
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:532
Translation2d CenterOfRotation
The center of rotation the robot should rotate around.
Definition SwerveRequest.hpp:220
wpi::units::radians_per_second_t RotationalRate
The angular rate to rotate at.
Definition SwerveRequest.hpp:207
ForwardPerspectiveValue ForwardPerspective
The perspective to use when determining which direction is forward.
Definition SwerveRequest.hpp:239
impl::SteerRequestType SteerRequestType
The type of control request to use for the steer motor.
Definition SwerveRequest.hpp:229
FieldCentric && WithRotationalRate(wpi::units::radians_per_second_t newRotationalRate) &&
Modifies the RotationalRate parameter and returns itself.
Definition SwerveRequest.hpp:366
wpi::units::radians_per_second_t RotationalDeadband
The rotational deadband of the request.
Definition SwerveRequest.hpp:215
FieldCentric & WithDeadband(wpi::units::meters_per_second_t newDeadband) &
Modifies the Deadband parameter and returns itself.
Definition SwerveRequest.hpp:380
FieldCentric && WithVelocityX(wpi::units::meters_per_second_t newVelocityX) &&
Modifies the VelocityX parameter and returns itself.
Definition SwerveRequest.hpp:306
FieldCentric & WithVelocityX(wpi::units::meters_per_second_t newVelocityX) &
Modifies the VelocityX parameter and returns itself.
Definition SwerveRequest.hpp:292
FieldCentric & WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:463
wpi::units::meters_per_second_t VelocityX
The velocity in the X direction.
Definition SwerveRequest.hpp:195
FieldCentric & WithVelocityY(wpi::units::meters_per_second_t newVelocityY) &
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:322
FieldCentric && WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &&
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:476
Does nothing to the swerve module state.
Definition SwerveRequest.hpp:84
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const &, std::span< std::unique_ptr< impl::SwerveModuleImpl > const >) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:86
Sets the swerve drive modules to point to a specified direction.
Definition SwerveRequest.hpp:916
impl::DriveRequestType DriveRequestType
The type of control request to use for the drive motor.
Definition SwerveRequest.hpp:926
PointWheelsAt && WithModuleDirection(Rotation2d newModuleDirection) &&
Modifies the ModuleDirection parameter and returns itself.
Definition SwerveRequest.hpp:968
PointWheelsAt && WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &&
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:995
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:932
impl::SteerRequestType SteerRequestType
The type of control request to use for the steer motor.
Definition SwerveRequest.hpp:930
PointWheelsAt && WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &&
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1022
PointWheelsAt & WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:982
PointWheelsAt & WithModuleDirection(Rotation2d newModuleDirection) &
Modifies the ModuleDirection parameter and returns itself.
Definition SwerveRequest.hpp:954
Rotation2d ModuleDirection
The direction to point the modules toward.
Definition SwerveRequest.hpp:922
PointWheelsAt & WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:1009
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:2144
wpi::units::radians_per_second_t RotationalDeadband
The rotational deadband of the request.
Definition SwerveRequest.hpp:2096
wpi::units::meters_per_second_t VelocityY
The velocity in the Y direction.
Definition SwerveRequest.hpp:2073
ForwardPerspectiveValue ForwardPerspective
The perspective to use when determining which direction is forward for the target heading.
Definition SwerveRequest.hpp:2126
Translation2d CenterOfRotation
The center of rotation the robot should rotate around.
Definition SwerveRequest.hpp:2106
RobotCentricFacingAngle & WithMaxAbsRotationalRate(wpi::units::radians_per_second_t newMaxAbsRotationalRate)
Modifies the MaxAbsRotationalRate parameter and returns itself.
Definition SwerveRequest.hpp:2301
impl::SteerRequestType SteerRequestType
The type of control request to use for the steer motor.
Definition SwerveRequest.hpp:2115
RobotCentricFacingAngle & WithTargetRateFeedforward(wpi::units::radians_per_second_t newTargetRateFeedforward)
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:2258
RobotCentricFacingAngle & WithVelocityY(wpi::units::meters_per_second_t newVelocityY)
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:2225
RobotCentricFacingAngle & WithSteerRequestType(impl::SteerRequestType newSteerRequestType)
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:2344
RobotCentricFacingAngle & WithForwardPerspective(ForwardPerspectiveValue newForwardPerspective)
Modifies the ForwardPerspective parameter and returns itself.
Definition SwerveRequest.hpp:2374
bool DesaturateWheelVelocities
Whether to desaturate wheel velocities before applying.
Definition SwerveRequest.hpp:2120
RobotCentricFacingAngle()
Definition SwerveRequest.hpp:2139
RobotCentricFacingAngle & WithHeadingPID(double kP, double kI, double kD)
Modifies the PID gains of the HeadingController parameter and returns itself.
Definition SwerveRequest.hpp:2194
PhoenixPIDController HeadingController
The PID controller used to maintain the desired heading.
Definition SwerveRequest.hpp:2137
RobotCentricFacingAngle & WithRotationalDeadband(wpi::units::radians_per_second_t newRotationalDeadband)
Modifies the RotationalDeadband parameter and returns itself.
Definition SwerveRequest.hpp:2286
RobotCentricFacingAngle & WithCenterOfRotation(Translation2d newCenterOfRotation)
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:2316
RobotCentricFacingAngle & WithTargetDirection(Rotation2d newTargetDirection)
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:2241
wpi::units::radians_per_second_t MaxAbsRotationalRate
The maximum absolute rotational rate to allow.
Definition SwerveRequest.hpp:2101
Rotation2d TargetDirection
The desired direction to face.
Definition SwerveRequest.hpp:2080
RobotCentricFacingAngle & WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities)
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:2359
RobotCentricFacingAngle & WithDeadband(wpi::units::meters_per_second_t newDeadband)
Modifies the Deadband parameter and returns itself.
Definition SwerveRequest.hpp:2272
wpi::units::meters_per_second_t VelocityX
The velocity in the X direction.
Definition SwerveRequest.hpp:2067
wpi::units::meters_per_second_t Deadband
The allowable deadband of the request.
Definition SwerveRequest.hpp:2092
RobotCentricFacingAngle & WithVelocityX(wpi::units::meters_per_second_t newVelocityX)
Modifies the VelocityX parameter and returns itself.
Definition SwerveRequest.hpp:2209
impl::DriveRequestType DriveRequestType
The type of control request to use for the drive motor.
Definition SwerveRequest.hpp:2111
wpi::units::radians_per_second_t TargetRateFeedforward
The rotational rate feedforward to add to the output of the heading controller, in radians per second...
Definition SwerveRequest.hpp:2087
RobotCentricFacingAngle & WithDriveRequestType(impl::DriveRequestType newDriveRequestType)
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:2330
Drives the swerve drivetrain in a robot-centric manner.
Definition SwerveRequest.hpp:579
RobotCentric & WithCenterOfRotation(Translation2d newCenterOfRotation) &
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:809
RobotCentric & WithDeadband(wpi::units::meters_per_second_t newDeadband) &
Modifies the Deadband parameter and returns itself.
Definition SwerveRequest.hpp:754
RobotCentric && WithVelocityY(wpi::units::meters_per_second_t newVelocityY) &&
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:711
RobotCentric & WithVelocityX(wpi::units::meters_per_second_t newVelocityX) &
Modifies the VelocityX parameter and returns itself.
Definition SwerveRequest.hpp:666
RobotCentric & WithRotationalRate(wpi::units::radians_per_second_t newRotationalRate) &
Modifies the RotationalRate parameter and returns itself.
Definition SwerveRequest.hpp:726
impl::DriveRequestType DriveRequestType
The type of control request to use for the drive motor.
Definition SwerveRequest.hpp:616
RobotCentric && WithRotationalDeadband(wpi::units::radians_per_second_t newRotationalDeadband) &&
Modifies the RotationalDeadband parameter and returns itself.
Definition SwerveRequest.hpp:794
wpi::units::radians_per_second_t RotationalDeadband
The rotational deadband of the request.
Definition SwerveRequest.hpp:606
RobotCentric & WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities) &
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:892
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:627
wpi::units::meters_per_second_t VelocityX
The velocity in the X direction.
Definition SwerveRequest.hpp:585
RobotCentric && WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &&
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:877
RobotCentric && WithVelocityX(wpi::units::meters_per_second_t newVelocityX) &&
Modifies the VelocityX parameter and returns itself.
Definition SwerveRequest.hpp:680
Translation2d CenterOfRotation
The center of rotation the robot should rotate around.
Definition SwerveRequest.hpp:611
RobotCentric && WithCenterOfRotation(Translation2d newCenterOfRotation) &&
Modifies the CenterOfRotation parameter and returns itself.
Definition SwerveRequest.hpp:823
RobotCentric && WithDeadband(wpi::units::meters_per_second_t newDeadband) &&
Modifies the Deadband parameter and returns itself.
Definition SwerveRequest.hpp:767
RobotCentric && WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &&
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:850
bool DesaturateWheelVelocities
Whether to desaturate wheel velocities before applying.
Definition SwerveRequest.hpp:625
wpi::units::radians_per_second_t RotationalRate
The angular rate to rotate at.
Definition SwerveRequest.hpp:597
RobotCentric & WithVelocityY(wpi::units::meters_per_second_t newVelocityY) &
Modifies the VelocityY parameter and returns itself.
Definition SwerveRequest.hpp:696
wpi::units::meters_per_second_t Deadband
The allowable deadband of the request.
Definition SwerveRequest.hpp:602
impl::SteerRequestType SteerRequestType
The type of control request to use for the steer motor.
Definition SwerveRequest.hpp:620
RobotCentric & WithRotationalDeadband(wpi::units::radians_per_second_t newRotationalDeadband) &
Modifies the RotationalDeadband parameter and returns itself.
Definition SwerveRequest.hpp:781
RobotCentric & WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:837
RobotCentric & WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:864
RobotCentric && WithDesaturateWheelVelocities(bool newDesaturateWheelVelocities) &&
Modifies the DesaturateWheelVelocities parameter and returns itself.
Definition SwerveRequest.hpp:906
RobotCentric && WithRotationalRate(wpi::units::radians_per_second_t newRotationalRate) &&
Modifies the RotationalRate parameter and returns itself.
Definition SwerveRequest.hpp:740
wpi::units::meters_per_second_t VelocityY
The velocity in the Y direction.
Definition SwerveRequest.hpp:591
Sets the swerve drive module states to point inward on the robot in an "X" fashion,...
Definition SwerveRequest.hpp:97
SwerveDriveBrake & WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:129
impl::DriveRequestType DriveRequestType
The type of control request to use for the drive motor.
Definition SwerveRequest.hpp:102
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:108
impl::SteerRequestType SteerRequestType
The type of control request to use for the steer motor.
Definition SwerveRequest.hpp:106
SwerveDriveBrake && WithDriveRequestType(impl::DriveRequestType newDriveRequestType) &&
Modifies the DriveRequestType parameter and returns itself.
Definition SwerveRequest.hpp:142
SwerveDriveBrake && WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &&
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:169
SwerveDriveBrake & WithSteerRequestType(impl::SteerRequestType newSteerRequestType) &
Modifies the SteerRequestType parameter and returns itself.
Definition SwerveRequest.hpp:156
Container for all the Swerve Requests.
Definition SwerveRequest.hpp:63
impl::SwerveDrivetrainImpl::ControlParameters ControlParameters
Definition SwerveRequest.hpp:65
virtual ~SwerveRequest()=default
virtual ctre::phoenix::StatusCode Apply(ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply)=0
Applies this swerve request to the given modules.
SysId-specific SwerveRequest to characterize the rotational characteristics of a swerve drivetrain.
Definition SwerveRequest.hpp:2452
SysIdSwerveRotation & WithRotationalRate(wpi::units::radians_per_second_t rotationalRate) &
Update the angular rate to rotate at, in radians per second.
Definition SwerveRequest.hpp:2491
SysIdSwerveRotation && WithRotationalRate(wpi::units::radians_per_second_t rotationalRate) &&
Update the angular rate to rotate at, in radians per second.
Definition SwerveRequest.hpp:2502
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:2459
wpi::units::radians_per_second_t RotationalRate
The angular rate to rotate at, in radians per second.
Definition SwerveRequest.hpp:2457
SysId-specific SwerveRequest to characterize the steer module characteristics of a swerve drivetrain.
Definition SwerveRequest.hpp:2513
wpi::units::volt_t VoltsToApply
Voltage to apply to drive wheels.
Definition SwerveRequest.hpp:2518
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:2520
SysIdSwerveSteerGains & WithVolts(wpi::units::volt_t volts) &
Update the voltage to apply to the drive wheels.
Definition SwerveRequest.hpp:2534
SysIdSwerveSteerGains && WithVolts(wpi::units::volt_t volts) &&
Update the voltage to apply to the drive wheels.
Definition SwerveRequest.hpp:2545
SysId-specific SwerveRequest to characterize the translational characteristics of a swerve drivetrain...
Definition SwerveRequest.hpp:2385
SysIdSwerveTranslation && WithVolts(wpi::units::volt_t volts) &&
Sets the voltage to apply to drive wheels.
Definition SwerveRequest.hpp:2430
wpi::units::volt_t VoltsToApply
Voltage to apply to drive wheels.
Definition SwerveRequest.hpp:2390
ctre::phoenix::StatusCode Apply(SwerveRequest::ControlParameters const ¶meters, std::span< std::unique_ptr< impl::SwerveModuleImpl > const > modulesToApply) override
Applies this swerve request to the given modules.
Definition SwerveRequest.hpp:2392
SysIdSwerveTranslation & WithVolts(wpi::units::volt_t volts) &
Sets the voltage to apply to drive wheels.
Definition SwerveRequest.hpp:2419
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
static constexpr int OK
No Error.
Definition StatusCodes.h:35
SteerRequestType
All possible control requests for the module steer motor.
Definition SwerveModuleImpl.hpp:25
@ Position
Control the drive motor using an unprofiled position request.
Definition SwerveModuleImpl.hpp:35
DriveRequestType
All possible control requests for the module drive motor.
Definition SwerveModuleImpl.hpp:41
@ OpenLoopVoltage
Control the drive motor using an open-loop voltage request.
Definition SwerveModuleImpl.hpp:45
Definition SwerveRequest.hpp:15
ForwardPerspectiveValue
In field-centric control, the direction of "forward" is sometimes different depending on perspective.
Definition SwerveRequest.hpp:21
@ BlueAlliance
"Forward" (positive X) is always from the perspective of the blue alliance (i.e.
Definition SwerveRequest.hpp:36
@ OperatorPerspective
"Forward" (positive X) is determined from the operator's perspective.
Definition SwerveRequest.hpp:29
TargetDirectionPerspectiveValue
In field-centric control, the direction of "forward" for the target direction sometimes differs from ...
Definition SwerveRequest.hpp:43
@ UseForwardPerspective
Match the ForwardPerspective parameter for heading control.
Definition SwerveRequest.hpp:47
Definition SwerveModule.hpp:28
@ TorqueCurrentFOC
Requires Pro.
Definition SwerveModuleConstants.hpp:25
@ Voltage
Definition SwerveModuleConstants.hpp:23
Definition ExternalFeedbackConfigs.hpp:16
Definition motor_constants.h:14
Contains everything the control requests need to calculate the module state.
Definition SwerveDrivetrainImpl.hpp:142
wpi::units::second_t updatePeriod
The update period of control apply.
Definition SwerveDrivetrainImpl.hpp:159
wpi::units::meters_per_second_t kMaxSpeed
The max speed of the robot at 12 V output.
Definition SwerveDrivetrainImpl.hpp:148
impl::SwerveDriveKinematics * kinematics
The kinematics object used for control.
Definition SwerveDrivetrainImpl.hpp:144
Pose2d currentPose
The current pose of the robot.
Definition SwerveDrivetrainImpl.hpp:155
Rotation2d operatorForwardDirection
The forward direction from the operator perspective.
Definition SwerveDrivetrainImpl.hpp:151
Translation2d const * moduleLocations
The locations of the swerve modules.
Definition SwerveDrivetrainImpl.hpp:146
wpi::units::second_t timestamp
The timestamp of the current control apply, in the timebase of utils::GetCurrentTime().
Definition SwerveDrivetrainImpl.hpp:157
Contains everything the swerve module needs to apply a request.
Definition SwerveModuleImpl.hpp:66
ModuleRequest & WithSteerRequest(SteerRequestType newSteerRequest)
Modifies the SteerRequest parameter and returns itself.
Definition SwerveModuleImpl.hpp:190
ModuleRequest & WithDriveRequest(DriveRequestType newDriveRequest)
Modifies the DriveRequest parameter and returns itself.
Definition SwerveModuleImpl.hpp:177
ModuleRequest & WithUpdatePeriod(wpi::units::second_t newUpdatePeriod)
Modifies the UpdatePeriod parameter and returns itself.
Definition SwerveModuleImpl.hpp:205