Skip to content

Commit

Permalink
Added "Set Zero" button to "Commands" Shuffleboard tab
Browse files Browse the repository at this point in the history
  • Loading branch information
yamamara committed Aug 15, 2024
1 parent 3e7b481 commit 29208ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions simgui.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"NTProvider": {
"types": {
"/FMSInfo": "FMSInfo",
"/Shuffleboard/Commands/Set Zero": "Command",
"/Shuffleboard/Pre-match/Alliance": "String Chooser",
"/Shuffleboard/Pre-match/Mode": "String Chooser",
"/SmartDashboard/AllianceColor": "String Chooser",
Expand Down
9 changes: 9 additions & 0 deletions src/main/kotlin/com/team4099/robot2023/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import com.team4099.robot2023.util.driver.Jessika
import edu.wpi.first.wpilibj.AnalogInput
import edu.wpi.first.wpilibj.DriverStation
import edu.wpi.first.wpilibj.RobotBase
import edu.wpi.first.wpilibj.shuffleboard.BuiltInWidgets
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard
import edu.wpi.first.wpilibj2.command.Command
import edu.wpi.first.wpilibj2.command.Commands.runOnce
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup
Expand Down Expand Up @@ -160,6 +162,13 @@ object RobotContainer {
)
vision.drivetrainOdometry = { drivetrain.odomTRobot }
limelight.poseSupplier = { drivetrain.odomTRobot }

// TODO: Find a better way to implement this into Shuffleboard
Shuffleboard.getTab("Commands")
.add("Set Zero", SetZeroCommand(drivetrain) /* Command currently does nothing */)
.withSize(1, 1)
.withPosition(0, 0)
.withWidget(BuiltInWidgets.kCommand)
}

fun mapDefaultCommands() {
Expand Down

0 comments on commit 29208ae

Please sign in to comment.