Add time-of-flight data to debugging webpage.
Change-Id: I317583f9ce51db5a1e89a0b82f24b946d2740741
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/y2023/www/field.html b/y2023/www/field.html
index cc89bb9..6bd2fc0 100644
--- a/y2023/www/field.html
+++ b/y2023/www/field.html
@@ -56,6 +56,10 @@
<td>Game Piece Held</td>
<td id="game_piece"> NA </td>
</tr>
+ <tr>
+ <td>Game Piece Position (+ = left, 0 = empty)</td>
+ <td id="game_piece_position"> NA </td>
+ </tr>
</table>
<table>
diff --git a/y2023/www/field_handler.ts b/y2023/www/field_handler.ts
index 2f62c7d..24a55fa 100644
--- a/y2023/www/field_handler.ts
+++ b/y2023/www/field_handler.ts
@@ -56,6 +56,8 @@
(document.getElementById('arm_state') as HTMLElement);
private gamePiece: HTMLElement =
(document.getElementById('game_piece') as HTMLElement);
+ private gamePiecePosition: HTMLElement =
+ (document.getElementById('game_piece_position') as HTMLElement);
private armX: HTMLElement = (document.getElementById('arm_x') as HTMLElement);
private armY: HTMLElement = (document.getElementById('arm_y') as HTMLElement);
private circularIndex: HTMLElement =
@@ -387,6 +389,8 @@
this.armState.innerHTML =
ArmState[this.superstructureStatus.arm().state()];
this.gamePiece.innerHTML = Class[this.superstructureStatus.gamePiece()];
+ this.gamePiecePosition.innerHTML =
+ this.superstructureStatus.gamePiecePosition().toFixed(4);
this.armX.innerHTML = this.superstructureStatus.arm().armX().toFixed(2);
this.armY.innerHTML = this.superstructureStatus.arm().armY().toFixed(2);
this.circularIndex.innerHTML =