Skip to content
Merged
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
24 changes: 20 additions & 4 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
package frc.robot;

import com.ctre.phoenix6.SignalLogger;
import edu.wpi.first.epilogue.Epilogue;
import edu.wpi.first.epilogue.Logged;
import edu.wpi.first.wpilibj.DataLogManager;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
Expand All @@ -14,9 +17,11 @@
* the TimedRobot documentation. If you change the name of this class or the package after creating
* this project, you must also update the Main.java file in the project.
*/
@Logged
public class Robot extends TimedRobot {
private Command m_autonomousCommand;

@Logged(name = "container")
private final RobotContainer m_robotContainer;

/**
Expand All @@ -27,6 +32,20 @@ public Robot() {
// Instantiate our RobotContainer. This will perform all our button bindings, and put our
// autonomous chooser on the dashboard.
m_robotContainer = new RobotContainer();

Epilogue.configure(
config -> {
config.root = "Robot";
});

// Captures NetworkTables data (.wpilog files)
DataLogManager.start();

// Start Phoenix 6 SignalLogger for CTRE device logging (.hoot files)
SignalLogger.start();

// Bind Epilogue to robot loop
Epilogue.bind(this);
}

/**
Expand All @@ -47,9 +66,7 @@ public void robotPeriodic() {

/** This function is called once each time the robot enters Disabled mode. */
@Override
public void disabledInit() {
SignalLogger.stop();
}
public void disabledInit() {}

@Override
public void disabledPeriodic() {}
Expand Down Expand Up @@ -78,7 +95,6 @@ public void teleopInit() {
if (m_autonomousCommand != null) {
m_autonomousCommand.cancel();
}
SignalLogger.start();
}

/** This function is called periodically during operator control. */
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package frc.robot;

import edu.wpi.first.epilogue.Logged;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.button.Trigger;
Expand All @@ -17,9 +18,13 @@
* periodic methods (other than the scheduler calls). Instead, the structure of 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...

// already logged with telemetry class
public final DrivetrainSubsystem drivetrain = new DrivetrainSubsystem();

public final VisionSubsystem vision = new VisionSubsystem();

// The controllers are defined here
Expand Down
1 change: 0 additions & 1 deletion src/main/java/frc/robot/Telemetry.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class Telemetry {
*/
public Telemetry(double maxSpeed) {
MaxSpeed = maxSpeed;
SignalLogger.start();

/* Set up the module state Mechanism2d telemetry */
for (int i = 0; i < 4; ++i) {
Expand Down