Drive To Angle
class DriveToAngle(swerveDrive: SwerveDrive, xSupplier: () -> Double, ySupplier: () -> Double, targetAngle: Rotation2d) : Command
Command to drive the robot at a specific heading angle.
This command allows the robot to drive in any direction while maintaining a specific orientation, useful for aiming at targets while moving.
Usage Example:
val driveToAngle = DriveToAngle(
swerveDrive = drive,
xSupplier = { controller.leftY },
ySupplier = { controller.leftX },
targetAngle = Rotation2d.fromDegrees(180.0)
).apply {
configure {
kP = 0.05
kD = 0.001
tolerance = 2.0
}
}Content copied to clipboard
Constructors
Link copied to clipboard
constructor(swerveDrive: SwerveDrive, xSupplier: () -> Double, ySupplier: () -> Double, targetAngle: Rotation2d)
Types
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Configures the drive to angle command using a DSL-style configuration block.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Schedule this command when the provided condition is true.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard