@@ -57,21 +57,27 @@ public class Robot extends TimedRobot {
5757
5858 public static double getConst (String key , double def ) {
5959 if (!SmartDashboard .containsKey ("Const/" + key )) {
60- SmartDashboard .putNumber ("Const/" + key , def );
60+ if (!SmartDashboard .putNumber ("Const/" + key , def )) {
61+ System .err .println ("SmartDashboard Key" + "Const/" + key + "already taken by a different type" );
62+ return def ;
63+ }
6164 }
6265 return SmartDashboard .getNumber ("Const/" + key , def );
6366 }
6467
6568 public static boolean getBool (String key , boolean def ) {
6669 if (!SmartDashboard .containsKey ("Bool/" + key )) {
67- SmartDashboard .putBoolean ("Bool/" + key , def );
70+ if (!SmartDashboard .putBoolean ("Bool/" + key , def )) {
71+ System .err .println ("SmartDashboard Key" + "Bool/" + key + "already taken by a different type" );
72+ return def ;
73+ }
6874 }
6975 return SmartDashboard .getBoolean ("Bool/" + key , def );
7076 }
7177
7278 /**
73- * This function is run when the robot is first started up and should be
74- * used for any initialization code.
79+ * This function is run when the robot is first started up and should be used
80+ * for any initialization code.
7581 */
7682 @ Override
7783 public void robotInit () {
@@ -110,9 +116,9 @@ public void robotInit() {
110116 }
111117
112118 /**
113- * This function is called once each time the robot enters Disabled mode.
114- * You can use it to reset any subsystem information you want to clear when
115- * the robot is disabled.
119+ * This function is called once each time the robot enters Disabled mode. You
120+ * can use it to reset any subsystem information you want to clear when the
121+ * robot is disabled.
116122 */
117123 @ Override
118124 public void disabledInit () {
@@ -125,9 +131,9 @@ public void disabledPeriodic() {
125131 }
126132
127133 /**
128- * This function is called once during the start of autonomous in order to
129- * grab values from SmartDashboard and the FMS and call the Autonomous
130- * command with those values.
134+ * This function is called once during the start of autonomous in order to grab
135+ * values from SmartDashboard and the FMS and call the Autonomous command with
136+ * those values.
131137 */
132138 @ Override
133139 public void autonomousInit () {
0 commit comments