2023 Drive base
 
Loading...
Searching...
No Matches
frc.robot.subsystems.BetterShuffleboard Class Reference

Public Member Functions

 BetterShuffleboard ()
 
void pushDashboard (Limelight limelight, IMU imu, MecaDrive drive, ZED zed)
 
void updateControllerExponents ()
 
void pushOdom (MecaDrive drive)
 
void pushLimelight (Limelight limelight)
 
void pushIMU (IMU imu)
 
void pushZED (ZED zed)
 

Detailed Description

Definition at line 12 of file BetterShuffleboard.java.

Constructor & Destructor Documentation

◆ BetterShuffleboard()

frc.robot.subsystems.BetterShuffleboard.BetterShuffleboard ( )

Definition at line 25 of file BetterShuffleboard.java.

25 {
26 tuningTab = Shuffleboard.getTab("Tuning");
27 // create widgets for tuning tab
28 leftXExp = tuningTab.add("LeftXExp", Constants.LEFT_X_EXPONENT)
29 .withWidget(BuiltInWidgets.kNumberSlider)
30 .withProperties(Map.of("min", 1, "max", 5))
31 .getEntry();
32 leftXExp.setDouble(Constants.LEFT_X_EXPONENT);
33 leftYExp = tuningTab.add("LeftYExp", Constants.LEFT_Y_EXPONENT)
34 .withWidget(BuiltInWidgets.kNumberSlider)
35 .withProperties(Map.of("min", 1, "max", 5))
36 .getEntry();
37 leftYExp.setDouble(Constants.LEFT_Y_EXPONENT);
38 rightXExp = tuningTab.add("RightXExp", Constants.RIGHT_X_EXPONENT)
39 .withWidget(BuiltInWidgets.kNumberSlider)
40 .withProperties(Map.of("min", 1, "max", 5))
41 .getEntry();
42 rightXExp.setDouble(Constants.RIGHT_X_EXPONENT);
43 rightYExp = tuningTab.add("RightYExp", Constants.RIGHT_Y_EXPONENT)
44 .withWidget(BuiltInWidgets.kNumberSlider)
45 .withProperties(Map.of("min", 1, "max", 5))
46 .getEntry();
47 rightYExp.setDouble(Constants.RIGHT_Y_EXPONENT);
48
49 debugTab = Shuffleboard.getTab("Debug");
50 odomTab = Shuffleboard.getTab("Odometry");
51 odomX = odomTab.add("OdomX", 0)
52 .withWidget(BuiltInWidgets.kGraph)
53 .withProperties(Map.of("visible time", 20))
54 .getEntry();
55 odomY = odomTab.add("OdomY", 0)
56 .withWidget(BuiltInWidgets.kGraph)
57 .withProperties(Map.of("visible time", 20))
58 .getEntry();
59 odomHead = odomTab.add("OdomHead", 0)
60 .withWidget(BuiltInWidgets.kDial)
61 .withProperties(Map.of("min", -180, "max", 180))
62 .getEntry();
63 FRVel = odomTab.add("FRVel", 0)
64 .withWidget(BuiltInWidgets.kNumberBar)
65 .withProperties(Map.of("min", -5, "max", 5))
66 .getEntry();
67 FLVel = odomTab.add("FLVel", 0)
68 .withWidget(BuiltInWidgets.kNumberBar)
69 .withProperties(Map.of("min", -5, "max", 5))
70 .getEntry();
71 RRVel = odomTab.add("RRVel", 0)
72 .withWidget(BuiltInWidgets.kNumberBar)
73 .withProperties(Map.of("min", -5, "max", 5))
74 .getEntry();
75 RLVel = odomTab.add("RLVel", 0)
76 .withWidget(BuiltInWidgets.kNumberBar)
77 .withProperties(Map.of("min", -5, "max", 5))
78 .getEntry();
79 NavXVel = odomTab.add("NavXVel", 0)
80 .withWidget(BuiltInWidgets.kNumberBar)
81 .withProperties(Map.of("min", -5, "max", 5))
82 .getEntry();
83 NavYVel = odomTab.add("NavYVel", 0)
84 .withWidget(BuiltInWidgets.kNumberBar)
85 .withProperties(Map.of("min", -5, "max", 5))
86 .getEntry();
87 NavRotationRateZ = odomTab.add("NavRotationRateZ", 0)
88 .withWidget(BuiltInWidgets.kNumberBar)
89 .withProperties(Map.of("min", -5, "max", 5))
90 .getEntry();
91 NavXAccel = odomTab.add("NavXAccel", 0)
92 .withWidget(BuiltInWidgets.kNumberBar)
93 .withProperties(Map.of("min", -5, "max", 5))
94 .getEntry();
95 NavYAccel = odomTab.add("NavYAccel", 0)
96 .withWidget(BuiltInWidgets.kNumberBar)
97 .withProperties(Map.of("min", -5, "max", 5))
98 .getEntry();
99 NavZAccel = odomTab.add("NavZAccel", 0)
100 .withWidget(BuiltInWidgets.kNumberBar)
101 .withProperties(Map.of("min", -5, "max", 5))
102 .getEntry();
103 NavRoll = odomTab.add("NavRoll", 0)
104 .withWidget(BuiltInWidgets.kDial)
105 .withProperties(Map.of("min", -180, "max", 180))
106 .getEntry();
107 NavPitch = odomTab.add("NavPitch", 0)
108 .withWidget(BuiltInWidgets.kDial)
109 .withProperties(Map.of("min", -180, "max", 180))
110 .getEntry();
111 NavHeading = odomTab.add("NavHeading", 0)
112 .withWidget(BuiltInWidgets.kDial)
113 .withProperties(Map.of("min", -180, "max", 180))
114 .getEntry();
115 NavConnected = odomTab.add("NavConnected", 0)
116 .withWidget(BuiltInWidgets.kBooleanBox)
117 .getEntry();
118 }

