Add ids to flatbuffer fields in y2012, y2016, frc971, and aos

Change-Id: I9ed9006ce6224e2df0459df47771786b928164a1
diff --git a/aos/actions/actions.fbs b/aos/actions/actions.fbs
index aa4f7a7..d47df08 100644
--- a/aos/actions/actions.fbs
+++ b/aos/actions/actions.fbs
@@ -2,25 +2,25 @@
 
 table Status {
   // The run value of the instance we're currently running or 0.
-  running:uint;
+  running:uint (id: 0);
   // A run value we were previously running or 0.
-  last_running:uint;
+  last_running:uint (id: 1);
   // If false the action failed to complete and may be in a bad state,
   // this is a critical problem not a cancellation.
-  success:bool;
+  success:bool (id: 2);
 }
 
 table DoubleParam {
-  val:double;
+  val:double (id: 0);
 }
 
 table Goal {
   // The unique value to put into status.running while running this instance or
   // 0 to cancel.
-  run:uint;
+  run:uint (id: 0);
   // Default parameter.  The more useful thing to do would be to define your own
   // goal type to change param to a useful structure.
-  params:DoubleParam;
+  params:DoubleParam (id: 1);
 }
 
 root_type Status;
diff --git a/aos/actions/test_action.fbs b/aos/actions/test_action.fbs
index 8aebcb8..51de3b9 100644
--- a/aos/actions/test_action.fbs
+++ b/aos/actions/test_action.fbs
@@ -1,22 +1,22 @@
 namespace aos.common.actions;
 
 table UInt {
-  val:uint;
+  val:uint (id: 0);
 }
 
 table TestActionGoal {
-  run:uint;
-  params:UInt;
+  run:uint (id: 0);
+  params:UInt (id: 1);
 }
 
 table MyParams {
-  param1:double;
-  param2:int;
+  param1:double (id: 0);
+  param2:int (id: 1);
 }
 
 table TestAction2Goal {
-  run:uint;
-  params:MyParams;
+  run:uint (id: 0);
+  params:MyParams (id: 1);
 }
 
 root_type TestActionGoal;
diff --git a/aos/actions/test_action2.fbs b/aos/actions/test_action2.fbs
index 906867f..f20f414 100644
--- a/aos/actions/test_action2.fbs
+++ b/aos/actions/test_action2.fbs
@@ -1,13 +1,13 @@
 namespace aos.common.actions;
 
 table MyParams {
-  param1:double;
-  param2:int;
+  param1:double (id: 0);
+  param2:int (id: 1);
 }
 
 table TestAction2Goal {
-  run:uint;
-  params:MyParams;
+  run:uint (id: 0);
+  params:MyParams (id: 1);
 }
 
 root_type TestAction2Goal;
diff --git a/aos/controls/control_loops.fbs b/aos/controls/control_loops.fbs
index 8456bfa..be5b7db 100644
--- a/aos/controls/control_loops.fbs
+++ b/aos/controls/control_loops.fbs
@@ -3,19 +3,19 @@
 // control loop.
 
 table Goal {
-  goal:double;
+  goal:double (id: 0);
 }
 
 table Position {
-  position:double;
+  position:double (id: 0);
 }
 
 table Output {
-  voltage:double;
+  voltage:double (id: 0);
 }
 
 table Status {
-  done:bool;
+  done:bool (id: 0);
 }
 
 root_type Goal;
