File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,9 @@ fn main() {
169
169
. allowlist_var ( "pvt_err_msg" )
170
170
. allowlist_function ( "correct_iono" )
171
171
. allowlist_function ( "correct_tropo" )
172
+ . allowlist_type ( "geoid_model_t" )
172
173
. allowlist_function ( "get_geoid_offset" )
174
+ . allowlist_function ( "get_geoid_model" )
173
175
// Finish the builder and generate the bindings.
174
176
. generate ( )
175
177
// Unwrap the Result and panic on failure.
Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ use crate::coords::LLHRadians;
23
23
///
24
24
/// Currently only one model is compiled into the code at a time
25
25
pub enum GeoidModel {
26
- /// The EGM2008 geoid model, down sampled to 1 degree resolution
27
- Egm2008_1Deg ,
28
- /// The EGM2008 geoid model, down sampled to 15 arc minute resolution
29
- Egm2008_15Min ,
26
+ /// The EGM96 geoid model
27
+ Egm96 ,
28
+ /// The EGM2008 geoid model
29
+ Egm2008 ,
30
30
}
31
31
32
32
/// Get the offset of the geoid from the WGS84 ellipsoid
@@ -44,5 +44,11 @@ pub fn get_geoid_offset<T: Into<LLHRadians>>(pos: T) -> f32 {
44
44
45
45
/// Gets the geoid model compiled into the Swiftnav crate
46
46
pub fn get_geoid_model ( ) -> GeoidModel {
47
- GeoidModel :: Egm2008_1Deg
47
+ let model = unsafe { swiftnav_sys:: get_geoid_model ( ) } ;
48
+
49
+ match model {
50
+ swiftnav_sys:: geoid_model_t_GEOID_MODEL_EGM96 => GeoidModel :: Egm96 ,
51
+ swiftnav_sys:: geoid_model_t_GEOID_MODEL_EGM2008 => GeoidModel :: Egm2008 ,
52
+ _ => unimplemented ! ( "Unknown geoid model {}" , model) ,
53
+ }
48
54
}
You can’t perform that action at this time.
0 commit comments