Merge commit '7c1ae250acb4120322b01a666993ed63c795ef21' into master

Update flatbuffers to latest master.

This adds an upstream flatbuffer_ts_library rule and changes the
typescript codegen, so ends up touching every typescript file we have
that uses flatbuffers. But it does clean up some of the hacks we had to
make to get that to work.

Had to hack the flatbuffer_ts_library a bit because I forgot to make
imports work nicely for cross-repo things.

And of course, the original motivation for this is that it gives us
proper handling of transitive dependencies for
flatbuffer_cc_library, if we start using the deps attribute!

Had to modify the codegen for the new declaration_file attribute in
flatbuffer schemas to make it just be the filename rather than including
the path. Modifying that to make it use a workspace-relative path was
looking obnoxious. It's definitely feasible, but since we don't actually
need that attribute, just make it be a filename for now.

Change-Id: I523a758cafa512fa2a686c9705d23337a26798ca
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/wpilib/imu_plot_utils.ts b/frc971/wpilib/imu_plot_utils.ts
index 7657d37..08b3c13 100644
--- a/frc971/wpilib/imu_plot_utils.ts
+++ b/frc971/wpilib/imu_plot_utils.ts
@@ -1,16 +1,11 @@
 // This script provides a basic utility for de-batching the IMUValues
 // message. See imu_plotter.ts for usage.
-import * as configuration from 'org_frc971/aos/configuration_generated';
-import * as imu from 'org_frc971/frc971/wpilib/imu_batch_generated';
+import {IMUValuesBatch} from 'org_frc971/frc971/wpilib/imu_batch_generated';
 import {MessageHandler, TimestampedMessage} from 'org_frc971/aos/network/www/aos_plotter';
 import {Point} from 'org_frc971/aos/network/www/plotter';
 import {Table} from 'org_frc971/aos/network/www/reflection';
-import {ByteBuffer} from 'org_frc971/external/com_github_google_flatbuffers/ts/byte-buffer';
-import {Long} from 'org_frc971/external/com_github_google_flatbuffers/ts/long';
-
-import Schema = configuration.reflection.Schema;
-import IMUValuesBatch = imu.frc971.IMUValuesBatch;
-import IMUValues = imu.frc971.IMUValues;
+import {ByteBuffer} from 'flatbuffers';
+import {Schema} from 'org_frc971/external/com_github_google_flatbuffers/reflection/reflection_generated';
 
 const FILTER_WINDOW_SIZE = 100;
 
@@ -20,23 +15,21 @@
   constructor(private readonly schema: Schema) {
     super(schema);
   }
-  private readScalar(table: Table, fieldName: string): number|Long|null {
+  private readScalar(table: Table, fieldName: string): number|BigInt|null {
     return this.parser.readScalar(table, fieldName);
   }
   addMessage(data: Uint8Array, time: number): void {
-    const batch = IMUValuesBatch.getRootAsIMUValuesBatch(
-        new ByteBuffer(data) as unknown as flatbuffers.ByteBuffer);
+    const batch = IMUValuesBatch.getRootAsIMUValuesBatch(new ByteBuffer(data));
     for (let ii = 0; ii < batch.readingsLength(); ++ii) {
       const message = batch.readings(ii);
       const table = Table.getNamedTable(
-          message.bb as unknown as ByteBuffer, this.schema, 'frc971.IMUValues',
-          message.bb_pos);
+          message.bb, this.schema, 'frc971.IMUValues', message.bb_pos);
       if (this.parser.readScalar(table, "monotonic_timestamp_ns") == null) {
         console.log('Ignoring unpopulated IMU values: ');
         console.log(this.parser.toObject(table));
         continue;
       }
-      const time = message.monotonicTimestampNs().toFloat64() * 1e-9;
+      const time = Number(message.monotonicTimestampNs()) * 1e-9;
       this.messages.push(new TimestampedMessage(table, time));
       this.acceleration_magnitudes.push(new Point(
           time,