mirror of
https://github.com/Team4388/2025RidgeScape.git
synced 2026-06-08 16:28:04 -06:00
Work on implementing adv
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
{
|
{
|
||||||
|
"System Joysticks": {
|
||||||
|
"window": {
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"keyboardJoysticks": [
|
"keyboardJoysticks": [
|
||||||
{
|
{
|
||||||
"axisConfig": [
|
"axisConfig": [
|
||||||
|
|||||||
@@ -15,13 +15,14 @@ import org.littletonrobotics.junction.networktables.NT4Publisher;
|
|||||||
import org.littletonrobotics.junction.wpilog.WPILOGReader;
|
import org.littletonrobotics.junction.wpilog.WPILOGReader;
|
||||||
import org.littletonrobotics.junction.wpilog.WPILOGWriter;
|
import org.littletonrobotics.junction.wpilog.WPILOGWriter;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.RobotController;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import edu.wpi.first.wpilibj2.command.CommandScheduler;
|
import edu.wpi.first.wpilibj2.command.CommandScheduler;
|
||||||
import frc4388.robot.constants.BuildConstants;
|
import frc4388.robot.constants.BuildConstants;
|
||||||
import frc4388.robot.constants.Constants.SimConstants;
|
import frc4388.robot.constants.Constants.SimConstants;
|
||||||
import frc4388.utility.DeferredBlock;
|
import frc4388.utility.DeferredBlock;
|
||||||
import frc4388.utility.Trim;
|
|
||||||
import frc4388.utility.compute.RobotTime;
|
import frc4388.utility.compute.RobotTime;
|
||||||
|
import frc4388.utility.compute.Trim;
|
||||||
import frc4388.utility.status.FaultReporter;
|
import frc4388.utility.status.FaultReporter;
|
||||||
|
|
||||||
//import frc4388.robot.subsystems.LED;
|
//import frc4388.robot.subsystems.LED;
|
||||||
@@ -52,8 +53,8 @@ public class Robot extends LoggedRobot {
|
|||||||
m_robotContainer = new RobotContainer();
|
m_robotContainer = new RobotContainer();
|
||||||
|
|
||||||
|
|
||||||
// Create a shuffleboard update thread, that will periodically update the values on shuffleboard
|
// // Create a shuffleboard update thread, that will periodically update the values on shuffleboard
|
||||||
FaultReporter.startThread();
|
// FaultReporter.startThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -205,13 +206,13 @@ public class Robot extends LoggedRobot {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
// public void simulationPeriodic() {
|
public void simulationPeriodic() {
|
||||||
// m_robotContainer.m_robotSwerveDrive.updateSim(RobotController.getBatteryVoltage());
|
m_robotContainer.m_robotSwerveDrive.updateSim(RobotController.getBatteryVoltage());
|
||||||
// visionSim.update(m_robotContainer.m_robotSwerveDrive.getPose2d());
|
// visionSim.update(m_robotContainer.m_robotSwerveDrive.getPose2d());
|
||||||
|
|
||||||
// // m_robotContainer.m_robotSwerveDrive.
|
// m_robotContainer.m_robotSwerveDrive.
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import edu.wpi.first.math.geometry.Rotation2d;
|
|||||||
import edu.wpi.first.math.geometry.Translation2d;
|
import edu.wpi.first.math.geometry.Translation2d;
|
||||||
import edu.wpi.first.math.util.Units;
|
import edu.wpi.first.math.util.Units;
|
||||||
import edu.wpi.first.wpilibj.GenericHID;
|
import edu.wpi.first.wpilibj.GenericHID;
|
||||||
|
import edu.wpi.first.wpilibj.RobotBase;
|
||||||
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
||||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||||
import frc4388.utility.controller.XboxController;
|
import frc4388.utility.controller.XboxController;
|
||||||
@@ -67,7 +68,7 @@ import frc4388.utility.compute.ReefPositionHelper.Side;
|
|||||||
* This class is where the bulk of the robot should be declared. Since
|
* This class is where the bulk of the robot should be declared. Since
|
||||||
* Command-based is a "declarative" paradigm, very little robot logic should
|
* Command-based is a "declarative" paradigm, very little robot logic should
|
||||||
* actually be handled in the {@link Robot} periodic methods (other than the
|
* actually be handled in the {@link Robot} periodic methods (other than the
|
||||||
* scheduler calls). Instead, the structure of the robot (including subsystems,
|
* scheduler calls). Instead, the structure of the robot (2including subsystems,
|
||||||
* commands, and button mappings) should be declared here.
|
* commands, and button mappings) should be declared here.
|
||||||
*/
|
*/
|
||||||
public class RobotContainer {
|
public class RobotContainer {
|
||||||
@@ -892,8 +893,15 @@ public class RobotContainer {
|
|||||||
public void makeAutoChooser() {
|
public void makeAutoChooser() {
|
||||||
autoChooser = new SendableChooser<String>();
|
autoChooser = new SendableChooser<String>();
|
||||||
|
|
||||||
File dir = new File("/home/lvuser/deploy/pathplanner/autos/");
|
File dir;
|
||||||
// File dir = new File("C:\\Users\\Ridgebotics\\Documents\\GitHub\\2025RidgeScape\\src\\main\\deploy\\pathplanner\\autos\\");
|
|
||||||
|
if(RobotBase.isReal()) {
|
||||||
|
dir = new File("/home/lvuser/deploy/pathplanner/autos/");
|
||||||
|
} else {
|
||||||
|
// dir = new File("C:\\Users\\Ridgebotics\\Documents\\GitHub\\2025RidgeScape\\src\\main\\deploy\\pathplanner\\autos\\");
|
||||||
|
dir = new File("/home/astatin3/Documents/GitHub/2025RidgeScape/src/main/deploy/pathplanner/autos");
|
||||||
|
}
|
||||||
|
|
||||||
String[] autos = dir.list();
|
String[] autos = dir.list();
|
||||||
|
|
||||||
if(autos == null) return;
|
if(autos == null) return;
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ public final class BuildConstants {
|
|||||||
public static final String MAVEN_GROUP = "";
|
public static final String MAVEN_GROUP = "";
|
||||||
public static final String MAVEN_NAME = "2025RidgeScape";
|
public static final String MAVEN_NAME = "2025RidgeScape";
|
||||||
public static final String VERSION = "unspecified";
|
public static final String VERSION = "unspecified";
|
||||||
public static final int GIT_REVISION = 166;
|
public static final int GIT_REVISION = 168;
|
||||||
public static final String GIT_SHA = "c183c08a3d92ff8561bef96dad52b8dd64d94f14";
|
public static final String GIT_SHA = "9fd98bce241ee2aef0855f3ce8bb0b37aee723c2";
|
||||||
public static final String GIT_DATE = "2025-07-11 17:58:22 MDT";
|
public static final String GIT_DATE = "2025-07-13 19:41:05 MDT";
|
||||||
public static final String GIT_BRANCH = "advantagekit";
|
public static final String GIT_BRANCH = "advantagekit";
|
||||||
public static final String BUILD_DATE = "2025-07-13 19:23:17 MDT";
|
public static final String BUILD_DATE = "2025-07-14 01:44:15 MDT";
|
||||||
public static final long BUILD_UNIX_TIME = 1752456197462L;
|
public static final long BUILD_UNIX_TIME = 1752479055707L;
|
||||||
public static final int DIRTY = 1;
|
public static final int DIRTY = 1;
|
||||||
|
|
||||||
private BuildConstants(){}
|
private BuildConstants(){}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import edu.wpi.first.math.numbers.N1;
|
|||||||
import edu.wpi.first.math.numbers.N3;
|
import edu.wpi.first.math.numbers.N3;
|
||||||
import edu.wpi.first.math.util.Units;
|
import edu.wpi.first.math.util.Units;
|
||||||
import edu.wpi.first.wpilibj.RobotBase;
|
import edu.wpi.first.wpilibj.RobotBase;
|
||||||
import frc4388.utility.Trim;
|
import frc4388.utility.compute.Trim;
|
||||||
import frc4388.utility.status.CanDevice;
|
import frc4388.utility.status.CanDevice;
|
||||||
import frc4388.utility.structs.Gains;
|
import frc4388.utility.structs.Gains;
|
||||||
import frc4388.utility.structs.LEDPatterns;
|
import frc4388.utility.structs.LEDPatterns;
|
||||||
|
|||||||
@@ -94,10 +94,10 @@ public class DiffDrive extends SubsystemBase implements Queryable {
|
|||||||
return "Diff Drive";
|
return "Diff Drive";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void queryStatus() {
|
// public void queryStatus() {
|
||||||
// TODO: Add Stuff
|
// // TODO: Add Stuff
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
|
|||||||
@@ -378,8 +378,8 @@ public class Elevator extends SubsystemBase implements Queryable {
|
|||||||
return "Elevator";
|
return "Elevator";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void queryStatus() {}
|
// public void queryStatus() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
|
|||||||
@@ -53,10 +53,10 @@ public class LED extends SubsystemBase implements Queryable {
|
|||||||
return "LEDs";
|
return "LEDs";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void queryStatus() {
|
// public void queryStatus() {
|
||||||
SmartDashboard.putString("LED status", mode.name());
|
// SmartDashboard.putString("LED status", mode.name());
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package frc4388.robot.subsystems;
|
package frc4388.robot.subsystems;
|
||||||
|
|
||||||
|
import org.littletonrobotics.junction.AutoLogOutput;
|
||||||
|
|
||||||
import edu.wpi.first.networktables.GenericEntry;
|
import edu.wpi.first.networktables.GenericEntry;
|
||||||
import edu.wpi.first.wpilibj.Counter;
|
import edu.wpi.first.wpilibj.Counter;
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
|
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
|
||||||
@@ -53,6 +55,7 @@ public class Lidar extends SubsystemBase implements Queryable {
|
|||||||
distance = (LidarPWM.getPeriod() * LiDARConstants.SECONDS_TO_MICROS) / LiDARConstants.LIDAR_MICROS_TO_CM;
|
distance = (LidarPWM.getPeriod() * LiDARConstants.SECONDS_TO_MICROS) / LiDARConstants.LIDAR_MICROS_TO_CM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AutoLogOutput
|
||||||
public double getDistance(){
|
public double getDistance(){
|
||||||
return distance;
|
return distance;
|
||||||
}
|
}
|
||||||
@@ -71,11 +74,11 @@ public class Lidar extends SubsystemBase implements Queryable {
|
|||||||
return "Lidar " + name;
|
return "Lidar " + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void queryStatus() {
|
// public void queryStatus() {
|
||||||
sbDistance.setDouble(distance);
|
// sbDistance.setDouble(distance);
|
||||||
sbWithinDistance.setBoolean(withinDistance());
|
// sbWithinDistance.setBoolean(withinDistance());
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
|
|||||||
@@ -467,13 +467,13 @@ public class SwerveDrive extends SubsystemBase implements Queryable {
|
|||||||
.withWidget(BuiltInWidgets.kNumberBar)
|
.withWidget(BuiltInWidgets.kNumberBar)
|
||||||
.getEntry();
|
.getEntry();
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void queryStatus() {
|
// public void queryStatus() {
|
||||||
sbGyro.setDouble(getGyroAngle());
|
// sbGyro.setDouble(getGyroAngle());
|
||||||
sbShiftState.setDouble(this.speedAdjust);
|
// sbShiftState.setDouble(this.speedAdjust);
|
||||||
|
|
||||||
// TODO: Add more status things
|
// // TODO: Add more status things
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
|
|||||||
@@ -309,12 +309,12 @@ public class Vision extends SubsystemBase implements Queryable {
|
|||||||
// .getEntry();
|
// .getEntry();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void queryStatus() {
|
// public void queryStatus() {
|
||||||
sbTagDetected.setBoolean(isTagDetected);
|
// sbTagDetected.setBoolean(isTagDetected);
|
||||||
sbTagProcessed.setBoolean(isTagProcessed);
|
// sbTagProcessed.setBoolean(isTagProcessed);
|
||||||
// field.setRobotPose(getPose2d());
|
// // field.setRobotPose(getPose2d());
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
|
|||||||
+1
-2
@@ -2,7 +2,7 @@
|
|||||||
// Open Source Software; you can modify and/or share it under the terms of
|
// Open Source Software; you can modify and/or share it under the terms of
|
||||||
// the WPILib BSD license file in the root directory of this project.
|
// the WPILib BSD license file in the root directory of this project.
|
||||||
|
|
||||||
package frc4388.utility;
|
package frc4388.utility.compute;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@@ -11,7 +11,6 @@ import java.util.ArrayList;
|
|||||||
import edu.wpi.first.networktables.GenericEntry;
|
import edu.wpi.first.networktables.GenericEntry;
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
||||||
import frc4388.utility.compute.DataUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reboot persistant Trims.
|
* Reboot persistant Trims.
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
package frc4388.utility.controller;
|
package frc4388.utility.controller;
|
||||||
|
|
||||||
import static frc4388.robot.constants.Constants.OIConstants.LEFT_AXIS_DEADBAND;
|
import static frc4388.robot.constants.Constants.OIConstants.LEFT_AXIS_DEADBAND;
|
||||||
|
|||||||
@@ -23,12 +23,6 @@ public class FaultCANCoder implements Queryable {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void queryStatus() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
// throw new UnsupportedOperationException("Unimplemented method 'queryStatus'");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
Status s = new Status();
|
Status s = new Status();
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ public class FaultPhotonCamera implements Queryable {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void queryStatus() {}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
Status s = new Status();
|
Status s = new Status();
|
||||||
|
|||||||
@@ -23,12 +23,6 @@ public class FaultPidgeon2 implements Queryable {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void queryStatus() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
// throw new UnsupportedOperationException("Unimplemented method 'queryStatus'");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
Status s = new Status();
|
Status s = new Status();
|
||||||
|
|||||||
@@ -32,25 +32,25 @@ public class FaultReporter {
|
|||||||
|
|
||||||
private static List<Queryable> queryables = new ArrayList<>();
|
private static List<Queryable> queryables = new ArrayList<>();
|
||||||
|
|
||||||
public static void startThread() {
|
// public static void startThread() {
|
||||||
new Thread() {
|
// new Thread() {
|
||||||
public void run() {
|
// public void run() {
|
||||||
try{
|
// try{
|
||||||
while(!this.isInterrupted() && this.isAlive()){
|
// while(!this.isInterrupted() && this.isAlive()){
|
||||||
Thread.sleep(500);
|
// Thread.sleep(500);
|
||||||
for(int i=0;i<queryables.size(); i++){
|
// for(int i=0;i<queryables.size(); i++){
|
||||||
queryables.get(i).queryStatus();
|
// queryables.get(i).queryStatus();
|
||||||
}
|
// }
|
||||||
|
|
||||||
// System.out.println("Updated statuses!");
|
// // System.out.println("Updated statuses!");
|
||||||
|
|
||||||
}
|
// }
|
||||||
}catch(Exception e){
|
// }catch(Exception e){
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}.start();
|
// }.start();
|
||||||
}
|
// }
|
||||||
|
|
||||||
public static void register(Queryable q) {
|
public static void register(Queryable q) {
|
||||||
queryables.add(q);
|
queryables.add(q);
|
||||||
|
|||||||
@@ -23,12 +23,6 @@ public class FaultTalonFX implements Queryable {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void queryStatus() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
// throw new UnsupportedOperationException("Unimplemented method 'queryStatus'");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Status diagnosticStatus() {
|
public Status diagnosticStatus() {
|
||||||
Status s = new Status();
|
Status s = new Status();
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package frc4388.utility.status;
|
|||||||
public interface Queryable {
|
public interface Queryable {
|
||||||
// Get name of subsystem, for use in log.
|
// Get name of subsystem, for use in log.
|
||||||
String getName();
|
String getName();
|
||||||
// Get what the subystem is currently doing, such as "Shooter spun up". This should post to SmartDashboard
|
|
||||||
void queryStatus();
|
|
||||||
// Proactivly search for any errors in each subsystem
|
// Proactivly search for any errors in each subsystem
|
||||||
Status diagnosticStatus();
|
Status diagnosticStatus();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user