From 0c5105f7448609117552b57350bc028d9c399157 Mon Sep 17 00:00:00 2001 From: John Joseph Date: Fri, 12 Jan 2024 20:24:04 -0500 Subject: [PATCH] Update Monologue to latest version --- build.gradle | 2 +- simgui.json | 4 +++- src/main/kotlin/frc/team449/RobotLoop.kt | 17 ++++++----------- src/main/kotlin/frc/team449/robot2024/Robot.kt | 8 ++++---- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 404dbf8..622c04f 100644 --- a/build.gradle +++ b/build.gradle @@ -62,7 +62,7 @@ ktlint { dependencies { compileOnly 'org.jetbrains:annotations:24.0.1' - implementation 'com.github.shueja:Monologue:v1.0.0-alpha2' + implementation 'com.github.shueja:Monologue:v1.0.0-beta4' implementation("io.javalin:javalin:5.6.2") implementation("org.slf4j:slf4j-nop:2.0.6") diff --git a/simgui.json b/simgui.json index 2a95d04..c7c5a43 100644 --- a/simgui.json +++ b/simgui.json @@ -162,7 +162,6 @@ "transitory": { "CameraPublisher": { "arducam-processed": { - "open": true, "string[]##v_/CameraPublisher/arducam-processed/streams": { "open": true } @@ -176,6 +175,9 @@ "open": true }, "Monologuing": { + "field": { + "open": true + }, "open": true, "robot": { "drive": { diff --git a/src/main/kotlin/frc/team449/RobotLoop.kt b/src/main/kotlin/frc/team449/RobotLoop.kt index 3589023..a7fc2be 100644 --- a/src/main/kotlin/frc/team449/RobotLoop.kt +++ b/src/main/kotlin/frc/team449/RobotLoop.kt @@ -20,20 +20,20 @@ import frc.team449.robot2024.commands.light.BreatheHue import frc.team449.robot2024.commands.light.Rainbow import frc.team449.robot2024.constants.vision.VisionConstants import frc.team449.robot2024.subsystems.ControllerBindings +import monologue.Annotations import monologue.Logged import monologue.Monologue -import monologue.Monologue.LogBoth import kotlin.jvm.optionals.getOrNull /** The main class of the robot, constructs all the subsystems and initializes default commands. */ class RobotLoop : TimedRobot(), Logged { - @LogBoth + @Annotations.Log.NT private val robot = Robot() private val routineChooser: RoutineChooser = RoutineChooser(robot) - @LogBoth + @Annotations.Log.NT private val field = robot.field private var autoCommand: Command? = null @@ -66,7 +66,7 @@ class RobotLoop : TimedRobot(), Logged { controllerBinder.bindButtons() - Monologue.setupLogging(this, "/Monologuing") + Monologue.setupMonologue(this, "/Monologuing", false, false) // URCL.start() } @@ -77,13 +77,8 @@ class RobotLoop : TimedRobot(), Logged { robot.field.getObject("bumpers").pose = robot.drive.pose - if (SmartDashboard.getBoolean("Enable Logging?", false)) { - Monologue.update() - } else if (RobotBase.isSimulation()) { - Monologue.updateNT() - } else { - Monologue.updateFileLog() - } + Monologue.setFileOnly(DriverStation.isFMSAttached()) + Monologue.updateAll() } override fun autonomousInit() { diff --git a/src/main/kotlin/frc/team449/robot2024/Robot.kt b/src/main/kotlin/frc/team449/robot2024/Robot.kt index 7bed7a8..72fba9f 100644 --- a/src/main/kotlin/frc/team449/robot2024/Robot.kt +++ b/src/main/kotlin/frc/team449/robot2024/Robot.kt @@ -9,8 +9,8 @@ import frc.team449.control.holonomic.SwerveOrthogonalCommand import frc.team449.robot2024.constants.RobotConstants import frc.team449.system.AHRS import frc.team449.system.light.Light +import monologue.Annotations import monologue.Logged -import monologue.Monologue.LogBoth class Robot : RobotBase(), Logged { @@ -22,16 +22,16 @@ class Robot : RobotBase(), Logged { // Instantiate/declare PDP and other stuff here - @LogBoth + @Annotations.Log.NT override val powerDistribution: PowerDistribution = PowerDistribution( RobotConstants.PDH_CAN, PowerDistribution.ModuleType.kRev ) - @LogBoth + @Annotations.Log.NT override val drive = SwerveDrive.createSwerve(ahrs, field) - @LogBoth + @Annotations.Log.NT override val driveCommand = SwerveOrthogonalCommand(drive, driveController) val light = Light.createLight()