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 891447f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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
10 changes: 9 additions & 1 deletion src/main/kotlin/com/team4099/robot2023/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ 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
import org.team4099.lib.smoothDeadband
import org.team4099.lib.units.derived.Angle
import org.team4099.lib.units.derived.degrees
import org.team4099.lib.units.derived.inDegrees
import javax.naming.ldap.Control
import com.team4099.robot2023.subsystems.superstructure.Request.DrivetrainRequest as DrivetrainRequest

object RobotContainer {
Expand Down Expand Up @@ -160,6 +161,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 891447f

Please sign in to comment.