diff --git a/aos/events/event_loop.fbs b/aos/events/event_loop.fbs
index 4053a75..1434c4e 100644
--- a/aos/events/event_loop.fbs
+++ b/aos/events/event_loop.fbs
@@ -4,85 +4,85 @@
 
 // Holds statistics for a time or size sample.
 table Statistic {
-  average:float = nan;
-  min:float = nan;
-  max:float = nan;
-  standard_deviation:float = nan;
+  average:float = nan (id: 0);
+  min:float = nan (id: 1);
+  max:float = nan (id: 2);
+  standard_deviation:float = nan (id: 3);
 }
 
 table Sender {
   // Index into the channel config for this event loop.
-  channel_index:int = -1;
+  channel_index:int = -1 (id: 0);
 
   // Number of messages published.
-  count:uint;
+  count:uint (id: 1);
   // Statistics on the size of messages published.
-  size:Statistic;
+  size:Statistic (id: 2);
 
   // Channel for this sender.  Not filled out by default.
-  channel:Channel;
+  channel:Channel (id: 3);
 }
 
 table Watcher {
   // Index into the channel config for this event loop.
-  channel_index:int = -1;
+  channel_index:int = -1 (id: 0);
 
   // Number of messages received since the last report.
-  count:uint;
+  count:uint (id: 1);
 
   // Latency measurement from when the event was generated (send time), and when
   // the handler was started.
-  wakeup_latency:Statistic;
+  wakeup_latency:Statistic (id: 2);
   // Statistics on the execution time of the handler.
-  handler_time:Statistic;
+  handler_time:Statistic (id: 3);
 
   // Channel for this watcher.  Not filled out by default.
-  channel:Channel;
+  channel:Channel (id: 4);
 }
 
 table Fetcher {
   // Index into the channel config for this event loop.
-  channel_index:int = -1;
+  channel_index:int = -1 (id: 0);
 
   // Number of messages fetched since the last time this was published.
-  count:uint;
+  count:uint (id: 1);
   // Latency measurement from when the event was generated (send time), and when
   // the message was fetched.
-  latency:Statistic;
+  latency:Statistic (id: 2);
 
   // Channel for this fetcher.  Not filled out by default.
-  channel:Channel;
+  channel:Channel (id: 3);
 }
 
 table Timer {
-  name:string;
+  name:string (id: 0);
 
   // Number of wakeups since the last report.
-  count:uint;
+  count:uint (id: 1);
 
   // Latency measurement from when the event was generated (send time), and when
   // the handler was started.
-  wakeup_latency:Statistic;
+  wakeup_latency:Statistic (id: 2);
   // Statistics on the execution time of the handler.
-  handler_time:Statistic;
+  handler_time:Statistic (id: 3);
 
   // Maximum number of cycles missed.
 }
 
 table Report {
   // Name of the event loop which is publishing this report.
-  name:string;
+  name:string (id: 0);
   // Identifier for the event loop.  This should change every time a process
   // gets restarted.
-  pid:int;
+  pid:int (id: 1);
 
   // List of statistics for each watcher, sender, fetcher, timer, and
   // phased loop.
-  watchers:[Watcher];
-  senders:[Sender];
-  fetchers:[Fetcher];
-  timers:[Timer];
-  phased_loops:[Timer];
+  watchers:[Watcher] (id: 2);
+  senders:[Sender] (id: 3);
+  fetchers:[Fetcher] (id: 4);
+  timers:[Timer] (id: 5);
+  phased_loops:[Timer] (id: 6);
 }
 
 root_type Report;
diff --git a/aos/events/logging/test_message.fbs b/aos/events/logging/test_message.fbs
index ef876aa..6802a86 100644
--- a/aos/events/logging/test_message.fbs
+++ b/aos/events/logging/test_message.fbs
@@ -1,7 +1,7 @@
 namespace aos.logger.testing;
 
 table TestMessage {
-  value:int;
+  value:int (id: 0);
 }
 
 root_type TestMessage;
diff --git a/aos/events/ping.fbs b/aos/events/ping.fbs
index c41498b..ccad470 100644
--- a/aos/events/ping.fbs
+++ b/aos/events/ping.fbs
@@ -1,8 +1,8 @@
 namespace aos.examples;
 
 table Ping {
-  value:int;
-  send_time:long;
+  value:int (id: 0);
+  send_time:long (id: 1);
 }
 
 root_type Ping;
diff --git a/aos/events/pong.fbs b/aos/events/pong.fbs
index 115dbbe..19b5db4 100644
--- a/aos/events/pong.fbs
+++ b/aos/events/pong.fbs
@@ -1,8 +1,8 @@
 namespace aos.examples;
 
 table Pong {
-  value:int;
-  initial_send_time:long;
+  value:int (id: 0);
+  initial_send_time:long (id: 1);
 }
 
 root_type Pong;
diff --git a/aos/events/test_message.fbs b/aos/events/test_message.fbs
index 1d26c2e..df2ffd7 100644
--- a/aos/events/test_message.fbs
+++ b/aos/events/test_message.fbs
@@ -1,7 +1,7 @@
 namespace aos;
 
 table TestMessage {
-  value:int;
+  value:int (id: 0);
 }
 
 root_type TestMessage;
