blob: db2695e6f960934c65919c92a35b6fc50cbaeec2 [file] [log] [blame]
namespace frc971;
// Represents all of the data for a single indexed encoder. In other words,
// just a relative encoder with an index pulse.
// The units on all of the positions are the same.
// All encoder values are relative to where the encoder was at some arbitrary
// point in time. All potentiometer values are relative to some arbitrary 0
// position which varies with each robot.
table IndexPosition {
// Current position read from the encoder.
encoder:double (id: 0);
// Position from the encoder latched at the last index pulse.
latched_encoder:double (id: 1);
// How many index pulses we've seen since startup. Starts at 0.
index_pulses:uint (id: 2);
}
// Represents all of the data for a single potentiometer and indexed encoder
// pair.
// The units on all of the positions are the same.
// All encoder values are relative to where the encoder was at some arbitrary
// point in time. All potentiometer values are relative to some arbitrary 0
// position which varies with each robot.
table PotAndIndexPosition {
// Current position read from the encoder.
encoder:double (id: 0);
// Current position read from the potentiometer.
pot:double (id: 1);
// Position from the encoder latched at the last index pulse.
latched_encoder:double (id: 2);
// Position from the potentiometer latched at the last index pulse.
latched_pot:double (id: 3);
// How many index pulses we've seen since startup. Starts at 0.
index_pulses:uint (id: 4);
}
// Represents all of the data for a single potentiometer with an absolute and
// relative encoder pair.
// The units on all of the positions are the same.
// The relative encoder values are relative to where the encoder was at some
// arbitrary point in time. All potentiometer values are relative to some
// arbitrary 0 position which varies with each robot.
table PotAndAbsolutePosition {
// Current position read from each encoder.
encoder:double (id: 0);
absolute_encoder:double (id: 1);
// Current position read from the potentiometer.
pot:double (id: 2);
}
// Represents all of the data for an absolute and relative encoder pair.
// The units on all of the positions are the same.
// The relative encoder values are relative to where the encoder was at some
// arbitrary point in time.
table AbsolutePosition {
// Current position read from each encoder.
encoder:double (id: 0);
absolute_encoder:double (id: 1);
}
// Represents all of the data for an absolute and relative encoder pair,
// along with an absolute encoder.
// They operate similarly to a pot and absolute encoder, but another absolute
// encoder is used in place of the potentiometer.
// The units on all of the positions are the same.
// The relative encoder values are relative to where the encoder was at some
// arbitrary point in time.
table AbsoluteAndAbsolutePosition {
// Current position read from each encoder.
encoder:double (id: 0);
absolute_encoder:double (id: 1);
// Current position read from the single turn absolute encoder.
// This can not turn more than one rotation.
single_turn_absolute_encoder:double (id: 2);
}
// Represents all of the data for a single encoder.
// The relative encoder values are relative to where the encoder was at some
// arbitrary point in time.
table RelativePosition {
// Current position read from the encoder.
encoder:double (id: 0);
}
// An enum to represent the different types of errors
// a zeroing estimator could have.
enum ZeroingError : short {
OFFSET_MOVED_TOO_FAR,
LOST_ABSOLUTE_ENCODER
}
// The internal state of a zeroing estimator.
table EstimatorState {
// If true, there has been a fatal error for the estimator.
error:bool (id: 0);
// If the joint has seen an index pulse and is zeroed.
zeroed:bool (id: 1);
// The estimated position of the joint.
position:double (id: 2);
// The estimated position not using the index pulse.
pot_position:double (id: 3);
}
// The internal state of a zeroing estimator.
table PotAndAbsoluteEncoderEstimatorState {
// If true, there has been a fatal error for the estimator.
error:bool (id: 0);
// If the joint has seen an index pulse and is zeroed.
zeroed:bool (id: 1);
// The estimated position of the joint.
position:double (id: 2);
// The estimated position not using the index pulse.
pot_position:double (id: 3);
// The estimated absolute position of the encoder. This is filtered, so it
// can be easily used when zeroing.
absolute_position:double (id: 4);
// If errored, this contains the causes for the error.
errors: [ZeroingError] (id: 5);
}
// The internal state of a zeroing estimator.
table AbsoluteEncoderEstimatorState {
// If true, there has been a fatal error for the estimator.
error:bool (id: 0);
// If the joint has seen an index pulse and is zeroed.
zeroed:bool (id: 1);
// The estimated position of the joint.
position:double (id: 2);
// The estimated absolute position of the encoder. This is filtered, so it
// can be easily used when zeroing.
absolute_position:double (id: 3);
// If errored, this contains the causes for the error.
errors: [ZeroingError] (id: 4);
}
// The internal state of a zeroing estimator.
table AbsoluteAndAbsoluteEncoderEstimatorState {
// If true, there has been a fatal error for the estimator.
error:bool (id: 0);
// If the joint has seen an index pulse and is zeroed.
zeroed:bool (id: 1);
// The estimated position of the joint.
position:double (id: 2);
// The estimated absolute position of the encoder. This is filtered, so it
// can be easily used when zeroing.
absolute_position:double (id: 3);
// Estimated absolute position of the single turn absolute encoder.
single_turn_absolute_position:double (id: 4);
// If errored, this contains the causes for the error.
errors: [ZeroingError] (id: 5);
}
table RelativeEncoderEstimatorState {
// If true, there has been a fatal error for the estimator.
error:bool (id: 0);
// The estimated position of the joint.
position:double (id: 1);
}
// The internal state of a zeroing estimator.
table IndexEstimatorState {
// If true, there has been a fatal error for the estimator.
error:bool (id: 0);
// If the joint has seen an index pulse and is zeroed.
zeroed:bool (id: 1);
// The estimated position of the joint. This is just the position relative to
// where we started if we're not zeroed yet.
position:double (id: 2);
// The positions of the extreme index pulses we've seen.
min_index_position:double (id: 3);
max_index_position:double (id: 4);
// The number of index pulses we've seen.
index_pulses_seen:int (id: 5);
}
table HallEffectAndPositionEstimatorState {
// If error.
error:bool (id: 0);
// If we've found a positive edge while moving backwards and is zeroed.
zeroed:bool (id: 1);
// Encoder angle relative to where we started.
encoder:double (id: 2);
// The positions of the extreme posedges we've seen.
// If we've gotten enough samples where the hall effect is high before can be
// certain it is not a false positive.
high_long_enough:bool (id: 3);
offset:double (id: 4);
}
// A left/right pair of PotAndIndexPositions.
table PotAndIndexPair {
left:PotAndIndexPosition (id: 0);
right:PotAndIndexPosition (id: 1);
}
// Records edges captured on a single hall effect sensor.
table HallEffectStruct {
current:bool (id: 0);
posedge_count:int (id: 1);
negedge_count:int (id: 2);
posedge_value:double (id: 3);
negedge_value:double (id: 4);
}
// Records the hall effect sensor and encoder values.
table HallEffectAndPosition {
// The current hall effect state.
current:bool (id: 0);
// The current encoder position.
encoder:double (id: 1);
// The number of positive and negative edges we've seen on the hall effect
// sensor.
posedge_count:int (id: 2);
negedge_count:int (id: 3);
// The values corresponding to the last hall effect sensor reading.
posedge_value:double (id: 4);
negedge_value:double (id: 5);
}
// Records the positions for a mechanism with edge-capturing sensors on it.
table HallEventPositions {
current:double (id: 0);
posedge:double (id: 1);
negedge:double (id: 2);
}
// Records edges captured on a single hall effect sensor.
table PosedgeOnlyCountedHallEffectStruct {
current:bool (id: 0);
posedge_count:int (id: 1);
negedge_count:int (id: 2);
posedge_value:double (id: 3);
}
// Parameters for the motion profiles.
table ProfileParameters {
// Maximum velocity for the profile.
max_velocity:float (id: 0);
// Maximum acceleration for the profile.
max_acceleration:float (id: 1);
}
table Range {
lower_hard:double (id: 0);
upper_hard:double (id: 1);
lower:double (id: 2);
upper:double (id: 3);
}
enum ConstraintType : byte {
CONSTRAINT_TYPE_UNDEFINED,
LONGITUDINAL_ACCELERATION,
LATERAL_ACCELERATION,
VOLTAGE,
VELOCITY,
}
// Definition of a constraint on a trajectory
table Constraint {
constraint_type:ConstraintType (id: 0);
value:float (id: 1);
// start and end distance are only checked for velocity limits.
start_distance:float (id: 2);
end_distance:float (id: 3);
}
// Parameters for computing a trajectory using a chain of splines and
// constraints.
table MultiSpline {
// Number of splines. The spline point arrays will be expected to have
// 6 + 5 * (n - 1) points in them. The endpoints are shared between
// neighboring splines.
spline_count:byte (id: 0);
// Maximum of 36 spline points (7 splines).
spline_x:[float] (id: 1);
spline_y:[float] (id: 2);
// Maximum of 6 constraints;
constraints:[Constraint] (id: 3);
}