1010
1111use crate :: {
1212 c_bindings,
13- coords:: AzimuthElevation ,
13+ coords:: { AzimuthElevation , ECEF } ,
1414 signal:: { Code , Constellation , GnssSignal } ,
1515 time:: GpsTime ,
16- Vec3 ,
1716} ;
1817use std:: fmt:: { Display , Formatter } ;
1918
@@ -268,9 +267,9 @@ impl Ephemeris {
268267 /// Calculate satellite position, velocity and clock offset from ephemeris.
269268 pub fn calc_satellite_state ( & self , t : & GpsTime ) -> Result < SatelliteState > {
270269 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 ( ) ,
274273 clock_err : 0.0 ,
275274 clock_rate_err : 0.0 ,
276275 iodc : 0 ,
@@ -298,7 +297,7 @@ impl Ephemeris {
298297
299298 /// Calculate the azimuth and elevation of a satellite from a reference
300299 /// 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 > {
302301 let mut sat = AzimuthElevation :: default ( ) ;
303302
304303 let result = unsafe {
@@ -322,7 +321,7 @@ impl Ephemeris {
322321
323322 /// Calculate the Doppler shift of a satellite as observed at a reference
324323 /// 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 > {
326325 let mut doppler = 0.0 ;
327326
328327 let result = unsafe {
@@ -379,11 +378,11 @@ impl Default for Ephemeris {
379378/// certain time.
380379pub struct SatelliteState {
381380 /// Calculated satellite position, in meters
382- pub pos : Vec3 ,
381+ pub pos : ECEF ,
383382 /// Calculated satellite velocity, in meters/second
384- pub vel : Vec3 ,
383+ pub vel : ECEF ,
385384 /// Calculated satellite acceleration, meters/second/second
386- pub acc : Vec3 ,
385+ pub acc : ECEF ,
387386 /// Calculated satellite clock error, in seconds
388387 pub clock_err : f64 ,
389388 /// Calculated satellite clock error rate, in seconds/second
0 commit comments