diff --git a/README.md b/README.md index dc29e10f..a338f83f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ![AdvantageKit](/banner.png) +# ![AdvantageKit](/docs/docs/img/banner.png) [![Build](https://github.com/Mechanical-Advantage/AdvantageKit/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/Mechanical-Advantage/AdvantageKit/actions/workflows/build.yml) @@ -7,35 +7,6 @@ AdvantageKit is a logging, telemetry, and replay framework developed by [Team 63 - [AdvantageScope](https://github.com/Mechanical-Advantage/AdvantageScope), our robot telemetry application which **does not require AdvantageKit to use**. - [WPILib Data Logging](https://docs.wpilib.org/en/stable/docs/software/telemetry/datalog.html), a simpler logging system included in WPILib (does not support log replay in simulation, but covers the needs of most teams). -**View the [online documentation](https://docs.advantagekit.org).** +**View the [online documentation](https://docs.advantagekit.org), or download example projects from the [latest release](https://github.com/Mechanical-Advantage/AdvantageKit/releases).** Feedback, feature requests, and bug reports are welcome on the [issues page](https://github.com/Mechanical-Advantage/AdvantageKit/issues). For non-public inquires, please send a message to software@team6328.org. - -## Sample Projects - -Looking to get started quickly? **Check out the [AdvantageKit example projects](https://docs.advantagekit.org/installation/#new-projects).** There are versions for differential and swerve drives, from minimal to advanced (including a project designed for the [2024 FIRST KitBot](https://www.firstinspires.org/resource-library/frc/kitbot)). Zip files for each project are attached to the latest release. - -Also take a look at the examples below of teams utilizing AdvantageKit in their competition code: - -- [Team 6328's 2023 Code](https://github.com/Mechanical-Advantage/RobotCode2023) - Spark Max swerve with a triple jointed arm, pose estimation, and auto scoring ([TBA](https://www.thebluealliance.com/team/6328/2023)). -- [Team 2910's 2023 Code](https://github.com/FRCTeam2910/2023CompetitionRobot-Public) - Talon FX swerve with PathPlanner, vision, and a telescoping arm ([TBA](https://www.thebluealliance.com/team/2910/2023)). -- [Team 3476's 2023 Code](https://github.com/FRC3476/FRC-2023) - Swerve with pose estimation, custom superstructure management, and more ([TBA](https://www.thebluealliance.com/team/3476/2023)). -- [Team 5940's 2023 Code](https://github.com/BREAD5940/2023-Onseason) - Talon FX swerve with automated scoring/pickup and "Northstar" AprilTag vision system ([TBA](https://www.thebluealliance.com/team/5940/2023)) -- [Team 4099's 2023 Code](https://github.com/team4099/ChargedUp-2023/tree/main) - Kotlin code with a swerve, elevator, pose estimation, etc ([TBA](https://www.thebluealliance.com/team/4099/2023)). -- [Team 6328's 2022 Code](https://github.com/Mechanical-Advantage/RobotCode2022) - Spark Max differential drive with pose estimation and auto aiming ([TBA](https://www.thebluealliance.com/team/6328/2022)). - -## Repository Structure - -### Logging - -- [junction](/junction) - Primary component of logging, manages the flow of data between user code, WPILib, log files, network clients, etc. _Written in Java._ - - [junction/core](/junction/core) - Central system for managing data, including reading and writing from log files and user code. - - [junction/shims](/junction/shims) - Replaces components of other libraries (WPILib) to interact directly with `junction`. - - [junction/shims/wpilib](/junction/shims/wpilib) - Replaces WPILib components to read data from `junction` instead of the HAL. - - [junction/autolog](/junction/autolog) - Annotation procesor for creating log input classes. -- [conduit](/conduit) - Transfers data between `junction` and the WPILib HAL efficiently. _Written in C++ and Java._ - -### General - -- [build_tools](/build_tools) - Utilities to assist with building in Bazel and interfacing with WPILib and the roboRIO. -- [third_party](/third_party) - Tools for integrating third party libraries like WPILib. diff --git a/akit/src/main/java/org/littletonrobotics/junction/LogTable.java b/akit/src/main/java/org/littletonrobotics/junction/LogTable.java index fc69c2f3..fd514b76 100644 --- a/akit/src/main/java/org/littletonrobotics/junction/LogTable.java +++ b/akit/src/main/java/org/littletonrobotics/junction/LogTable.java @@ -26,6 +26,7 @@ import java.util.Objects; import java.util.Set; +import org.littletonrobotics.junction.LogTable.LogValue; import org.littletonrobotics.junction.inputs.LoggableInputs; import edu.wpi.first.units.mutable.GenericMutableMeasureImpl; @@ -576,9 +577,8 @@ public > void put(String key, Protobuf buffer = (ProtobufBuffer) protoBuffers.get(proto.getTypeString()); @@ -689,6 +689,7 @@ public void put(String key, T[][] value) { } } + @SuppressWarnings("unchecked") private Struct findRecordStructType(Class classObj) { if (!structTypeCache.containsKey(classObj.getName())) { structTypeCache.put(classObj.getName(), new RecordStruct(classObj)); @@ -696,9 +697,8 @@ private Struct findRecordStructType(Class classObj) { // Warn about record logging when enabled if (DriverStation.isEnabled()) { DriverStation.reportWarning( - "[AdvantageKit] Logging record value with type \"" + classObj.getName() - + "\" for the first time. Logging a record type for the first time when the robot is enabled is likely to cause high loop overruns. Record types should be always logged for the first time when the robot is disabled.", - false); + "[AdvantageKit] Logging record value with type \"" + classObj.getName() + "\" for the first time. Logging a record type for the first time when the robot is enabled is likely to cause high loop overruns. Record types should be always logged for the first time when the robot is disabled.", + false); } } return structTypeCache.get(classObj.getName()); @@ -737,6 +737,7 @@ public void put(String key, R... value) { * Writes a new auto serialized 2D record array value to the table. Skipped if * the key already exists as a different type. */ + @SuppressWarnings("unchecked") public void put(String key, R[][] value) { if (value == null) return; diff --git a/akit/src/main/java/org/littletonrobotics/junction/Logger.java b/akit/src/main/java/org/littletonrobotics/junction/Logger.java index 3eba7e03..58c893c1 100644 --- a/akit/src/main/java/org/littletonrobotics/junction/Logger.java +++ b/akit/src/main/java/org/littletonrobotics/junction/Logger.java @@ -276,12 +276,9 @@ static void periodicBeforeUser() { } /** - * Periodic method to be called after the constructor of Robot and each loop - * cycle. - * Updates default log values and sends data to data receivers. Running this - * after user - * code allows IO operations to occur between cycles rather than interferring - * with the + * Periodic method to be called after the constructor of Robot and each loop cycle. + * Updates default log values and sends data to data receivers. Running this after user + * code allows IO operations to occur between cycles rather than interferring with the * main thread. */ static void periodicAfterUser(long userCodeLength, long periodicBeforeLength) { diff --git a/akit/src/main/java/org/littletonrobotics/junction/RadioLogger.java b/akit/src/main/java/org/littletonrobotics/junction/RadioLogger.java index a6ccc167..7ec6044c 100644 --- a/akit/src/main/java/org/littletonrobotics/junction/RadioLogger.java +++ b/akit/src/main/java/org/littletonrobotics/junction/RadioLogger.java @@ -21,10 +21,9 @@ import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; import java.net.URL; +import org.littletonrobotics.junction.LogTable; import org.littletonrobotics.junction.LogTable.LogValue; class RadioLogger { @@ -59,8 +58,8 @@ private static void start() { statusURLBuilder.append(teamNumber % 100); statusURLBuilder.append(".1/status"); try { - statusURL = new URI(statusURLBuilder.toString()).toURL(); - } catch (URISyntaxException | MalformedURLException e) { + statusURL = new URL(statusURLBuilder.toString()); + } catch (MalformedURLException e) { return; } @@ -91,6 +90,7 @@ private static void start() { } }); notifier.setName("AdvantageKit_RadioLogger"); + notifier.setHALThreadPriority(false, 0); notifier.startPeriodic(requestPeriodSecs); } } diff --git a/banner.png b/banner.png deleted file mode 100644 index 86e084c6..00000000 Binary files a/banner.png and /dev/null differ