diff --git a/aos/json_to_flatbuffer.fbs b/aos/json_to_flatbuffer.fbs
index ad2c901..7ce9ae6 100644
--- a/aos/json_to_flatbuffer.fbs
+++ b/aos/json_to_flatbuffer.fbs
@@ -22,30 +22,30 @@
 }
 
 table Location {
-  name:string;
-  type:string;
-  frequency:int;
-  max_size:int;
+  name:string (id: 0);
+  type:string (id: 1);
+  frequency:int (id: 2);
+  max_size:int (id: 3);
 }
 
 table Map {
-  match:Location;
-  rename:Location;
+  match:Location (id: 0);
+  rename:Location (id: 1);
 }
 
 table Application {
-  name:string;
-  priority:int;
-  maps:[Map];
-  long_thingy:uint64;
+  name:string (id: 0);
+  priority:int (id: 1);
+  maps:[Map] (id: 2);
+  long_thingy:uint64 (id: 3);
 }
 
 table VectorOfStrings {
-  str:[string];
+  str:[string] (id: 0);
 }
 
 table VectorOfVectorOfString {
-  v:[VectorOfStrings];
+  v:[VectorOfStrings] (id: 0);
 }
 
 struct FooStructNested {
diff --git a/aos/logging/log_message.fbs b/aos/logging/log_message.fbs
index 7e246cf..b68287f 100644
--- a/aos/logging/log_message.fbs
+++ b/aos/logging/log_message.fbs
@@ -18,10 +18,10 @@
   level:Level (id: 1);
 
   // Pid of the process creating the log message
-  source_pid:int (id:2);
+  source_pid:int (id: 2);
 
   // Application name
-  name:string (id:3);
+  name:string (id: 3);
 }
 
 root_type LogMessageFbs;
diff --git a/aos/network/connect.fbs b/aos/network/connect.fbs
index 32893b8..b593472 100644
--- a/aos/network/connect.fbs
+++ b/aos/network/connect.fbs
@@ -6,8 +6,8 @@
 // It communicates the channels that need to be forwarded back.
 table Connect {
   // The node making the request.
-  node:aos.Node;
+  node:aos.Node (id: 0);
 
   // The channels that we want transfered to this client.
-  channels_to_transfer:[Channel];
+  channels_to_transfer:[Channel] (id: 1);
 }
diff --git a/aos/network/message_bridge_client.fbs b/aos/network/message_bridge_client.fbs
index df3f02f..9dddd16 100644
--- a/aos/network/message_bridge_client.fbs
+++ b/aos/network/message_bridge_client.fbs
@@ -5,25 +5,25 @@
 // Statistics from a single client connection to a server.
 table ClientConnection {
   // The node that we are connected to.
-  node:Node;
+  node:Node (id: 0);
 
   // Health of this connection.  Connected or not?
-  state:State;
+  state:State (id: 1);
 
   // Number of packets received on all channels.
-  received_packets:uint;
+  received_packets:uint (id: 2);
 
   // This is the measured monotonic offset for just the server -> client
   // direction measured in nanoseconds.  Subtract this from our monotonic time
   // to get their monotonic time.
-  monotonic_offset:int64;
+  monotonic_offset:int64 (id: 3);
 
   // TODO(austin): Per channel counts?
 }
 
 // Statistics for all clients.
 table ClientStatistics {
-  connections:[ClientConnection];
+  connections:[ClientConnection] (id: 0);
 }
 
 root_type ClientStatistics;
diff --git a/aos/network/message_bridge_server.fbs b/aos/network/message_bridge_server.fbs
index 8f06fdb..1be0796 100644
--- a/aos/network/message_bridge_server.fbs
+++ b/aos/network/message_bridge_server.fbs
@@ -11,28 +11,28 @@
 // Statistics from a single connection to a client from this server.
 table ServerConnection {
   // The node that we are connected to.
-  node:Node;
+  node:Node (id: 0);
 
   // Health of this connection.  Connected or not?
-  state:State;
+  state:State (id: 1);
 
   // Number of packets that have been dropped (if known).
-  dropped_packets:uint;
+  dropped_packets:uint (id: 2);
 
   // Number of packets received on all channels.
-  sent_packets:uint;
+  sent_packets:uint (id: 3);
 
   // This is the measured monotonic offset for the connected node in
   // nanoseconds.  Add this to our monotonic time to get their
   // monotonic time.
-  monotonic_offset:int64;
+  monotonic_offset:int64 (id: 4);
 
   // TODO(austin): Per channel counts?
 }
 
 // Statistics for all connections to all the clients.
 table ServerStatistics {
-  connections:[ServerConnection];
+  connections:[ServerConnection] (id: 0);
 }
 
 root_type ServerStatistics;
