Fix some field debugging webpage issues
Change-Id: I24e033954d33917133f96cf2562a2e7431458b76
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2024/www/field.html b/y2024/www/field.html
index 8bdcf71..2013cee 100644
--- a/y2024/www/field.html
+++ b/y2024/www/field.html
@@ -44,6 +44,10 @@
<td id="superstructure_state"> NA </td>
</tr>
<tr>
+ <td>Catapult State</td>
+ <td id="catapult_state"> NA </td>
+ </tr>
+ <tr>
<td>Intake Roller State</td>
<td id="intake_roller_state"> NA </td>
</tr>
@@ -169,7 +173,7 @@
<td>Shot Distance</td>
<td id="shot_distance"> NA </td>
</tr>
- </table>
+ </table>
<h3>Zeroing Faults:</h3>
<p id="zeroing_faults"> NA </p>
diff --git a/y2024/www/field_handler.ts b/y2024/www/field_handler.ts
index fe13fcb..775eb1e 100644
--- a/y2024/www/field_handler.ts
+++ b/y2024/www/field_handler.ts
@@ -276,10 +276,25 @@
this.catapultState.innerHTML =
CatapultState[this.superstructureStatus.shooter().catapultState()];
- this.turret_position.innerHTML = this.superstructureStatus.shooter().aimer().turretPosition().toString();
- this.turret_velocity.innerHTML = this.superstructureStatus.shooter().aimer().turretVelocity().toString();
- this.target_distance.innerHTML = this.superstructureStatus.shooter().aimer().targetDistance().toString();
- this.shot_distance.innerHTML = this.superstructureStatus.shooter().aimer().shotDistance().toString();
+ if (this.superstructureStatus.shooter() &&
+ this.superstructureStatus.shooter().aimer()) {
+ this.turret_position.innerHTML = this.superstructureStatus.shooter()
+ .aimer()
+ .turretPosition()
+ .toString();
+ this.turret_velocity.innerHTML = this.superstructureStatus.shooter()
+ .aimer()
+ .turretVelocity()
+ .toString();
+ this.target_distance.innerHTML = this.superstructureStatus.shooter()
+ .aimer()
+ .targetDistance()
+ .toString();
+ this.shot_distance.innerHTML = this.superstructureStatus.shooter()
+ .aimer()
+ .shotDistance()
+ .toString();
+ }
if (!this.superstructureStatus.intakePivot() ||
!this.superstructureStatus.intakePivot().zeroed()) {
@@ -319,7 +334,7 @@
this.setEstopped(this.extend);
} else {
this.setTargetValue(
- this.climber,
+ this.extend,
this.superstructureStatus.extend().unprofiledGoalPosition(),
this.superstructureStatus.extend().estimatorState().position(),
1e-3);