Keep a count of the total number of balls shot
When a ball is in the flywheel, the friction causes
the flywheel velocity to slow down. It speeds up again when the
ball is shot. We can use this to determine when balls are shot.
For more details on this thought process, see
https://docs.google.com/document/d/1XHSnfcRiM3RihTK9LcC3zZn9kPMiARX02v4XhrQpidE/edit?usp=sharing
Change-Id: I2a0378c94cbc364f18c0af0df1706f046daf530b
Signed-off-by: milind-u <milind.upadhyay@gmail.com>
diff --git a/y2020/control_loops/superstructure/finisher_plotter.ts b/y2020/control_loops/superstructure/finisher_plotter.ts
index 6ec4be4..c9420ae 100644
--- a/y2020/control_loops/superstructure/finisher_plotter.ts
+++ b/y2020/control_loops/superstructure/finisher_plotter.ts
@@ -34,6 +34,16 @@
velocityPlot.addMessageLine(status, ['shooter', 'ready']).setColor(BLACK).setPointSize(0.0);
velocityPlot.addMessageLine(status, ['shooter', 'finisher', 'dt_angular_velocity']).setColor(PINK).setPointSize(0.0);
+ const ballsShotPlot =
+ aosPlotter.addPlot(element, [0, currentTop], [DEFAULT_WIDTH, DEFAULT_HEIGHT / 2]);
+ currentTop += DEFAULT_HEIGHT / 2;
+ ballsShotPlot.plot.getAxisLabels().setTitle('Balls Shot');
+ ballsShotPlot.plot.getAxisLabels().setXLabel(TIME);
+ ballsShotPlot.plot.getAxisLabels().setYLabel('Balls');
+ ballsShotPlot.plot.setDefaultYRange([0.0, 20.0]);
+ ballsShotPlot.addMessageLine(status, ['shooter', 'balls_shot']).setColor(BLUE).setPointSize(0.0);
+
+
const voltagePlot =
aosPlotter.addPlot(element, [0, currentTop], [DEFAULT_WIDTH, DEFAULT_HEIGHT / 2]);
currentTop += DEFAULT_HEIGHT / 2;