ResetPoseFromVision

class ResetPoseFromVision(swerveDrive: SwerveDrive, visionSystem: VisionSystem) : Command

Command to reset the robot's pose estimation using vision measurements.

This command uses the best available vision pose estimate to reset the robot's odometry. Useful for re-localizing the robot at the start of autonomous or after significant pose drift.

Usage Example:

val resetPoseCommand = ResetPoseFromVision(
swerveDrive = drive,
visionSystem = visionSystem
).apply {
configure {
minTargetsRequired = 2
requireStableEstimate = true
stableReadingsRequired = 5
}
}

// Use in autonomous initialization
SequentialCommandGroup(
resetPoseCommand,
followTrajectoryCommand
).schedule()

Constructors

Link copied to clipboard
constructor(swerveDrive: SwerveDrive, visionSystem: VisionSystem)

Types

Link copied to clipboard
data class Config(var minTargetsRequired: Int = 1, var requireStableEstimate: Boolean = false, var stableReadingsRequired: Int = 3, var maxPoseVarianceMeters: Double = 0.1, var maxPoseVarianceRotation: Double = 5.0, var timeoutSeconds: Double = 2.0)

Configuration for pose reset.

Properties

Link copied to clipboard
open val interruptionBehavior: Command.InterruptionBehavior?
Link copied to clipboard
open override val isFinished: Boolean
Link copied to clipboard
Link copied to clipboard
open var name: String?
Link copied to clipboard
open val requirements: Set<Subsystem?>?
Link copied to clipboard
open var subsystem: String?

Functions

Link copied to clipboard
fun addRequirements(vararg requirements: Subsystem?)
fun addRequirements(requirements: Collection<Subsystem?>?)
Link copied to clipboard
open fun alongWith(vararg parallel: Command?): ParallelCommandGroup?
Link copied to clipboard
open fun andThen(vararg next: Command?): SequentialCommandGroup?
open fun andThen(toRun: Runnable?, vararg requirements: Subsystem?): SequentialCommandGroup?
Link copied to clipboard
open fun asProxy(): ProxyCommand?
Link copied to clipboard
open fun beforeStarting(before: Command?): SequentialCommandGroup?
open fun beforeStarting(toRun: Runnable?, vararg requirements: Subsystem?): SequentialCommandGroup?
Link copied to clipboard
open fun cancel()
Link copied to clipboard

Configures the reset command using a DSL-style configuration block.

Link copied to clipboard
open fun deadlineFor(vararg parallel: Command?): ParallelDeadlineGroup?
Link copied to clipboard
open fun deadlineWith(vararg parallel: Command?): ParallelDeadlineGroup?
Link copied to clipboard
open override fun end(interrupted: Boolean)
Link copied to clipboard
open override fun execute()
Link copied to clipboard
open fun finallyDo(end: BooleanConsumer?): WrapperCommand?
open fun finallyDo(end: Runnable?): WrapperCommand?
Link copied to clipboard
open fun handleInterrupt(handler: Runnable?): WrapperCommand?
Link copied to clipboard
open fun hasRequirement(requirement: Subsystem?): Boolean
Link copied to clipboard
open fun ignoringDisable(doesRunWhenDisabled: Boolean): WrapperCommand?
Link copied to clipboard
open override fun initialize()
Link copied to clipboard
open fun initSendable(builder: SendableBuilder?)
Link copied to clipboard
operator fun Command.invoke()

Operator invoke implementation for Command.

Link copied to clipboard
open override fun isFinished(): Boolean
Link copied to clipboard
open fun onlyIf(condition: BooleanSupplier?): ConditionalCommand?
Link copied to clipboard
open fun onlyWhile(condition: BooleanSupplier?): ParallelRaceGroup?
Link copied to clipboard
open fun raceWith(vararg parallel: Command?): ParallelRaceGroup?
Link copied to clipboard
open fun repeatedly(): RepeatCommand?
Link copied to clipboard
Link copied to clipboard
open fun schedule()
Link copied to clipboard
fun Command.scheduleIf(condition: Boolean)

Schedule this command when the provided condition is true.

Link copied to clipboard
open fun unless(condition: BooleanSupplier?): ConditionalCommand?
Link copied to clipboard
open fun until(condition: BooleanSupplier?): ParallelRaceGroup?
Link copied to clipboard
open fun withDeadline(deadline: Command?): ParallelDeadlineGroup?
Link copied to clipboard
open fun withInterruptBehavior(interruptBehavior: Command.InterruptionBehavior?): WrapperCommand?
Link copied to clipboard
open fun withName(name: String?): WrapperCommand?
Link copied to clipboard
open fun withTimeout(time: Time?): ParallelRaceGroup?
open fun withTimeout(seconds: Double): ParallelRaceGroup?