Move generic packages from frc971/analysis to aos

To eliminate a dependency of aos on frc971.

Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: Ic4a8f75da29f8e8c6675d96f02824cd08a9b99be
diff --git a/aos/analysis/in_process_plotter_demo.cc b/aos/analysis/in_process_plotter_demo.cc
new file mode 100644
index 0000000..a02451a
--- /dev/null
+++ b/aos/analysis/in_process_plotter_demo.cc
@@ -0,0 +1,41 @@
+#include "aos/analysis/in_process_plotter.h"
+#include "aos/init.h"
+
+// To run this example, do:
+// bazel run -c opt //frc971/analysis:in_process_plotter_demo
+// And then open localhost:8080, select "C++ Plotter" from the drop-down, and
+// then select "TITLE!" or "Trig Functions" from the second drop-down to see
+// each plot.
+int main(int argc, char *argv[]) {
+  aos::InitGoogle(&argc, &argv);
+  frc971::analysis::Plotter plotter;
+  plotter.Title("TITLE!");
+  plotter.AddFigure("Fig Foo");
+  plotter.ShareXAxis(true);
+  plotter.AddLine({1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, "y = x");
+  plotter.AddLine({5, 4, 3, 2, 1}, {1, 2, 3, 4, 5}, "y = -x");
+  plotter.YLabel("Y Axis");
+  plotter.AddFigure("Fig Bar");
+  plotter.ShareXAxis(true);
+  plotter.AddLine({1, 2, 3}, {3, 4, 5}, "y = x + 2");
+  plotter.XLabel("X Axis (Linked to both above plots)");
+  plotter.Publish();
+
+  plotter.Title("Trig Functions");
+
+  plotter.AddFigure("Sin & Cos");
+  std::vector<double> x;
+  std::vector<double> sinx;
+  std::vector<double> cosx;
+  constexpr int kNumPoints = 100000;
+  for (int ii = 0; ii < kNumPoints; ++ii) {
+    x.push_back(ii * 2 * M_PI / kNumPoints);
+    sinx.push_back(std::sin(x.back()));
+    cosx.push_back(std::cos(x.back()));
+  }
+  plotter.AddLine(x, sinx, "sin(x)");
+  plotter.AddLine(x, cosx, "cos(x)");
+  plotter.Publish();
+
+  plotter.Spin();
+}