Skip to content

Commit

Permalink
Update Monologue to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
jpothen8 committed Jan 13, 2024
1 parent 1a1be5f commit 0c5105f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion simgui.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@
"transitory": {
"CameraPublisher": {
"arducam-processed": {
"open": true,
"string[]##v_/CameraPublisher/arducam-processed/streams": {
"open": true
}
Expand All @@ -176,6 +175,9 @@
"open": true
},
"Monologuing": {
"field": {
"open": true
},
"open": true,
"robot": {
"drive": {
Expand Down
17 changes: 6 additions & 11 deletions src/main/kotlin/frc/team449/RobotLoop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -66,7 +66,7 @@ class RobotLoop : TimedRobot(), Logged {

controllerBinder.bindButtons()

Monologue.setupLogging(this, "/Monologuing")
Monologue.setupMonologue(this, "/Monologuing", false, false)
// URCL.start()
}

Expand All @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/frc/team449/robot2024/Robot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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()
Expand Down

0 comments on commit 0c5105f

Please sign in to comment.