Skip to content

Commit

Permalink
attempt to add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
fodfodfod committed Nov 25, 2024
1 parent 2798d0b commit 03245c7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

package frc.robot;

import edu.wpi.first.epilogue.Logged;
import edu.wpi.first.net.PortForwarder;
import edu.wpi.first.wpilibj.DataLogManager;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.epilogue.logging.*;;

/**
* The VM is configured to automatically run this class, and to call the
Expand All @@ -21,13 +23,33 @@
* build.gradle file in the
* project.
*/
@Logged
public class Robot extends TimedRobot {
private Command m_autonomousCommand;

private RobotContainer m_robotContainer;

private Timer disabledTimer;

public Robot() {
// Epilogue.configure(config -> {
// // Log only to disk, instead of the default NetworkTables logging
// // Note that this means data cannot be analyzed in realtime by a dashboard
// config.dataLogger = new FileLogger(DataLogManager.getLog());
// if (isSimulation()) {
// // If running in simulation, then we'd want to re-throw any errors that
// // occur so we can debug and fix them!
// config.errorHandler = ErrorHandler.crashOnError();
// }
// // Change the root data path
// config.root = "Telemetry";
// // Only log critical information instead of the default DEBUG level.
// // This can be helpful in a pinch to reduce network bandwidth or log file size
// // while still logging important information.
// });
Epilogue.bind(this);
}

/**
* This function is run when the robot is first started up and should be used
* for any
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import frc.robot.subsystems.Drivetrain;
import edu.wpi.first.apriltag.AprilTagFieldLayout;
import edu.wpi.first.apriltag.AprilTagFields;
import edu.wpi.first.epilogue.Logged;
import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
Expand Down Expand Up @@ -65,6 +66,7 @@
* the robot (including
* subsystems, commands, and trigger mappings) should be declared here.
*/
@Logged
public class RobotContainer {
// The robot's subsystems and commands are defined here...
private final ShuffleboardInfo shuffleboard;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/subsystems/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.revrobotics.spark.SparkClosedLoopController;
import com.revrobotics.spark.config.SparkBaseConfig.IdleMode;

import edu.wpi.first.epilogue.Logged;
import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.controller.ArmFeedforward;
import edu.wpi.first.math.controller.ElevatorFeedforward;
Expand All @@ -40,6 +41,7 @@
import frc.robot.shuffleboard.MotorTab;
// import frc.robot.util.TunableNumber;

@Logged
public class Arm extends SubsystemBase {
// Arm
/** this is the right arm motor */
Expand Down

0 comments on commit 03245c7

Please sign in to comment.