y2019 robot code starts!

We are now deploying the config, and all the missing locations are now
available.  Some channels got renamed to be more user friendly.

Change-Id: Idc771998b24a769994ec80f3aee292b0d1ac6240
diff --git a/frc971/autonomous/BUILD b/frc971/autonomous/BUILD
index 2eb4be0..12698a9 100644
--- a/frc971/autonomous/BUILD
+++ b/frc971/autonomous/BUILD
@@ -1,10 +1,19 @@
 package(default_visibility = ["//visibility:public"])
 
+load("//aos:config.bzl", "aos_config")
 load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
 
 flatbuffer_cc_library(
     name = "auto_fbs",
     srcs = ["auto.fbs"],
+    gen_reflections = 1,
+    visibility = ["//visibility:public"],
+)
+
+flatbuffer_cc_library(
+    name = "auto_mode_fbs",
+    srcs = ["auto_mode.fbs"],
+    gen_reflections = 1,
     visibility = ["//visibility:public"],
 )
 
@@ -29,3 +38,14 @@
         "//y2019/control_loops/drivetrain:target_selector_fbs",
     ],
 )
+
+aos_config(
+    name = "config",
+    src = "autonomous_config.json",
+    flatbuffers = [
+        "//aos/actions:actions_fbs",
+        ":auto_fbs",
+        ":auto_mode_fbs",
+    ],
+    visibility = ["//visibility:public"],
+)
diff --git a/frc971/autonomous/auto.fbs b/frc971/autonomous/auto.fbs
index 92ca532..ef8e915 100644
--- a/frc971/autonomous/auto.fbs
+++ b/frc971/autonomous/auto.fbs
@@ -1,11 +1,5 @@
 namespace frc971.autonomous;
 
-// Published on ".frc971.autonomous.auto_mode"
-table AutonomousMode {
-  // Mode read from the mode setting sensors.
-  mode:int;
-}
-
 table AutonomousActionParams {
   // The mode from the sensors when auto starts.
   mode:int;
@@ -15,3 +9,5 @@
   run:uint;
   params:AutonomousActionParams;
 }
+
+root_type Goal;
diff --git a/frc971/autonomous/auto_mode.fbs b/frc971/autonomous/auto_mode.fbs
new file mode 100644
index 0000000..412cd17
--- /dev/null
+++ b/frc971/autonomous/auto_mode.fbs
@@ -0,0 +1,8 @@
+namespace frc971.autonomous;
+
+table AutonomousMode {
+  // Mode read from the mode setting sensors.
+  mode:int;
+}
+
+root_type AutonomousMode;
diff --git a/frc971/autonomous/autonomous_config.json b/frc971/autonomous/autonomous_config.json
new file mode 100644
index 0000000..5320325
--- /dev/null
+++ b/frc971/autonomous/autonomous_config.json
@@ -0,0 +1,17 @@
+{
+  "channels":
+  [
+    {
+      "name": "/autonomous",
+      "type": "aos.common.actions.Status"
+    },
+    {
+      "name": "/autonomous",
+      "type": "frc971.autonomous.Goal"
+    },
+    {
+      "name": "/autonomous",
+      "type": "frc971.autonomous.AutonomousMode"
+    }
+  ]
+}
diff --git a/frc971/autonomous/base_autonomous_actor.h b/frc971/autonomous/base_autonomous_actor.h
index 6035551..09d9a0e 100644
--- a/frc971/autonomous/base_autonomous_actor.h
+++ b/frc971/autonomous/base_autonomous_actor.h
@@ -25,7 +25,7 @@
       const control_loops::drivetrain::DrivetrainConfig<double> &dt_config);
 
   static Factory MakeFactory(::aos::EventLoop *event_loop) {
-    return Factory(event_loop, ".frc971.autonomous.autonomous_action");
+    return Factory(event_loop, "/autonomous");
   }
 
  protected:
diff --git a/frc971/downloader.bzl b/frc971/downloader.bzl
index 842398f58..aff3420 100644
--- a/frc971/downloader.bzl
+++ b/frc971/downloader.bzl
@@ -1,7 +1,7 @@
 load("//frc971/downloader:downloader.bzl", "aos_downloader")
 load("//tools/build_rules:label.bzl", "expand_label")
 