diff --git a/aos/network/timestamp.fbs b/aos/network/timestamp.fbs
index 299ecaf..ccd7f40 100644
--- a/aos/network/timestamp.fbs
+++ b/aos/network/timestamp.fbs
@@ -3,13 +3,13 @@
 namespace aos.message_bridge;
 
 table ClientOffset {
-  node:Node;
+  node:Node (id: 0);
 
-  monotonic_offset:int64;
+  monotonic_offset:int64 (id: 1);
 }
 
 table Timestamp {
-  offsets:[ClientOffset];
+  offsets:[ClientOffset] (id: 0);
 }
 
 root_type Timestamp;
diff --git a/aos/network/web_proxy.fbs b/aos/network/web_proxy.fbs
index 196d38c..e11ff26 100644
--- a/aos/network/web_proxy.fbs
+++ b/aos/network/web_proxy.fbs
@@ -16,24 +16,24 @@
 // The SDP payload is an opaque string that describes what (media/data) we
 // want to transmit.
 table WebSocketSdp {
-  type:SdpType;
-  payload:string;
+  type:SdpType (id: 0);
+  payload:string (id: 1);
 }
 
 // ICE is way for different peers to learn how to connect to each other.
 // Because we will only be running in a local network, we don't have to support
 // advaced features.
 table WebSocketIce {
-  candidate:string;
-  sdpMid:string;
-  sdpMLineIndex:int;
+  candidate:string (id: 0);
+  sdpMid:string (id: 1);
+  sdpMLineIndex:int (id: 2);
 }
 
 union Payload {WebSocketSdp, WebSocketIce}
 
 // We only send a single type of message on the websocket to simplify parsing.
 table WebSocketMessage {
-  payload:Payload;
+  payload:Payload (id: 1);
 }
 
 // WebRTC has size limits on the messages sent on datachannels. This message
@@ -42,22 +42,22 @@
 // data starts again.
 table MessageHeader {
   // Index of the channel in config
-  channel_index:uint;
+  channel_index:uint (id: 0);
 
   // How many packets will be required for the message being sent.
-  packet_count:uint;
+  packet_count:uint (id: 1);
   // What index into the the total packets for the multipart message, this
   // header is parts of.
-  packet_index:uint;
+  packet_index:uint (id: 2);
 
   // Total number of bytes in the message
-  length:uint;
+  length:uint (id: 3);
 
   // Index into the sequence of messages. This will not always increase.
-  queue_index:uint;
+  queue_index:uint (id: 4);
 
-  data:[ubyte];
+  data:[ubyte] (id: 5);
 
   // Time at which the message was sent, in nanoseconds.
-  monotonic_sent_time:long;
+  monotonic_sent_time:long (id: 6);
 }
diff --git a/aos/robot_state/joystick_state.fbs b/aos/robot_state/joystick_state.fbs
index 1deaa06..2f48bdf 100644
--- a/aos/robot_state/joystick_state.fbs
+++ b/aos/robot_state/joystick_state.fbs
@@ -2,14 +2,14 @@
 
 table Joystick {
   // A bitmask of the butotn state.
-  buttons:ushort;
+  buttons:ushort (id: 0);
 
   // The 6 joystick axes.
   // TODO: Should have size of 6
-  axis:[double];
+  axis:[double] (id: 1);
 
   // The POV axis.
-  pov:int;
+  pov:int (id: 2);
 }
 
 enum Alliance : byte { kRed, kBlue, kInvalid }
