Use explicit flatbuffer IDs in y2017 and newer.
Non-explicit ids are risky. We've seen backwards incompatible
changes...
Change-Id: Id6ceebe031ac80430191f367635d0e951c3d2cbc
diff --git a/y2019/control_loops/superstructure/superstructure_goal.fbs b/y2019/control_loops/superstructure/superstructure_goal.fbs
index 77e7c8d..93c31cd 100644
--- a/y2019/control_loops/superstructure/superstructure_goal.fbs
+++ b/y2019/control_loops/superstructure/superstructure_goal.fbs
@@ -4,34 +4,34 @@
table SuctionGoal {
// True = apply suction
- grab_piece:bool;
+ grab_piece:bool (id: 0);
// 0 = ball mode
// 1 = disk mode
- gamepiece_mode:int;
+ gamepiece_mode:int (id: 1);
}
table Goal {
// Meters, 0 = lowest position - mechanical hard stop,
// positive = upward
- elevator:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal;
+ elevator:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 0);
// 0 = linkage on the sprocket is pointing straight up,
// positive = forward
- intake:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal;
+ intake:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 1);
// 0 = Straight up parallel to elevator
// Positive rotates toward intake from 0
- wrist:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal;
+ wrist:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 2);
// Distance stilts extended out of the bottom of the robot. Positive = down.
// 0 is the height such that the bottom of the stilts is tangent to the
// bottom of the middle wheels.
- stilts:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal;
+ stilts:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 3);
// Positive is rollers intaking inward.
- roller_voltage:float;
+ roller_voltage:float (id: 4);
- suction:SuctionGoal;
+ suction:SuctionGoal (id: 5);
}
root_type Goal;
diff --git a/y2019/control_loops/superstructure/superstructure_output.fbs b/y2019/control_loops/superstructure/superstructure_output.fbs
index b679347..42ba6b2 100644
--- a/y2019/control_loops/superstructure/superstructure_output.fbs
+++ b/y2019/control_loops/superstructure/superstructure_output.fbs
@@ -2,29 +2,29 @@
table Output {
// Voltage sent to motors moving elevator up/down. Positive is up.
- elevator_voltage:double;
+ elevator_voltage:double (id: 0);
// Voltage sent to wrist motors on elevator to rotate.
// Positive rotates over the top towards the front of the robot.
- wrist_voltage:double;
+ wrist_voltage:double (id: 1);
// Voltage sent to motors on intake joint. Positive extends rollers.
- intake_joint_voltage:double;
+ intake_joint_voltage:double (id: 2);
// Voltage sent to rollers on intake. Positive rolls inward.
- intake_roller_voltage:double;
+ intake_roller_voltage:double (id: 3);
// Voltage sent to motors to move stilts height. Positive moves robot
// upward.
- stilts_voltage:double;
+ stilts_voltage:double (id: 4);
// True opens solenoid (applies suction)
// Top/bottom are when wrist is toward the front of the robot
- intake_suction_top:bool;
- intake_suction_bottom:bool;
+ intake_suction_top:bool (id: 5);
+ intake_suction_bottom:bool (id: 6);
// Voltage sent to the vacuum pump motors.
- pump_voltage:double;
+ pump_voltage:double (id: 7);
}
root_type Output;
diff --git a/y2019/control_loops/superstructure/superstructure_position.fbs b/y2019/control_loops/superstructure/superstructure_position.fbs
index 80a851e..86a615d 100644
--- a/y2019/control_loops/superstructure/superstructure_position.fbs
+++ b/y2019/control_loops/superstructure/superstructure_position.fbs
@@ -5,26 +5,26 @@
table Position {
// Input from pressure sensor in bar
// 1 = 1 atm, 0 = full vacuum
- suction_pressure:float;
+ suction_pressure:float (id: 0);
// Position of the elevator, 0 at lowest position, positive when up.
- elevator:frc971.PotAndAbsolutePosition;
+ elevator:frc971.PotAndAbsolutePosition (id: 1);
// Position of wrist, 0 when up, positive is rotating toward the front,
// over the top.
- wrist:frc971.PotAndAbsolutePosition;
+ wrist:frc971.PotAndAbsolutePosition (id: 2);
// Position of the intake. 0 when rollers are retracted, positive extended.
- intake_joint:frc971.AbsolutePosition;
+ intake_joint:frc971.AbsolutePosition (id: 3);
// Position of the stilts, 0 when retracted (defualt), positive lifts robot.
- stilts:frc971.PotAndAbsolutePosition;
+ stilts:frc971.PotAndAbsolutePosition (id: 4);
// True if the platform detection sensors detect the platform directly
// below the robot right behind the left and right wheels. Useful for
// determining when the robot is all the way on the platform.
- platform_left_detect:bool;
- platform_right_detect:bool;
+ platform_left_detect:bool (id: 5);
+ platform_right_detect:bool (id: 6);
}
root_type Position;
diff --git a/y2019/control_loops/superstructure/superstructure_status.fbs b/y2019/control_loops/superstructure/superstructure_status.fbs
index 9d3f44e..98fe483 100644
--- a/y2019/control_loops/superstructure/superstructure_status.fbs
+++ b/y2019/control_loops/superstructure/superstructure_status.fbs
@@ -5,19 +5,19 @@
table Status {
// All subsystems know their location.
- zeroed:bool;
+ zeroed:bool (id: 0);
// If true, we have aborted. This is the or of all subsystem estops.
- estopped:bool;
+ estopped:bool (id: 1);
// Whether suction_pressure indicates cargo is held
- has_piece:bool;
+ has_piece:bool (id: 2);
// Status of each subsystem.
- elevator:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus;
- wrist:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus;
- intake:frc971.control_loops.AbsoluteEncoderProfiledJointStatus;
- stilts:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus;
+ elevator:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 3);
+ wrist:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 4);
+ intake:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 5);
+ stilts:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 6);
}
root_type Status;