tasks: simulation: restructure sim data storage to better support the next step of resampling data to fit the configured partition
This commit is contained in:
@@ -43,7 +43,8 @@ pub enum Measurement {
|
||||
SensorHardwareStatus(SensorSource, SensorState),
|
||||
|
||||
// Simulation metadata updates
|
||||
SimulationProgress(SensorSource, Duration, f32)
|
||||
SimulationProgress(SensorSource, Duration, f32),
|
||||
Annotation
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
@@ -83,27 +84,30 @@ pub enum Telemetry {
|
||||
// GPS data = 2, motion data = 1
|
||||
#[derive(Debug, EnumSetType, Enum)]
|
||||
pub enum SensorSource {
|
||||
Unknown = 0,
|
||||
// Real hardware
|
||||
IMU = 1,
|
||||
GPS = 2,
|
||||
|
||||
// Fusion outputs
|
||||
GravityReference,
|
||||
GravityReference = 100,
|
||||
ForwardsReference,
|
||||
Location,
|
||||
|
||||
// Simulated sensors
|
||||
Demo,
|
||||
Simulation
|
||||
Simulation,
|
||||
Annotations = 3
|
||||
}
|
||||
|
||||
impl From<i8> for SensorSource {
|
||||
fn from(value: i8) -> Self {
|
||||
impl TryFrom<i8> for SensorSource {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(value: i8) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
1 => SensorSource::IMU,
|
||||
2 => SensorSource::GPS,
|
||||
_ => SensorSource::Unknown
|
||||
1 => Ok(SensorSource::IMU),
|
||||
2 => Ok(SensorSource::GPS),
|
||||
3 => Ok(SensorSource::Annotations),
|
||||
_ => Err(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user