References frc.robot.Constants.LEFT_X_EXPONENT, frc.robot.Constants.LEFT_Y_EXPONENT, frc.robot.Constants.RIGHT_X_EXPONENT, and frc.robot.Constants.RIGHT_Y_EXPONENT.

Member Function Documentation

◆ pushDashboard()

◆ pushIMU()

void frc.robot.subsystems.BetterShuffleboard.pushIMU ( IMU  imu)

Definition at line 150 of file BetterShuffleboard.java.

150 {
151 // SmartDashboard.putNumber("NavX", imu.getDisplacementX());
152 // SmartDashboard.putNumber("NavY", imu.getDisplacementY());
153 // SmartDashboard.putNumber("NavZ", imu.getDisplacementZ());
154
155 NavXVel.setDouble(imu.getVelocityX());
156 NavYVel.setDouble(imu.getVelocityY());
157
158 NavXAccel.setDouble(imu.getWorldLinearAccelX());
159 NavYAccel.setDouble(imu.getWorldLinearAccelY());
160 NavZAccel.setDouble(imu.getWorldLinearAccelZ());
161
162 NavRoll.setDouble(imu.getRoll());
163 NavPitch.setDouble(imu.getPitch());
164 NavHeading.setDouble(imu.getHeading());
165
166 NavRotationRateZ.setDouble(imu.getRate());
167 NavConnected.setBoolean(imu.isConnected());
168 }

References frc.robot.subsystems.IMU.getHeading().

Referenced by frc.robot.subsystems.BetterShuffleboard.pushDashboard().

◆ pushLimelight()

void frc.robot.subsystems.BetterShuffleboard.pushLimelight ( Limelight  limelight)

Definition at line 144 of file BetterShuffleboard.java.

144 {
145 SmartDashboard.putNumber("LimelightX", limelight.getX());
146 SmartDashboard.putNumber("LimelightY", limelight.getY());
147 SmartDashboard.putNumber("LimelightArea", limelight.getArea());
148 }

References frc.robot.subsystems.Limelight.getArea(), frc.robot.subsystems.Limelight.getX(), and frc.robot.subsystems.Limelight.getY().

Referenced by frc.robot.subsystems.BetterShuffleboard.pushDashboard().

◆ pushOdom()

void frc.robot.subsystems.BetterShuffleboard.pushOdom ( MecaDrive  drive)

Definition at line 134 of file BetterShuffleboard.java.

134 {
135 odomX.setDouble(drive.getOdomX());
136 odomY.setDouble(drive.getOdomY());
137 odomHead.setDouble(drive.getOdomHeading());
138 FLVel.setDouble(drive.getWheelSpeeds().frontLeftMetersPerSecond);
139 FRVel.setDouble(drive.getWheelSpeeds().frontRightMetersPerSecond);
140 RLVel.setDouble(drive.getWheelSpeeds().rearLeftMetersPerSecond);
141 RRVel.setDouble(drive.getWheelSpeeds().rearRightMetersPerSecond);
142 }

References frc.robot.subsystems.MecaDrive.getOdomHeading(), frc.robot.subsystems.MecaDrive.getOdomX(), and frc.robot.subsystems.MecaDrive.getOdomY().

Referenced by frc.robot.subsystems.BetterShuffleboard.pushDashboard().

◆ pushZED()

void frc.robot.subsystems.BetterShuffleboard.pushZED ( ZED  zed)

Definition at line 171 of file BetterShuffleboard.java.

171 {
172 SmartDashboard.putNumber("AprilTagX", zed.getAprilTagX());
173 SmartDashboard.putNumber("AprilTagY", zed.getAprilTagY());
174 SmartDashboard.putNumber("AprilTagZ", zed.getAprilTagZ());
175 }

References frc.robot.subsystems.ZED.getAprilTagX(), frc.robot.subsystems.ZED.getAprilTagY(), and frc.robot.subsystems.ZED.getAprilTagZ().

Referenced by frc.robot.subsystems.BetterShuffleboard.pushDashboard().

◆ updateControllerExponents()

void frc.robot.subsystems.BetterShuffleboard.updateControllerExponents ( )

Definition at line 127 of file BetterShuffleboard.java.

127 {
128 Constants.LEFT_X_EXPONENT = leftXExp.getDouble(2);
129 Constants.LEFT_Y_EXPONENT = leftYExp.getDouble(2);
130 Constants.RIGHT_X_EXPONENT = rightXExp.getDouble(2);
131 Constants.RIGHT_Y_EXPONENT = rightYExp.getDouble(2);
132 }

Referenced by frc.robot.Robot.teleopInit().


The documentation for this class was generated from the following file: