Now execute the trajectory for the arm.

We can now do a runtime forwards pass to bound accelerations and execute
a sample path.  Also add a TrajectoryFollower object to hold that logic.
This also includes a LQR controller (pending Brian's library addition.)

Change-Id: I3e7ebf7186f07a742a866ff3144f98d0ee929725
diff --git a/y2018/control_loops/superstructure/arm/BUILD b/y2018/control_loops/superstructure/arm/BUILD
index dfdaef4..ae2ed51 100644
--- a/y2018/control_loops/superstructure/arm/BUILD
+++ b/y2018/control_loops/superstructure/arm/BUILD
@@ -4,10 +4,12 @@
         "trajectory.cc",
     ],
     hdrs = [
+        "dlqr.h",
         "trajectory.h",
     ],
     deps = [
         ":dynamics",
+        "//frc971/control_loops:jacobian",
         "//third_party/eigen",
     ],
 )
@@ -17,7 +19,11 @@
     srcs = [
         "trajectory_test.cc",
     ],
+    linkopts = ["-lslicot"],
+    restricted_to = ["//tools:k8"],
     deps = [
+        ":demo_path",
+        ":dynamics",
         ":trajectory",
         "//aos/testing:googletest",
         "//third_party/eigen",
@@ -38,6 +44,15 @@
     ],
 )
 
+cc_library(
+    name = "demo_path",
+    srcs = [
+        "demo_path.cc",
+    ],
+    hdrs = ["demo_path.h"],
+    deps = [":trajectory"],
+)
+
 cc_test(
     name = "dynamics_test",
     srcs = [
@@ -48,3 +63,19 @@
         "//aos/testing:googletest",
     ],
 )
+
+cc_binary(
+    name = "trajectory_plot",
+    srcs = [
+        "trajectory_plot.cc",
+    ],
+    linkopts = ["-lslicot"],
+    restricted_to = ["//tools:k8"],
+    deps = [
+        ":demo_path",
+        ":trajectory",
+        "//third_party/eigen",
+        "//third_party/matplotlib-cpp",
+    ],
+)
+