-def robot_downloader(start_binaries, binaries = [], dirs = None, default_target = None):
+def robot_downloader(start_binaries, binaries = [], data = [], dirs = None, default_target = None):
     """Sets up the standard robot download targets.
 
     Attrs:
@@ -17,7 +17,7 @@
         ] + start_binaries,
         srcs = [
             "//aos:prime_binaries",
-        ] + binaries,
+        ] + binaries + data,
         dirs = dirs,
         default_target = default_target,
         restricted_to = ["//tools:roborio"],
@@ -30,7 +30,7 @@
         ] + [expand_label(binary) + ".stripped" for binary in start_binaries],
         srcs = [
             "//aos:prime_binaries_stripped",
-        ] + [expand_label(binary) + ".stripped" for binary in binaries],
+        ] + [expand_label(binary) + ".stripped" for binary in binaries] + data,
         dirs = dirs,
         default_target = default_target,
         restricted_to = ["//tools:roborio"],
diff --git a/frc971/wpilib/BUILD b/frc971/wpilib/BUILD
index 8d0982a..c2cdb51 100644
--- a/frc971/wpilib/BUILD
+++ b/frc971/wpilib/BUILD
@@ -8,6 +8,7 @@
     srcs = [
         "logging.fbs",
     ],
+    gen_reflections = 1,
 )
 
 cc_library(
@@ -127,6 +128,15 @@
 )
 
 aos_config(
+    name = "config",
+    src = "wpilib_config.json",
+    flatbuffers = [
+        ":pdp_values_fbs",
+        ":logging_fbs",
+    ],
+)
+
+aos_config(
     name = "loop_output_handler_test_config",
     src = "loop_output_handler_test_config_source.json",
     flatbuffers = [
@@ -208,10 +218,11 @@
 )
 
 flatbuffer_cc_library(
-    name = "pdp_values",
+    name = "pdp_values_fbs",
     srcs = [
         "pdp_values.fbs",
     ],
+    gen_reflections = 1,
 )
 
 cc_library(
@@ -224,7 +235,7 @@
     ],
     restricted_to = ["//tools:roborio"],
     deps = [
-        ":pdp_values",
+        ":pdp_values_fbs",
         "//aos:init",
         "//aos/events:event_loop",
         "//aos/util:phased_loop",
diff --git a/frc971/wpilib/logging.fbs b/frc971/wpilib/logging.fbs
index 473526f..fcb4235 100644
--- a/frc971/wpilib/logging.fbs
+++ b/frc971/wpilib/logging.fbs
@@ -5,3 +5,5 @@
   compressor_on:bool;
   read_solenoids:ubyte;
 }
+
+root_type PneumaticsToLog;
diff --git a/frc971/wpilib/sensor_reader.cc b/frc971/wpilib/sensor_reader.cc
index 8610105..d4ea66e 100644
--- a/frc971/wpilib/sensor_reader.cc
+++ b/frc971/wpilib/sensor_reader.cc
@@ -18,7 +18,7 @@
 SensorReader::SensorReader(::aos::EventLoop *event_loop)
     : event_loop_(event_loop),
       robot_state_sender_(
-          event_loop_->MakeSender<::aos::RobotState>(".aos.robot_state")),
+          event_loop_->MakeSender<::aos::RobotState>("/aos")),
       my_pid_(getpid()) {
   // Set some defaults.  We don't tend to exceed these, so old robots should
   // just work with them.
diff --git a/frc971/wpilib/wpilib_config.json b/frc971/wpilib/wpilib_config.json
new file mode 100644
index 0000000..eb9a716
--- /dev/null
+++ b/frc971/wpilib/wpilib_config.json
@@ -0,0 +1,13 @@
+{
+  "channels":
+  [
+    {
+      "name": "/aos",
+      "type": "frc971.PDPValues"
+    },
+    {
+      "name": "/aos",
+      "type": "frc971.wpilib.PneumaticsToLog"
+    }
+  ]
+}