java.lang.Object
frc.alotobots.library.subsystems.vision.localizationfusion.LocalizationState

public class LocalizationState extends Object
Manages the state machine for the robot localization system.

This class implements a hierarchical state machine that controls transitions between different pose estimation sources based on their availability and reliability. The system follows this hierarchy:

1. Quest SLAM as primary source (120Hz updates) 2. AprilTags as backup source 3. Odometry as emergency fallback

State transitions are logged for debugging and monitoring purposes.

  • Constructor Details

    • LocalizationState

      public LocalizationState(StateTransitionLogger logger)
      Creates a new LocalizationState instance.
      Parameters:
      logger - Logger to record state transitions
  • Method Details

    • transitionTo

      public void transitionTo(LocalizationState.State newState)
      Attempts to transition to a new state. The transition will be logged through the StateTransitionLogger. Invalid transitions will be logged but not executed.
      Parameters:
      newState - The target state to transition to
    • isInState

      public boolean isInState(LocalizationState.State... states)
      Checks if the system is currently in any of the specified states. This is useful for checking multiple valid states at once.
      Parameters:
      states - Variable number of states to check against
      Returns:
      true if current state matches any of the specified states