Skip to content

Commit 4b1fbe9

Browse files
authored
Merge pull request #102 from strykeforce/fix-swerve-healthcheck
fix swerve healthcheck
2 parents 3eebc9d + 3fd4957 commit 4b1fbe9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
}
1212

1313
group = "org.strykeforce"
14-
version = "23.1.1"
14+
version = "23.1.3"
1515

1616
sourceCompatibility = JavaVersion.VERSION_17
1717
targetCompatibility = JavaVersion.VERSION_17

src/main/kotlin/org/strykeforce/healthcheck/HealthCheckCommand.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ class HealthCheckCommand(vararg subsystems: Subsystem) : Command {
1818
val BUTTON = InternalButton()
1919
}
2020

21-
22-
private val robotHealthCheck: RobotHealthCheck = RobotHealthCheckBuilder(*subsystems).build()
21+
private val robotHealthCheckBuilder = RobotHealthCheckBuilder(*subsystems)
22+
private lateinit var robotHealthCheck: RobotHealthCheck
2323

2424
private var isFinished: Boolean = false
2525

26-
private var reportServer = ReportServer(robotHealthCheck)
26+
private var reportServer: ReportServer? = null
2727

2828
private val subsystemSet = subsystems.toSet()
2929
override fun getRequirements() = subsystemSet
3030

3131
override fun initialize() {
32+
robotHealthCheck = robotHealthCheckBuilder.build()
3233
robotHealthCheck.initialize()
3334
BUTTON.setPressed(false)
3435
}
@@ -44,6 +45,7 @@ class HealthCheckCommand(vararg subsystems: Subsystem) : Command {
4445
override fun isFinished() = isFinished
4546

4647
override fun end(interrupted: Boolean) {
48+
reportServer = ReportServer(robotHealthCheck)
4749
DumpVisitor().visit(robotHealthCheck)
4850
isFinished = false
4951
}

0 commit comments

Comments
 (0)