@@ -18,18 +18,18 @@
 // joystick code hasn't died.  It is published on "/aos"
 table JoystickState {
   //TODO: should have fixed size.
-  joysticks:[Joystick];
+  joysticks:[Joystick] (id: 0);
 
-  test_mode:bool;
-  fms_attached:bool;
-  enabled:bool;
-  autonomous:bool;
-  team_id:ushort;
+  test_mode:bool (id: 1);
+  fms_attached:bool (id: 2);
+  enabled:bool (id: 3);
+  autonomous:bool (id: 4);
+  team_id:ushort (id: 5);
 
   // 2018 scale and switch positions.
   // TODO(austin): Push these out to a new message?
-  switch_left:bool;
-  scale_left:bool;
+  switch_left:bool (id: 6);
+  scale_left:bool (id: 7);
 
   // If this is true, then this message isn't actually from the control
   // system and so should not be trusted as evidence that the button inputs
@@ -37,13 +37,13 @@
   // However, most things should ignore this so that sending fake messages is
   // useful for testing. The only difference in behavior should be motors not
   // actually turning on.
-  fake:bool;
+  fake:bool (id: 8);
 
   // Color of our current alliance.
-  alliance:Alliance;
+  alliance:Alliance (id: 9);
 
   // String corresponding to the game data string
-  game_data:string;
+  game_data:string (id: 10);
 }
 
 root_type JoystickState;
diff --git a/aos/robot_state/robot_state.fbs b/aos/robot_state/robot_state.fbs
index 437cfd7..7d0199b 100644
--- a/aos/robot_state/robot_state.fbs
+++ b/aos/robot_state/robot_state.fbs
@@ -7,29 +7,29 @@
 table RobotState {
   // The PID of the process reading sensors.
   // This is here so control loops can tell when it changes.
-  reader_pid:int;
+  reader_pid:int (id: 0);
 
   // True when outputs are enabled.
   // Motor controllers keep going for a bit after this goes to false.
-  outputs_enabled:bool;
+  outputs_enabled:bool (id: 1);
   // Indicates whether something is browned out (I think motor controller
   // outputs). IMPORTANT: This is NOT !outputs_enabled. outputs_enabled goes to
   // false for other reasons too (disabled, e-stopped, maybe more).
-  browned_out:bool;
+  browned_out:bool (id: 2);
 
   // Whether the two sensor rails are currently working.
-  is_3v3_active:bool;
-  is_5v_active:bool;
+  is_3v3_active:bool (id: 3);
+  is_5v_active:bool (id: 4);
   // The current voltages measured on the two sensor rails.
-  voltage_3v3:double;
-  voltage_5v:double;
+  voltage_3v3:double (id: 5);
+  voltage_5v:double (id: 6);
 
   // The input voltage to the roboRIO.
-  voltage_roborio_in:double;
+  voltage_roborio_in:double (id: 7);
 
   // From the DriverStation object, aka what FMS sees and what shows up on the
   // actual driver's station.
-  voltage_battery:double;
+  voltage_battery:double (id: 8);
 }
 
 root_type RobotState;
diff --git a/aos/starter/starter.fbs b/aos/starter/starter.fbs
index 2234518..8c7cdae 100644
--- a/aos/starter/starter.fbs
+++ b/aos/starter/starter.fbs
@@ -46,30 +46,30 @@
 }
 
 table Status {
-  statuses: [ApplicationStatus];
+  statuses: [ApplicationStatus] (id: 0);
 }
 
 table ApplicationStatus {
-  name: string;
+  name: string (id: 0);
 
-  state: State;
+  state: State (id: 1);
 
   // Last exit code of the process. Has a value of 0 if not started.
-  last_exit_code: ubyte;
+  last_exit_code: ubyte (id: 2);
 
   // Last pid of the process. Could be associated with a different process
   // unless status == RUNNING. Not present if the process has not started.
-  pid: uint;
+  pid: uint (id: 3);
 
   // Unique id of this application and process
-  id: uint64;
+  id: uint64 (id: 4);
 
   // Start time in nanoseconds relative to monotonic clock
-  last_start_time: int64;
+  last_start_time: int64 (id: 5);
 
   // Indicates the reason the application is not running. Only valid if
   // application is STOPPED.
-  last_stop_reason: LastStopReason;
+  last_stop_reason: LastStopReason (id: 6);
 }
 
 root_type Status;
diff --git a/aos/starter/starter_rpc.fbs b/aos/starter/starter_rpc.fbs
index 0e72cff..21b7117 100644
--- a/aos/starter/starter_rpc.fbs
+++ b/aos/starter/starter_rpc.fbs
@@ -17,11 +17,11 @@
 }
 
 table StarterRpc {
-  command : Command;
+  command : Command (id: 0);
 
   // The name of the application to send the command to. Command is ignored if
   // the given application does not exist.
-  name: string;
+  name: string (id: 1);
 }
 
 root_type StarterRpc;