### Installing Node.js Dependencies for AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/README.md This command installs all required Node.js packages listed in the project's `package.json` file. It is a prerequisite for building or developing AdvantageScope, ensuring all necessary libraries are available before compilation or execution. ```bash npm install ``` -------------------------------- ### Building AdvantageScope for Specific Platforms Source: https://github.com/mechanical-advantage/advantagescope/blob/main/README.md This command allows cross-platform compilation of AdvantageScope. The example builds for Windows (win) on a 64-bit (x64) architecture. Users can specify different target platforms and architectures using `electron-builder` options, which can be listed by running `npx electron-builder help`. ```bash npm run build -- --win --x64 # For full list of options, run "npx electron-builder help" ``` -------------------------------- ### Recording Metadata with AdvantageKit Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/metadata.md This snippet illustrates how to record metadata using AdvantageKit. The Logger.recordMetadata method is used, and it should be called before starting the logger. AdvantageKit stores metadata separately for real and replay modes, facilitating comparison. ```Java Logger.recordMetadata("MyKey", "MyValue"); ``` -------------------------------- ### Initializing URCL with WPILib DataLogManager (C++) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/urcl.md This C++ code illustrates the setup of the URCL logger within the `RobotInit` method of a WPILib project. It provides examples for enabling logging to both NetworkTables and DataLog, or exclusively to DataLog by passing the log instance. ```cpp #include "frc/DataLogManager.h" #include "URCL.h" void Robot::RobotInit() { // If publishing to NetworkTables and DataLog frc::DataLogManager::Start(); URCL::Start(); // If logging only to DataLog URCL::Start(frc::DataLogManager::GetLog()); } ``` -------------------------------- ### Running AdvantageScope in Development Mode Source: https://github.com/mechanical-advantage/advantagescope/blob/main/README.md These commands are used for local development of AdvantageScope. `npm run watch` monitors source files for changes and recompiles automatically, while `npm start` launches the application, allowing developers to see real-time updates and debug during the coding process. ```bash npm run watch npm start ``` -------------------------------- ### Logging 3D Pose Data with AdvantageKit (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/3d-field.md This Java code demonstrates how to log 3D pose data using AdvantageKit's `Logger.recordOutput` method. It provides examples for logging both single `Pose3d` objects and multiple `Pose3d` objects as an array, enabling their visualization on the 3D field within AdvantageScope. ```Java Pose3d poseA = new Pose3d(); Pose3d poseB = new Pose3d(); Logger.recordOutput("MyPose", poseA); Logger.recordOutput("MyPoseArray", poseA, poseB); Logger.recordOutput("MyPoseArray", new Pose3d[] {poseA, poseB}); ``` -------------------------------- ### Initializing URCL with WPILib DataLogManager (Python) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/urcl.md This Python snippet shows how to integrate and start the URCL logger in a WPILib `TimedRobot` class. It provides options for publishing data to NetworkTables and DataLog concurrently, or logging directly to a DataLog instance. ```python import urcl import wpilib class Robot(wpilib.TimedRobot): def robotInit(self): # If publishing to NetworkTables and DataLog wpilib.DataLogManager.start() urcl.start() # If logging only to DataLog urcl.start(wpilib.DataLogManager.getLog()) ``` -------------------------------- ### Publishing Struct Data to NetworkTables (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/whats-new/legacy-formats.md This snippet demonstrates how to publish Pose2d struct data to NetworkTables using the StructPublisher in Java. It involves obtaining a StructTopic from the default NetworkTableInstance and then using the publish() method to get a StructPublisher to set the data. ```Java StructPublisher publisher = NetworkTableInstance.getDefault() .getStructTopic("MyPose", Pose2d.struct).publish(); publisher.set(new Pose2d()); ``` -------------------------------- ### Publishing Struct Data with Epilogue (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/whats-new/legacy-formats.md This example shows how to publish struct data using the Epilogue library in Java. It involves defining a class annotated with @Logged and then returning a supported object type, such as Pose2d, from a method within that class. ```Java @Logged public class MyClass { public Pose2d getPose() { return new Pose2d(); } } ``` -------------------------------- ### Zooming Timeline to Enabled Range in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut automatically adjusts the timeline zoom to fit the entire enabled range of the log data. It provides a quick way to get an overview of the relevant data period. ```AdvantageScope Shortcut Ctrl+\ ``` -------------------------------- ### Appending Struct Data to DataLog (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/whats-new/legacy-formats.md This example illustrates how to append struct data to a raw DataLog in Java. It involves creating a StructLogEntry for the desired type using StructLogEntry.create() and then calling the append() method to add the struct data to the log. ```Java StructLogEntry logEntry = StructLogEntry.create(DataLogManager.getLog(), "MyPose", Pose2d.struct); logEntry.append(new Pose2d()); ``` -------------------------------- ### Building AdvantageScope for the Current Platform Source: https://github.com/mechanical-advantage/advantagescope/blob/main/README.md This command compiles the AdvantageScope application for the operating system and architecture of the machine it is run on. It prepares the application for distribution or local execution by generating the appropriate build artifacts. ```bash npm run build ``` -------------------------------- ### Connecting to Simulator as Live Source in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut establishes a connection to a simulator to receive live data, allowing for testing and analysis of robot behavior in a simulated environment. It provides a convenient way to validate code without physical robot deployment. ```AdvantageScope Shortcut Ctrl+Shift+K ``` -------------------------------- ### Logging 3D Pose Data with WPILib (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/3d-field.md This Java code demonstrates how to publish 3D pose data using WPILib's NetworkTables `StructPublisher` and `StructArrayPublisher`. It allows for logging individual `Pose3d` objects and arrays of `Pose3d` objects, which are essential for visualizing robot and object positions accurately on the 3D field in AdvantageScope. ```Java Pose3d poseA = new Pose3d(); Pose3d poseB = new Pose3d(); StructPublisher publisher = NetworkTableInstance.getDefault() .getStructTopic("MyPose", Pose3d.struct).publish(); StructArrayPublisher arrayPublisher = NetworkTableInstance.getDefault() .getStructArrayTopic("MyPoseArray", Pose3d.struct).publish(); periodic() { publisher.set(poseA); arrayPublisher.set(new Pose3d[] {poseA, poseB}); } ``` -------------------------------- ### Setting Environment Variable for WPILib Build Source: https://github.com/mechanical-advantage/advantagescope/blob/main/README.md This command sets the `ASCOPE_DISTRIBUTOR` environment variable to `WPILIB`. This configuration is necessary before running a build command to produce a version of AdvantageScope specifically tailored for WPILib distribution, affecting how the application is packaged and branded. ```bash export ASCOPE_DISTRIBUTOR=WPILIB ``` -------------------------------- ### Creating New Metadata Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Metadata tab in AdvantageScope. It displays information about the log file itself, such as creation time, source, and other relevant details. ```AdvantageScope Shortcut Option+I ``` -------------------------------- ### Publishing a Tunable Network Number with AdvantageKit (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/connect-live.md This Java code snippet demonstrates how to create a `LoggedNetworkNumber` using AdvantageKit. This class allows a numeric value to be published to the '/Tuning' table in NetworkTables, making it editable from AdvantageScope when tuning mode is active. The constructor takes the NetworkTables path (e.g., "/Tuning/MyTunableNumber") and an initial default value (e.g., 0.0). ```Java LoggedNetworkNumber tunableNumber = new LoggedNetworkNumber("/Tuning/MyTunableNumber", 0.0); ``` -------------------------------- ### Connecting to Robot as Live Source in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut initiates a connection to the robot to receive live data streams in AdvantageScope. It is essential for real-time monitoring and debugging during robot operation. ```AdvantageScope Shortcut Ctrl+K ``` -------------------------------- ### Configuring SysId Routine with URCL and AdvantageKit (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/urcl.md This Java code demonstrates configuring a SysId routine for use with URCL and AdvantageKit. The `SysIdRoutine.Config` is set up to record the test state via `Logger.recordOutput`, and the `Mechanism` log consumer is `null` as URCL handles the primary data logging. It also shows how to create SysId commands. ```java // Create the SysId routine var sysIdRoutine = new SysIdRoutine( new SysIdRoutine.Config( null, null, null, (state) -> Logger.recordOutput("SysIdTestState", state.toString()) ), new SysIdRoutine.Mechanism( (voltage) -> subsystem.runVolts(voltage.in(Volts)), null, // No log consumer, since data is recorded by URCL subsystem ) ); // The methods below return Command objects sysIdRoutine.quasistatic(SysIdRoutine.Direction.kForward); sysIdRoutine.quasistatic(SysIdRoutine.Direction.kReverse); sysIdRoutine.dynamic(SysIdRoutine.Direction.kForward); sysIdRoutine.dynamic(SysIdRoutine.Direction.kReverse); ``` -------------------------------- ### Creating New Video Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Video tab in AdvantageScope. It allows for the playback and analysis of video recordings alongside log data. ```AdvantageScope Shortcut Option+V ``` -------------------------------- ### Logging Translation2d Points with WPILib (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/points.md This snippet demonstrates how to publish an array of Translation2d objects to NetworkTables using WPILib's StructArrayPublisher. It shows both setting an array and setting individual points as varargs, which is suitable for visualizing custom 2D points in AdvantageScope. ```Java StructArrayPublisher publisher = NetworkTableInstance.getDefault() .getStructArrayTopic("MyTranslations", Translation2d.struct).publish(); periodic() { publisher.set(new Translation2d[] { new Translation2d(0.0, 1.0), new Translation2d(2.0, 3.0) }); publisher.set( new Translation2d(0.0, 1.0), new Translation2d(2.0, 3.0) ); } ``` -------------------------------- ### Logging Translation2d Points with AdvantageKit (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/points.md This snippet illustrates how to record an array of Translation2d objects using AdvantageKit's Logger.recordOutput method. It demonstrates logging both an array and individual points, providing a convenient way to visualize 2D point data within AdvantageScope's logging system. ```Java Logger.recordOutput("MyTranslations", new Translation2d[] { new Translation2d(0.0, 1.0), new Translation2d(2.0, 3.0) }); Logger.recordOutput("MyTranslations", new Translation2d(0.0, 1.0), new Translation2d(2.0, 3.0) ); ``` -------------------------------- ### Initializing URCL with WPILib DataLogManager (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/urcl.md This snippet demonstrates how to initialize the URCL logger in a WPILib Java project's `robotInit` method. It shows two options: publishing to NetworkTables and DataLog simultaneously, or logging directly to DataLog by passing the `DataLogManager.getLog()` object. ```java public void robotInit() { // If publishing to NetworkTables and DataLog DataLogManager.start(); URCL.start(); // If logging only to DataLog URCL.start(DataLogManager.getLog()); } ``` -------------------------------- ### Logging 2D Pose Data with WPILib in Java Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/2d-field.md This Java snippet demonstrates how to log 2D pose data using WPILib's NetworkTables. It initializes StructPublisher and StructArrayPublisher for Pose2d objects, then publishes single poses and arrays of poses periodically (e.g., within a robot's periodic loop). This allows AdvantageScope to visualize robot positions and trajectories. ```Java Pose2d poseA = new Pose2d(); Pose2d poseB = new Pose2d(); StructPublisher publisher = NetworkTableInstance.getDefault() .getStructTopic("MyPose", Pose2d.struct).publish(); StructArrayPublisher arrayPublisher = NetworkTableInstance.getDefault() .getStructArrayTopic("MyPoseArray", Pose2d.struct).publish(); periodic() { publisher.set(poseA); arrayPublisher.set(new Pose2d[] {poseA, poseB}); } ``` -------------------------------- ### Downloading Log Files from Robot in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut triggers the download of log files directly from the robot to the local machine. It is crucial for post-match analysis and detailed review of robot performance. ```AdvantageScope Shortcut Ctrl+D ``` -------------------------------- ### Publishing Log Data to Simulation NetworkTables in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut publishes log data to a NetworkTables server within a simulation environment. It enables testing of data flow and integration with simulated robot code. ```AdvantageScope Shortcut Ctrl+Shift+P ``` -------------------------------- ### Logging and Replaying Struct Data with AdvantageKit (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/whats-new/legacy-formats.md This snippet demonstrates various ways to log and replay struct data using AdvantageKit in Java. It covers standard output logging with Logger.recordOutput(), annotation-based output logging using @AutoLogOutput on methods or fields, and logging through an inputs class annotated with @AutoLog. ```Java Logger.recordOutput("MyPose", new Pose2d()); ``` ```Java public class MyClass { @AutoLogOutput public Pose2d getPose() { return new Pose2d(); } @AutoLogOutput public Pose2d myPose = new Pose2d(); } ``` ```Java @AutoLog public class Inputs { public Pose2d myPose = new Pose2d(); } ``` -------------------------------- ### Configuring SysId Routine with URCL Logging (WPILib Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/urcl.md This Java snippet shows how to configure a SysId routine for a WPILib project when using URCL for data logging. The `Mechanism` constructor's log consumer is set to `null` because URCL handles the data recording. It also shows how to generate SysId commands for quasistatic and dynamic tests. ```java // Create the SysId routine var sysIdRoutine = new SysIdRoutine( new SysIdRoutine.Config(), new SysIdRoutine.Mechanism( (voltage) -> subsystem.runVolts(voltage.in(Volts)), null, // No log consumer, since data is recorded by URCL subsystem ) ); // The methods below return Command objects sysIdRoutine.quasistatic(SysIdRoutine.Direction.kForward); sysIdRoutine.quasistatic(SysIdRoutine.Direction.kReverse); sysIdRoutine.dynamic(SysIdRoutine.Direction.kForward); sysIdRoutine.dynamic(SysIdRoutine.Direction.kReverse); ``` -------------------------------- ### Opening Log Files in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut allows users to open one or more log files directly within AdvantageScope. It serves as a primary method for loading data for visualization and analysis. ```AdvantageScope Shortcut Ctrl+O ``` -------------------------------- ### Publishing Mechanism Data with WPILib (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/mechanism.md This snippet demonstrates how to publish `Mechanism2d` data to NetworkTables using WPILib in Java. It initializes a new `Mechanism2d` object with specified dimensions and then uses `SmartDashboard.putData` to make it available for display on dashboards like AdvantageScope. This data can also be viewed from generated WPILOG files if data logging is enabled. ```java Mechanism2d mechanism = new Mechanism2d(3, 3); SmartDashboard.putData("MyMechanism", mechanism); ``` -------------------------------- ### Creating New Window in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut opens a new, independent window of AdvantageScope. It allows users to work with multiple visualizations or log files simultaneously. ```AdvantageScope Shortcut Ctrl+N ``` -------------------------------- ### Creating New Console Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Console tab in AdvantageScope. It displays text-based log messages and console output from the robot or simulation. ```AdvantageScope Shortcut Option+C ``` -------------------------------- ### Creating New Statistics Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Statistics tab in AdvantageScope. It provides statistical summaries and analysis of the loaded log data. ```AdvantageScope Shortcut Option+S ``` -------------------------------- ### Logging String Metadata with WPILib Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/metadata.md This snippet demonstrates how to log string metadata using WPILib. It shows two methods: publishing to NetworkTables (which is also saved to DataLog by default) and appending directly to DataLog. Values must be logged as strings to the '/Metadata' table. ```Java // NetworkTables (also saved to DataLog by default) StringPublisher publisher = NetworkTableInstance.getDefault() .getStringTopic("/Metadata/MyKey").publish(); publisher.set("MyValue"); // DataLog (not published to NetworkTables) StringLogEntry entry = new StringLogEntry(DataLogManager.getLog(), "/Metadata/MyKey"); entry.append("MyValue"); ``` -------------------------------- ### Integrating URCL with AdvantageKit Logger (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/urcl.md This Java code demonstrates how to integrate URCL with AdvantageKit's `Logger` in the `robotInit` method. It registers URCL's external logging mechanism with the AdvantageKit logger, allowing URCL data to be captured. Note that this is for convenience and does not enable replay for REV motor controllers. ```java public void robotInit() { // ... Logger.registerURCL(URCL.startExternal()); Logger.start(); } ``` -------------------------------- ### Stepping Through Log File in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md These shortcuts allow users to step through the log file frame by frame. The 'Left' arrow moves backward, and the 'Right' arrow moves forward, enabling precise examination of data at specific moments. ```AdvantageScope Shortcut Left ``` ```AdvantageScope Shortcut Right ``` -------------------------------- ### Creating New Mechanism Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Mechanism tab in AdvantageScope. It allows for the visualization of robot mechanism states and movements. ```AdvantageScope Shortcut Option+M ``` -------------------------------- ### Articulated Robot Component Configuration JSON Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/custom-assets.md This JSON snippet defines the configuration for individual articulated components within a 3D robot model. It specifies 'zeroedRotations' and 'zeroedPosition' which are applied to bring each component to the robot origin before user-provided poses are applied, enabling accurate visualization of mechanism data. ```JSON "components": [ { "zeroedRotations": { "axis": "x" | "y" | "z", "degrees": number }[] // Sequence of rotations along the x, y, and z axes "zeroedPosition": [number, number, number] // Position offset in meters relative to the robot, applied after rotation } ] ``` -------------------------------- ### Publishing Mechanism Data with AdvantageKit (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/mechanism.md This snippet illustrates how to publish `Mechanism2d` data using AdvantageKit in Java. It creates a `LoggedMechanism2d` object and records its current state as an output field using `Logger.recordOutput`. It's crucial to call this method every loop cycle to ensure the mechanism's state is continuously updated and logged. ```java LoggedMechanism2d mechanism = new LoggedMechanism2d(3, 3); Logger.recordOutput("MyMechanism", mechanism); ``` -------------------------------- ### Logging 2D Pose Data with AdvantageKit in Java Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/2d-field.md This Java snippet illustrates how to log 2D pose data using AdvantageKit's Logger. It records individual Pose2d objects and arrays of Pose2d objects under specified keys. This method is used for logging robot state and trajectories for later analysis in AdvantageScope. ```Java Pose2d poseA = new Pose2d(); Pose2d poseB = new Pose2d(); Logger.recordOutput("MyPose", poseA); Logger.recordOutput("MyPoseArray", poseA, poseB); Logger.recordOutput("MyPoseArray", new Pose2d[] {poseA, poseB}); ``` -------------------------------- ### Adding Log Files to Current Visualization in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut enables users to add additional log files to the currently active visualization in AdvantageScope. It is useful for combining data from multiple sources for comparative analysis. ```AdvantageScope Shortcut Ctrl+Shift+O ``` -------------------------------- ### Creating New Table Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Table tab in AdvantageScope. It displays log data in a structured table format, useful for detailed inspection of values. ```AdvantageScope Shortcut Option+T ``` -------------------------------- ### Creating New Joysticks Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Joysticks tab in AdvantageScope. It allows for the visualization of joystick input data, useful for debugging driver controls. ```AdvantageScope Shortcut Option+J ``` -------------------------------- ### Creating New Points Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Points tab in AdvantageScope. It is used for visualizing discrete data points, often representing specific events or locations. ```AdvantageScope Shortcut Option+P ``` -------------------------------- ### 3D Robot Model Configuration JSON Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/custom-assets.md This JSON snippet outlines the configuration for 3D robot models. It includes properties for the model's unique name, whether it's for FTC fields, options to disable simplification, rotation and position offsets, and definitions for fixed camera positions. It also references an array for articulated components. ```JSON { "name": string // Unique name, required for all asset types "isFTC": string // Whether the model is intended for use on FTC fields instead of FRC fields (default "false") "disableSimplification": boolean // Whether to disable model simplification, optional "rotations": { "axis": "x" | "y" | "z", "degrees": number }[] // Sequence of rotations along the x, y, and z axes "position": [number, number, number] // Position offset in meters, applied after rotation "cameras": [ // Fixed camera positions, can be empty { "name": string // Camera name "rotations": { "axis": "x" | "y" | "z", "degrees": number }[] // Sequence of rotations along the x, y, and z axes "position": [number, number, number] // Position offset in meters relative to the robot, applied after rotation "resolution": [number, number] // Resolution in pixels, used to set the fixed aspect ratio "fov": number // Horizontal field of view in degrees } ], "components": [...] // See "Articulated Components" } ``` -------------------------------- ### Exporting Log Data in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut initiates the process of exporting log data from AdvantageScope. It allows users to save visualized data in various formats for external analysis or sharing. ```AdvantageScope Shortcut Ctrl+E ``` -------------------------------- ### Creating New 3D Field Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new 3D Field tab in AdvantageScope. It provides a three-dimensional view for visualizing robot position and orientation in space. ```AdvantageScope Shortcut Option+3 ``` -------------------------------- ### Creating New Line Graph Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Line Graph tab in AdvantageScope. It provides a fast way to visualize data trends over time. ```AdvantageScope Shortcut Option+G ``` -------------------------------- ### Logging Swerve Module States with AdvantageKit (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/swerve.md This snippet illustrates how to record an array of SwerveModuleState objects using AdvantageKit's Logger.recordOutput method. It initializes an array of four SwerveModuleState objects and then records them, providing a simple way to log swerve data for analysis and visualization within the AdvantageKit ecosystem. This approach integrates seamlessly with AdvantageKit's logging infrastructure. ```Java SwerveModuleState[] states = new SwerveModuleState[] { new SwerveModuleState(), new SwerveModuleState(), new SwerveModuleState(), new SwerveModuleState() } Logger.recordOutput("MyStates", states); ``` -------------------------------- ### General Asset Configuration JSON Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/custom-assets.md This JSON snippet defines the basic structure for all asset configuration files in AdvantageScope. Each asset type requires a unique 'name' property for display within the application. Additional type-dependent properties are included as described in subsequent sections. ```JSON { "name": string // Unique name, required for all asset types ... // Type-dependent configuration, described below } ``` -------------------------------- ### Joystick Asset Configuration JSON Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/custom-assets.md This JSON snippet defines the general configuration for joystick assets. It requires a unique 'name' for display and includes an array to define various joystick components like buttons, two-axis joysticks, and single axes, each with their own specific properties. ```JSON { "name": string // Unique name, required for all asset types "components": [...] // Array of component configurations, see below } ``` -------------------------------- ### Opening Preferences Window in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut opens the preferences or settings window in AdvantageScope. It provides access to various configuration options for customizing the application's behavior and appearance. ```AdvantageScope Shortcut Ctrl+Comma ``` -------------------------------- ### Creating New 2D Field Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new 2D Field tab in AdvantageScope. It provides a top-down view for visualizing robot position and paths on a 2D field. ```AdvantageScope Shortcut Option+2 ``` -------------------------------- ### Logging Swerve Module States with WPILib (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/tab-reference/swerve.md This snippet demonstrates how to publish an array of SwerveModuleState objects to NetworkTables using WPILib's StructArrayPublisher. It initializes an array of four SwerveModuleState objects and then publishes them periodically, making the data available for visualization in AdvantageScope. This method ensures structured data logging for swerve module states. ```Java SwerveModuleState[] states = new SwerveModuleState[] { new SwerveModuleState(), new SwerveModuleState(), new SwerveModuleState(), new SwerveModuleState() } StructArrayPublisher publisher = NetworkTableInstance.getDefault() .getStructArrayTopic("MyStates", SwerveModuleState.struct).publish(); periodic() { publisher.set(states); } ``` -------------------------------- ### Joystick Single Button/POV Component Configuration JSON Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/custom-assets.md This JSON snippet details the configuration for a single button or POV (Point of View) component on a joystick. It specifies visual properties like color and shape, pixel coordinates for placement, and the source index for reading input. Optionally, it can define a specific POV direction. ```JSON { "type": "button" "isYellow": boolean "isEllipse": boolean "centerPx": [number, number] "sizePx": [number, number] "sourceIndex": number "sourcePov": string // Optional, can be "up", "right", "down", or "left". If provided, the "sourceIndex" will be the index of the POV to read. } ``` -------------------------------- ### Creating New Pop-Out Window for Current Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut creates a new, separate pop-out window specifically for the currently active tab. This is useful for viewing a single visualization on a different monitor or as a standalone window. ```AdvantageScope Shortcut Ctrl+Shift+T ``` -------------------------------- ### Publishing Log Data to Robot NetworkTables in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut publishes the current log data to a NetworkTables server running on the robot. This feature is useful for sending processed data back to the robot for control or display purposes. ```AdvantageScope Shortcut Ctrl+P ``` -------------------------------- ### Joystick Single Axis Component Configuration JSON Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/custom-assets.md This JSON snippet defines the configuration for a single-axis joystick component. It includes visual properties, pixel coordinates for placement, the source index for reading the axis value, and a source range to define the expected minimum and maximum values, allowing for inversion if min is greater than max. ```JSON { "type": "axis" // A single axis value "isYellow": boolean "centerPx": [number, number] "sizePx": [number, number] "sourceIndex": number, "sourceRange": [number, number]; // Min greater than max to invert } ``` -------------------------------- ### Switching Tabs in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md These shortcuts allow users to quickly navigate between open tabs in AdvantageScope. Pressing 'Ctrl+Left' moves to the previous tab, while 'Ctrl+Right' moves to the next tab. ```AdvantageScope Shortcut Ctrl+Left ``` ```AdvantageScope Shortcut Ctrl+Right ``` -------------------------------- ### Configuring 3D Field Models JSON Structure Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/custom-assets.md This JSON snippet defines the structure for the `config.json` file used to configure 3D field models. It includes properties for field name, type (FTC/FRC), coordinate system, rotations, dimensions, driver station positions, and a list of game piece types with their own rotations, positions, and staged objects. ```json { "name": string, // Unique name, required for all asset types "isFTC": boolean, // Whether this is an FTC field instead of an FRC field "coordinateSystem": // The default coordinate system to use (see below) "wall-alliance" | // FRC 2022 "wall-blue" | // FRC 2023-2026 "center-rotated" | // FTC traditional "center-red", // SystemCore "rotations": { "axis": "x" | "y" | "z", "degrees": number }[], // Sequence of rotations along the x, y, and z axes "widthInches": number, // Real width of the field (long side) "heightInches": number, // Real height of the field (short side) "defaultOrigin": "auto" | "blue" | "red", // Default origin location, "auto" if unspecified "driverStations": [ [number, number] // Driver station positions (X & Y in meters relative to the center of the field) // ... // For FRC, 6 elements ordered [B1, B2, B3, R1, R2, R3]. For FTC, 4 elements ordered [BL, BR, RL, RR]. ], "gamePieces": [ // List of game piece types { "name": string, // Game piece name "rotations": { "axis": "x" | "y" | "z", "degrees": number }[], // Sequence of rotations along the x, y, and z axes "position": [number, number, number], // Position offset in meters, applied after rotation "stagedObjects": string[] // Names of staged game piece objects, to hide if user poses are supplied } // ... ] } ``` -------------------------------- ### Creating New Swerve Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut quickly creates and opens a new Swerve tab in AdvantageScope. It is specifically designed for visualizing the state and movement of swerve drive robots. ```AdvantageScope Shortcut Option+D ``` -------------------------------- ### Flat Field Image Configuration JSON Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/custom-assets.md This JSON snippet outlines the configuration for flat field images. It requires a unique name, specifies if it's an FTC field, defines the default coordinate system, and includes pixel coordinates for the top-left and bottom-right corners, along with the real-world width and height of the field in inches for scaling. ```JSON { "name": string // Unique name, required for all asset types "isFTC": boolean // Whether this is an FTC field instead of an FRC field "coordinateSystem": // The default coordinate system to use (see below) "wall-alliance" | // FRC 2022 "wall-blue" | // FRC 2023-2026 "center-rotated" | // FTC traditional "center-red" // SystemCore "sourceUrl": string // Link to the original file, optional "topLeft": [number, number] // Pixel coordinate (origin at upper left) "bottomRight": [number, number] // Pixel coordinate (origin at upper left) "widthInches": number // Real width of the field (long side) "heightInches": number // Real height of the field (short side) } ``` -------------------------------- ### Opening Dropdown to Add New Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut opens a dropdown menu that allows users to select and add a new tab to the current AdvantageScope window. It streamlines the process of creating new data visualizations. ```AdvantageScope Shortcut Ctrl+T ``` -------------------------------- ### Publishing Struct Data with Monologue (Java) Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/whats-new/legacy-formats.md This section illustrates two methods for publishing struct data using the Monologue library in Java. The first method shows returning a supported object type from a method annotated with @Log, while the second demonstrates imperative logging using the log() function. ```Java @Log public Pose2d getPose() { return new Pose2d(); } ``` ```Java log("MyPose", new Pose2d()); ``` -------------------------------- ### Filtering NetworkTables Data: Specific Limelight Fields Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/nt-publishing.md This comma-separated list of prefixes includes only the 'limelight/tx' and 'limelight/ty' fields. It's useful for publishing a very limited set of specific fields from different tables, providing granular control over published data. ```Text _limelight/tx,limelight/ty_ ``` -------------------------------- ### Modifying SVG Fill Attributes for Dynamic Coloring Source: https://github.com/mechanical-advantage/advantagescope/blob/main/www/symbols/sourceList/README.md This snippet illustrates the required transformation for SVG `fill` and `fill-opacity` attributes. The original hardcoded black fill and partial opacity are replaced with `currentColor` and full opacity, enabling the icon's color to be controlled via CSS. ```SVG Attribute (Original) fill="#000000" fill-opacity="0.85" ``` ```SVG Attribute (Replacement) fill="currentColor" fill-opacity="1" ``` -------------------------------- ### Joystick Two-Axis Component Configuration JSON Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/custom-assets.md This JSON snippet describes the configuration for a two-axis joystick component. It includes visual properties, center and radius in pixels, and source indices for both X and Y axes, along with inversion flags. An optional button source index can also be specified. ```JSON { "type": "joystick" // A joystick that moves in two dimensions "isYellow": boolean "centerPx": [number, number] "radiusPx": number "xSourceIndex": number "xSourceInverted": boolean // Not inverted: right = positive "ySourceIndex": number "ySourceInverted": boolean // Not inverted: up = positive "buttonSourceIndex": number // Optional } ``` -------------------------------- ### Toggling Playback in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut toggles the playback state of the log file, pausing or resuming the visualization of data over time. It is fundamental for controlling the flow of log analysis. ```AdvantageScope Shortcut Space ``` -------------------------------- ### Filtering NetworkTables Data: SmartDashboard Table Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/nt-publishing.md This prefix includes all fields within the 'SmartDashboard' table when configuring NetworkTables data publishing in AdvantageScope. It's used in the 'NT Publish Prefixes' option to broaden the scope of published data to an entire subtable. ```Text _SmartDashboard_ ``` -------------------------------- ### Filtering NetworkTables Data: Specific SmartDashboard Table Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/more-features/nt-publishing.md This prefix specifically includes only the 'SmartDashboard/Auto Selector' table when publishing NetworkTables data. It allows for precise control over which subtables are published, narrowing the scope to a single subtable. ```Text _SmartDashboard/Auto Selector_ ``` -------------------------------- ### Closing Current Window in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut closes the currently active AdvantageScope window. It provides a quick way to manage open application instances. ```AdvantageScope Shortcut Ctrl+Shift+N ``` -------------------------------- ### Toggling Lock When Viewing Live Data in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut toggles the 'lock' feature when viewing live data, which can pause the live stream to allow for closer inspection without the data continuously updating. It is useful for analyzing specific moments in a live feed. ```AdvantageScope Shortcut L ``` ```AdvantageScope Shortcut Ctrl+L ``` -------------------------------- ### Rearranging Tabs in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md These shortcuts enable users to rearrange the order of tabs within AdvantageScope. 'Ctrl+[' moves the current tab left, and 'Ctrl+]' moves it right, allowing for custom organization. ```AdvantageScope Shortcut Ctrl+[ ``` ```AdvantageScope Shortcut Ctrl+] ``` -------------------------------- ### Stopping NetworkTables Publishing in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut immediately ceases the publishing of log data to any active NetworkTables server. It provides a quick way to disconnect data streams when no longer needed. ```AdvantageScope Shortcut Option+Ctrl+P ``` -------------------------------- ### Toggling Control Pane Visibility in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut toggles the visibility of the control pane in AdvantageScope. It allows users to hide or show the controls for a cleaner view of the data. ```AdvantageScope Shortcut Ctrl+Slash ``` -------------------------------- ### Toggling Sidebar Visibility in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut toggles the visibility of the sidebar within the AdvantageScope interface. It helps maximize screen space for visualizations when the sidebar is not needed. ```AdvantageScope Shortcut Ctrl+Period ``` -------------------------------- ### Closing Current Tab in AdvantageScope Source: https://github.com/mechanical-advantage/advantagescope/blob/main/docs/docs/getting-started/keyboard.md This shortcut closes the currently active tab in AdvantageScope. It provides a quick way to dismiss visualizations or data views that are no longer needed. ```AdvantageScope Shortcut Ctrl+W ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.