Align To Target
class AlignToTarget(swerveDrive: SwerveDrive, camera: Camera, translationSpeed: () -> Double = { 0.0 }, strafeSpeed: () -> Double = { 0.0 }) : Command
Command to align the robot to a vision target using rotational control.
This command uses PID control to rotate the robot until it is aligned with a detected target from any camera implementing the Camera interface.
Usage Example:
val alignCommand = AlignToTarget(
swerveDrive = drive,
camera = frontCamera,
translationSpeed = { 0.0 },
strafeSpeed = { 0.0 }
).apply {
configure {
kP = 0.05
toleranceDegrees = 2.0
}
}Content copied to clipboard
Constructors
Link copied to clipboard
constructor(swerveDrive: SwerveDrive, camera: Camera, translationSpeed: () -> Double = { 0.0 }, strafeSpeed: () -> Double = { 0.0 })
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Configures the alignment 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