Expand description
Single-epoch receiver velocity range-rate model.
This leaf module starts with the deterministic Doppler/range-rate geometry shared by the later least-squares driver: each row compares a measured satellite range rate with the line-of-sight projection of satellite velocity, receiver velocity, receiver clock drift, and satellite clock drift.
use sidereon_core::precise_positioning::{
predict_range_rate_m_s, solve_velocity, ReceiverVelocityState, VelocityConfig,
VelocityObservation,
};
use sidereon_core::{GnssSatelliteId, GnssSystem};
let receiver_position_m = [0.0, 0.0, 0.0];
let receiver_velocity_m_s = [3.0, -2.0, 0.5];
let clock_drift_m_s = 0.25;
let satellite_positions_m = [
[20_200_000.0, 0.0, 0.0],
[0.0, 21_100_000.0, 0.0],
[0.0, 0.0, 22_300_000.0],
[-20_900_000.0, 19_700_000.0, 21_500_000.0],
[18_600_000.0, -20_400_000.0, 23_100_000.0],
];
let observations = satellite_positions_m
.iter()
.enumerate()
.map(|(idx, satellite_position_m)| {
let mut observation = VelocityObservation {
sat: GnssSatelliteId::new(GnssSystem::Gps, (idx + 1) as u8)
.expect("valid satellite id"),
satellite_position_m: *satellite_position_m,
satellite_velocity_m_s: [0.0, 0.0, 0.0],
measured_range_rate_m_s: 0.0,
sigma_m_s: 0.1,
satellite_clock_drift_m_s: 0.0,
};
observation.measured_range_rate_m_s = predict_range_rate_m_s(
&observation,
ReceiverVelocityState {
position_m: receiver_position_m,
velocity_m_s: receiver_velocity_m_s,
clock_drift_m_s,
},
)
.expect("nonzero synthetic line of sight")
.range_rate_m_s;
observation
})
.collect::<Vec<_>>();
let solution = solve_velocity(
&observations,
receiver_position_m,
VelocityConfig::default(),
)?;
assert!((solution.velocity_m_s[0] - receiver_velocity_m_s[0]).abs() < 1.0e-9);
assert!((solution.clock_drift_m_s - clock_drift_m_s).abs() < 1.0e-9);Structs§
- Range
Rate Prediction - Predicted range-rate geometry for one satellite observation.
- Receiver
Velocity State - Receiver state used by the range-rate prediction model.
- Velocity
Config - Configuration for a single-epoch Doppler/range-rate velocity solve.
- Velocity
Observation - One Doppler-derived range-rate observation for a satellite.
- Velocity
Robust Config - Opt-in robust reweighting configuration for the velocity solve.
- Velocity
Solution - Receiver velocity solve result for one Doppler/range-rate epoch.
Enums§
- Velocity
Solve Error - Error returned by the Doppler/range-rate velocity least-squares solve.
Functions§
- predict_
range_ rate_ m_ s - Predict the range rate for one observation and receiver state.
- solve_
velocity - Solve receiver velocity and clock drift for one epoch of range-rate observations.
- solve_
velocity_ least_ squares - Solve receiver velocity and clock drift from precomputed range-rate observations.