Skip to content

Commit 53cddd2

Browse files
committed
Merge branch 'main' into deconflict
2 parents aaa7dea + 8e6f0bf commit 53cddd2

7 files changed

Lines changed: 3721 additions & 1144 deletions

File tree

core/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ impl StrapdownState {
293293
/// * `altitude` - Altitude in meters.
294294
/// * `velocity_north` - North velocity in m/s.
295295
/// * `velocity_east` - East velocity in m/s.
296-
/// * `velocity_vertical` - Vertical velocity in m/s (positive up in ENU, positive down in NED).
297-
/// * `attitude` - `Rotation3<f64>` attitude matrix.
296+
/// * `velocity_down` - Down velocity in m/s.
297+
/// * `attitude` - Rotation3<f64> attitude matrix.
298298
/// * `in_degrees` - If true, angles are provided in degrees and will be converted to radians.
299299
#[allow(clippy::too_many_arguments)]
300300
pub fn new(
@@ -346,7 +346,7 @@ impl StrapdownState {
346346
// --- From/Into trait implementations for StrapdownState <-> Vec<f64> and &[f64] ---
347347
}
348348
impl From<StrapdownState> for Vec<f64> {
349-
/// Converts a StrapdownState to a `Vec<f64>` in order assuming angles are in radians.
349+
/// Converts a StrapdownState to a Vec<f64> in NED order, angles in radians.
350350
fn from(state: StrapdownState) -> Self {
351351
let (roll, pitch, yaw) = state.attitude.euler_angles();
352352
vec![
@@ -363,7 +363,7 @@ impl From<StrapdownState> for Vec<f64> {
363363
}
364364
}
365365
impl From<&StrapdownState> for Vec<f64> {
366-
/// Converts a reference to StrapdownState to a `Vec<f64>` in NED order assuming angles are in radians.
366+
/// Converts a reference to StrapdownState to a Vec<f64> in NED order, angles in radians.
367367
fn from(state: &StrapdownState) -> Self {
368368
let (roll, pitch, yaw) = state.attitude.euler_angles();
369369
vec![
@@ -396,19 +396,19 @@ impl TryFrom<&[f64]> for StrapdownState {
396396
}
397397
impl TryFrom<Vec<f64>> for StrapdownState {
398398
type Error = &'static str;
399-
/// Attempts to create a StrapdownState from a `Vec<f64>` of length 9 assuming angles in radians.
399+
/// Attempts to create a StrapdownState from a Vec<f64> of length 9 (NED order, radians).
400400
fn try_from(vec: Vec<f64>) -> Result<Self, Self::Error> {
401401
Self::try_from(vec.as_slice())
402402
}
403403
}
404404
impl From<StrapdownState> for DVector<f64> {
405-
/// Converts a StrapdownState to a `DVector<f64>` in NED order assuming angles are in radians.
405+
/// Converts a StrapdownState to a DVector<f64> in NED order, angles in radians.
406406
fn from(state: StrapdownState) -> Self {
407407
DVector::from_vec(state.into())
408408
}
409409
}
410410
impl From<&StrapdownState> for DVector<f64> {
411-
/// Converts a reference to StrapdownState to a `DVector<f64>` in NED order assuming angles are in radians.
411+
/// Converts a reference to StrapdownState to a DVector<f64> in NED order, angles in radians.
412412
fn from(state: &StrapdownState) -> Self {
413413
DVector::from_vec(state.into())
414414
}

core/src/messages.rs

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,65 +1561,4 @@ mod serialization_tests {
15611561
let loaded = GnssDegradationConfig::from_file(&path).unwrap();
15621562
assert_eq!(cfg.seed, loaded.seed);
15631563
}
1564-
1565-
#[test]
1566-
fn default_config_roundtrip() {
1567-
// Test that default config can be serialized and read back
1568-
let cfg = GnssDegradationConfig::default();
1569-
1570-
// Verify default values
1571-
assert_eq!(cfg.seed, 42);
1572-
assert!(matches!(cfg.scheduler, GnssScheduler::PassThrough));
1573-
assert!(matches!(cfg.fault, GnssFaultModel::None));
1574-
1575-
// Test JSON roundtrip
1576-
let f = NamedTempFile::new().unwrap();
1577-
let path = f.path().with_extension("json");
1578-
cfg.to_file(&path).unwrap();
1579-
let loaded = GnssDegradationConfig::from_file(&path).unwrap();
1580-
assert_eq!(cfg.seed, loaded.seed);
1581-
assert!(matches!(loaded.scheduler, GnssScheduler::PassThrough));
1582-
assert!(matches!(loaded.fault, GnssFaultModel::None));
1583-
1584-
// Test YAML roundtrip
1585-
let f2 = NamedTempFile::new().unwrap();
1586-
let path2 = f2.path().with_extension("yaml");
1587-
cfg.to_file(&path2).unwrap();
1588-
let loaded2 = GnssDegradationConfig::from_file(&path2).unwrap();
1589-
assert_eq!(cfg.seed, loaded2.seed);
1590-
1591-
// Test TOML roundtrip
1592-
let f3 = NamedTempFile::new().unwrap();
1593-
let path3 = f3.path().with_extension("toml");
1594-
cfg.to_file(&path3).unwrap();
1595-
let loaded3 = GnssDegradationConfig::from_file(&path3).unwrap();
1596-
assert_eq!(cfg.seed, loaded3.seed);
1597-
}
1598-
1599-
#[test]
1600-
fn unsupported_extension_error() {
1601-
let cfg = sample_cfg();
1602-
let f = NamedTempFile::new().unwrap();
1603-
let path = f.path().with_extension("txt");
1604-
1605-
// Test to_file with unsupported extension
1606-
let result = cfg.to_file(&path);
1607-
assert!(result.is_err());
1608-
assert_eq!(result.unwrap_err().kind(), std::io::ErrorKind::InvalidInput);
1609-
1610-
// Test from_file with unsupported extension
1611-
let result = GnssDegradationConfig::from_file(&path);
1612-
assert!(result.is_err());
1613-
assert_eq!(result.unwrap_err().kind(), std::io::ErrorKind::InvalidInput);
1614-
}
1615-
1616-
#[test]
1617-
fn yml_extension_roundtrip() {
1618-
let cfg = sample_cfg();
1619-
let f = NamedTempFile::new().unwrap();
1620-
let path = f.path().with_extension("yml");
1621-
cfg.to_file(&path).unwrap();
1622-
let loaded = GnssDegradationConfig::from_file(&path).unwrap();
1623-
assert_eq!(cfg.seed, loaded.seed);
1624-
}
16251564
}

core/src/sim.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,11 @@ pub fn dead_reckoning(records: &[TestDataRecord]) -> Vec<NavigationResult> {
802802
is_enu: true,
803803
};
804804
// Store the initial state and metadata
805-
info!("Initializing dead reckoning simulation at {}", state);
806-
results.push(NavigationResult::from((&first_record.time, &state)));
805+
results.push(NavigationResult::from((
806+
&first_record.time,
807+
&state.into(),
808+
&DMatrix::from_diagonal(&DVector::from_element(15, 0.0)),
809+
)));
807810
let mut previous_time = records[0].time;
808811
// Process each subsequent record
809812
for record in records.iter().skip(1) {
@@ -816,8 +819,11 @@ pub fn dead_reckoning(records: &[TestDataRecord]) -> Vec<NavigationResult> {
816819
gyro: Vector3::new(record.gyro_x, record.gyro_y, record.gyro_z),
817820
};
818821
forward(&mut state, imu_data, dt);
819-
results.push(NavigationResult::from((&current_time, &state)));
820-
info!("Updated state at {}: {:?}", current_time, state);
822+
results.push(NavigationResult::from((
823+
&current_time,
824+
&state.into(),
825+
&DMatrix::from_diagonal(&DVector::from_element(15, 0.0)),
826+
)));
821827
previous_time = record.time;
822828
}
823829
results

0 commit comments

Comments
 (0)