AdvantageKit Javadoc

website·Indexed 31 days ago

https://docs.advantagekit.org

Java API documentation for AdvantageKit, featuring the org.littletonrobotics.junction package. Includes classes for data logging and replay such as Logger, LogTable, WPILOGReader, and LoggedRobot, as well as network table integrations and mechanism logging tools.

Tokens
46.6K
Snippets
198
Records
410
Agent score
50%

What's inside AdvantageKit

  1. Overview of the AdvantageKit Vision Template

    The AdvantageKit vision template is an open-source starting point for building high-performance vision or pose estimation systems. It is designed for deterministic log replay, ensuring that vision processing and filtering logic can be replayed in simulation with guaranteed accuracy. Key features include:

    • Integration with Limelight and PhotonVision.
    • Vision simulation via PhotonLib.
    • Support for both simple targeting and full pose estimation.
    • High-frequency sampling to prevent observation duplication.
    • Efficient logging of observations via structs.
    • Advanced filtering with automatic standard deviation scaling.
  2. Overview of org.littletonrobotics.junction.mechanism classes

    The org.littletonrobotics.junction.mechanism package provides classes for logging 2D mechanism components. Key classes include:

    • LoggedMechanism2d: A base class for 2D mechanisms that implements AutoCloseable and NTSendable.
    • LoggedMechanismObject2d: A base class for 2D mechanism objects that implements AutoCloseable.
    • LoggedMechanismLigament2d: A specialized 2D mechanism object extending LoggedMechanismObject2d.
    • LoggedMechanismRoot2d: A base class for 2D mechanism roots that implements AutoCloseable.
  3. Overview of AdvantageKit

    AdvantageKit is a free and open-source logging, telemetry, and replay framework developed by Team 6328 for Java. Its primary purpose is to enable deterministic log replay, allowing the full state of WPILib robot code to be efficiently replayed in simulation using a log file. It is vendor-neutral and compatible with any robot hardware.
  4. Overview of org.littletonrobotics.junction package hierarchy

    The org.littletonrobotics.junction package provides tools for logging, data replay, and robot state tracking. Key components include the Logger for data recording, LogTable for structured data, and LoggedRobot (which extends WPILib's IterativeRobotBase) for integrating logging into the robot lifecycle.
  5. Overview of the org.littletonrobotics.junction.networktables package

    The org.littletonrobotics.junction.networktables package provides utilities for interacting with NetworkTables (NT) in a way that integrates with logging. It includes specialized classes for publishing different data types (Boolean, Number, String) to the root table, managing dashboard choosers in the 'SmartDashboard' table, and a publisher for NT4 log data.
  6. Use LoggedRobot for AdvantageKit robot programs

    The LoggedRobot class in the org.littletonrobotics.junction package implements the IterativeRobotBase robot program framework. It is designed to be subclassed by users to create a robot program that automatically calls all required AdvantageKit periodic methods. The periodic() functions from the base class are executed on a set interval via a Notifier instance.
    public class MyRobot extends LoggedRobot {
        // Implement robot logic here
    }
  7. Understand Deterministic vs. Non-Deterministic Log Replay

    In FRC logging, replay frameworks are categorized by their ability to maintain consistency between the real robot's behavior and the replayed simulation:

    • Deterministic Replay (e.g., AdvantageKit, PyKit): The replayed robot code always matches the behavior of the real robot. Results are consistent, trustworthy, and robust to timing inconsistencies. Accuracy is unaffected by the speed of replay (e.g., running 50x faster than real-time).
    • Non-Deterministic Replay (e.g., Hoot Replay): No guarantees are made regarding accuracy. Data may arrive at different times or rates than on the real robot. Accuracy decreases as replay speed increases, often leading to the 'butterfly effect' where minor input differences cause the robot's state to diverge completely from the original run.
  8. Use AdvantageKit built-in automatic logging

    AdvantageKit automatically logs and replays several critical fields as inputs or outputs without requiring manual configuration. These built-in values are guaranteed to be accurate during replay and can be accessed directly in user code. Any other inputs not covered by these built-in features must be logged using an IO interface.
  9. AdvantageKit Package Overview

    AdvantageKit is organized into several key packages that handle different aspects of logging and robot state management:

    • org.littletonrobotics.junction: Core logging and management functionality.
    • org.littletonrobotics.junction.inputs: Input-related logging interfaces.
    • org.littletonrobotics.junction.mechanism: Logging for robot mechanisms (e.g., 2D mechanisms).
    • org.littletonrobotics.junction.networktables: Integration with NetworkTables for logged data.
    • org.littletonrobotics.junction.rlog: RLOG server implementation.
    • org.littletonrobotics.junction.wpilog: WPILOG reading and writing utilities.