Skip to content
Open

Sim #14

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ out/
*-window.json

# Simulation data log directory
# logs/
logs/

# Folder that has CTRE Phoenix Sim device config storage
ctre_sim/
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2025.1.1"
id "edu.wpi.first.GradleRIO" version "2025.2.1"
id "com.peterabeles.gversion" version "1.10"
}

Expand Down
20 changes: 17 additions & 3 deletions simgui.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"NTProvider": {
"types": {
"/AdvantageKit/RealOutputs/Alerts": "Alerts",
"/FMSInfo": "FMSInfo",
"/SmartDashboard/Alerts": "Alerts",
"/SmartDashboard/Auto picker": "String Chooser",
"/SmartDashboard/Field": "Field2d"
},
Expand All @@ -10,6 +12,17 @@
"window": {
"visible": true
}
},
"/SmartDashboard/Field": {
"bottom": 1476,
"height": 8.210550308227539,
"left": 150,
"right": 2961,
"top": 79,
"width": 16.541748046875,
"window": {
"visible": true
}
}
}
},
Expand All @@ -18,14 +31,15 @@
"open": false
},
"transitory": {
"AdvantageKit": {
"open": true
},
"SmartDashboard": {
"Auto picker": {
"open": true,
"string[]##v_/SmartDashboard/Auto picker/options": {
"open": true
}
},
"open": true
}
}
}
},
Expand Down
45 changes: 24 additions & 21 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import frc.robot.controls.controllers.OperatorController;
import frc.robot.simulation.Field;
import frc.robot.subsystems.Algae;
import frc.robot.subsystems.Compressor;
import frc.robot.subsystems.Coral;
import frc.robot.subsystems.Drivetrain;
import frc.robot.subsystems.Elevator;
Expand All @@ -53,8 +52,6 @@ public class Robot extends LoggedRobot {

// Robot subsystems
private List<Subsystem> m_allSubsystems = new ArrayList<>();
// private final Intake m_intake = Intake.getInstance();
private final Compressor m_compressor = Compressor.getInstance();
private final Drivetrain m_drive = Drivetrain.getInstance();
private final Coral m_coral = Coral.getInstance();
private final Algae m_algae = Algae.getInstance();
Expand All @@ -78,7 +75,6 @@ public void robotInit() {
setupLogging();

// Add all subsystems to the list
// m_allSubsystems.add(m_compressor);
m_allSubsystems.add(m_drive);
m_allSubsystems.add(m_coral);
m_allSubsystems.add(m_algae);
Expand Down Expand Up @@ -339,25 +335,32 @@ private void updateSim() {

@SuppressWarnings("resource")
private void setupLogging() {
Logger.recordMetadata("ProjectName", "Flipside"); // Set a metadata value

if (isReal()) {
new WPILOGWriter(); // Log to the RoboRIO

// TODO: Add the next line back with a USB stick
// Logger.addDataReceiver(new WPILOGWriter()); // Log to a USB stick ("/U/logs")
Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables
new PowerDistribution(1, ModuleType.kCTRE); // Enables power distribution logging
System.out.println("Initializing logging...");

Logger.recordMetadata("ProjectName", "Bottom Feeder");
// Logger.recordMetadata("ProjectName", BuildConstants.MAVEN_NAME);
Logger.recordMetadata("BuildDate", BuildConstants.BUILD_DATE);
Logger.recordMetadata("GitSHA", BuildConstants.GIT_SHA);
Logger.recordMetadata("GitDate", BuildConstants.GIT_DATE);
Logger.recordMetadata("GitBranch", BuildConstants.GIT_BRANCH);

switch (BuildConstants.DIRTY) {
case 0:
Logger.recordMetadata("GitDirty", "All changes committed");
break;
case 1:
Logger.recordMetadata("GitDirty", "Uncomitted changes");
break;
default:
Logger.recordMetadata("GitDirty", "Unknown");
break;
}
// else {
// setUseTiming(false); // Run as fast as possible
// String logPath = LogFileUtil.findReplayLog(); // Pull the replay log from
// AdvantageScope (or prompt the user)
// Logger.setReplaySource(new WPILOGReader(logPath)); // Read replay log
// Logger.addDataReceiver(new WPILOGWriter(LogFileUtil.addPathSuffix(logPath,
// "_sim"))); // Save outputs to a new log
// }

Logger.addDataReceiver(new WPILOGWriter()); // Log to a USB stick ("/U/logs")
Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables
new PowerDistribution(1, ModuleType.kCTRE); // Enables power distribution logging

RobotTelemetry.print("Logging started");
Logger.start();
}
}
40 changes: 0 additions & 40 deletions src/main/java/frc/robot/RobotTelemetry.java
Original file line number Diff line number Diff line change
@@ -1,48 +1,8 @@
package frc.robot;

import org.littletonrobotics.junction.Logger;
import org.littletonrobotics.junction.networktables.NT4Publisher;
import org.littletonrobotics.junction.wpilog.WPILOGWriter;

import edu.wpi.first.wpilibj.PowerDistribution;
import edu.wpi.first.wpilibj.PowerDistribution.ModuleType;
import edu.wpi.first.wpilibj.Timer;

public class RobotTelemetry {

@SuppressWarnings("resource")
public RobotTelemetry() {
Logger.recordMetadata("ProjectName", BuildConstants.MAVEN_NAME);
Logger.recordMetadata("BuildDate", BuildConstants.BUILD_DATE);
Logger.recordMetadata("GitSHA", BuildConstants.GIT_SHA);
Logger.recordMetadata("GitDate", BuildConstants.GIT_DATE);
Logger.recordMetadata("GitBranch", BuildConstants.GIT_BRANCH);
switch (BuildConstants.DIRTY) {
case 0:
Logger.recordMetadata("GitDirty", "All changes committed");
break;
case 1:
Logger.recordMetadata("GitDirty", "Uncomitted changes");
break;
default:
Logger.recordMetadata("GitDirty", "Unknown");
break;
}

// TODO: this
// Logger.recordMetadata("RobotType", RobotConstants.getRobotType().name());
// Logger.recordMetadata("ProjectName", "Apollo, Eater of Batteries");

Logger.addDataReceiver(new WPILOGWriter()); // Log to a USB stick ("/U/logs")
Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables

new PowerDistribution(1, ModuleType.kRev); // Enables power distribution logging

Logger.start();

print("Logging initialized. Fard.");
}

public static void print(String output) {
System.out.println(
String.format("%.3f", Timer.getFPGATimestamp()) + " || " + output);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "PathplannerLib-2025.1.1.json",
"fileName": "PathplannerLib-2025.2.1.json",
"name": "PathplannerLib",
"version": "2025.1.1",
"version": "2025.2.1",
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
"frcYear": "2025",
"mavenUrls": [
Expand All @@ -12,15 +12,15 @@
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-java",
"version": "2025.1.1"
"version": "2025.2.1"
}
],
"jniDependencies": [],
"cppDependencies": [
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-cpp",
"version": "2025.1.1",
"version": "2025.2.1",
"libName": "PathplannerLib",
"headerClassifier": "headers",
"sharedLibrary": false,
Expand Down
17 changes: 7 additions & 10 deletions vendordeps/REVLib.json → vendordeps/REVLib-2025.0.1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "REVLib.json",
"fileName": "REVLib-2025.0.1.json",
"name": "REVLib",
"version": "2025.0.0",
"version": "2025.0.1",
"frcYear": "2025",
"uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb",
"mavenUrls": [
Expand All @@ -12,19 +12,18 @@
{
"groupId": "com.revrobotics.frc",
"artifactId": "REVLib-java",
"version": "2025.0.0"
"version": "2025.0.1"
}
],
"jniDependencies": [
{
"groupId": "com.revrobotics.frc",
"artifactId": "REVLib-driver",
"version": "2025.0.0",
"version": "2025.0.1",
"skipInvalidPlatforms": true,
"isJar": false,
"validPlatforms": [
"windowsx86-64",
"windowsx86",
"linuxarm64",
"linuxx86-64",
"linuxathena",
Expand All @@ -37,14 +36,13 @@
{
"groupId": "com.revrobotics.frc",
"artifactId": "REVLib-cpp",
"version": "2025.0.0",
"version": "2025.0.1",
"libName": "REVLib",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"windowsx86",
"linuxarm64",
"linuxx86-64",
"linuxathena",
Expand All @@ -55,14 +53,13 @@
{
"groupId": "com.revrobotics.frc",
"artifactId": "REVLib-driver",
"version": "2025.0.0",
"version": "2025.0.1",
"libName": "REVLibDriver",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"windowsx86",
"linuxarm64",
"linuxx86-64",
"linuxathena",
Expand All @@ -71,4 +68,4 @@
]
}
]
}
}