10
10
11
11
use crate :: {
12
12
c_bindings,
13
- coords:: AzimuthElevation ,
13
+ coords:: { AzimuthElevation , ECEF } ,
14
14
signal:: { Code , Constellation , GnssSignal } ,
15
15
time:: GpsTime ,
16
- Vec3 ,
17
16
} ;
18
17
use std:: fmt:: { Display , Formatter } ;
19
18
@@ -268,9 +267,9 @@ impl Ephemeris {
268
267
/// Calculate satellite position, velocity and clock offset from ephemeris.
269
268
pub fn calc_satellite_state ( & self , t : & GpsTime ) -> Result < SatelliteState > {
270
269
let mut sat = SatelliteState {
271
- pos : Vec3 :: default ( ) ,
272
- vel : Vec3 :: default ( ) ,
273
- acc : Vec3 :: default ( ) ,
270
+ pos : ECEF :: default ( ) ,
271
+ vel : ECEF :: default ( ) ,
272
+ acc : ECEF :: default ( ) ,
274
273
clock_err : 0.0 ,
275
274
clock_rate_err : 0.0 ,
276
275
iodc : 0 ,
@@ -298,7 +297,7 @@ impl Ephemeris {
298
297
299
298
/// Calculate the azimuth and elevation of a satellite from a reference
300
299
/// position given the satellite ephemeris.
301
- pub fn calc_satellite_az_el ( & self , t : & GpsTime , pos : & Vec3 ) -> Result < AzimuthElevation > {
300
+ pub fn calc_satellite_az_el ( & self , t : & GpsTime , pos : & ECEF ) -> Result < AzimuthElevation > {
302
301
let mut sat = AzimuthElevation :: default ( ) ;
303
302
304
303
let result = unsafe {
@@ -322,7 +321,7 @@ impl Ephemeris {
322
321
323
322
/// Calculate the Doppler shift of a satellite as observed at a reference
324
323
/// position given the satellite ephemeris.
325
- pub fn calc_satellite_doppler ( & self , t : & GpsTime , pos : & Vec3 , vel : & Vec3 ) -> Result < f64 > {
324
+ pub fn calc_satellite_doppler ( & self , t : & GpsTime , pos : & ECEF , vel : & ECEF ) -> Result < f64 > {
326
325
let mut doppler = 0.0 ;
327
326
328
327
let result = unsafe {
@@ -379,11 +378,11 @@ impl Default for Ephemeris {
379
378
/// certain time.
380
379
pub struct SatelliteState {
381
380
/// Calculated satellite position, in meters
382
- pub pos : Vec3 ,
381
+ pub pos : ECEF ,
383
382
/// Calculated satellite velocity, in meters/second
384
- pub vel : Vec3 ,
383
+ pub vel : ECEF ,
385
384
/// Calculated satellite acceleration, meters/second/second
386
- pub acc : Vec3 ,
385
+ pub acc : ECEF ,
387
386
/// Calculated satellite clock error, in seconds
388
387
pub clock_err : f64 ,
389
388
/// Calculated satellite clock error rate, in seconds/second
0 commit comments