Question about Nyx::Orbit.ecc() #258
-
Hello Chris, in my position solver, I need the user to provide several attitude parameters (more generally: orbit parameters) for each Spacecraft in orbit. Currently, this is wrapped as a gnss_rtk::prelude::InterpolationResult, which is quite simple and easy to use. But I'm thinking of converting this to a I'm working on a new bias compensation which requires providing the "Eccentricity of the osculating orbit", E in this equation : Could you explain me whether that is what |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi Guillaume, Yes, the For an end-to-end example, I'd recommend looking at the "cosmic" integration test here. Essentially, you need to load the planetary information (using Ignoring the imports, your code will look like something like this: let cosm = Cosm::de438();
let eme2000 = cosm.frame("EME2000");
let epoch = Epoch::from_gps_nanoseconds(gps_ns);
// Assuming that the interpolation result is in km and km/s.
let position_vec_km = my_interp_result.position;
let velocity_km_s = my_interp_result.velocity.unwrap(); // Assume it is set
let orbit = Orbit::cartesian(position_vec_km[0], position_vec_km[1], position_vec_km[2], velocity_km_s[0], velocity_km_s[1], velocity_km_s[2], epoch, eme2000);
println!("{}", orbit.ecc()); Note that as part of #86 , the whole "Cosm" will be removed in favor of the much more precise ANISE backend. This will only start taking affect with version 2.0.0-beta.1, hopefully ready before 01 Jan 2024. I hope this helps. |
Beta Was this translation helpful? Give feedback.
-
Oh it surely did, thank you for getting back. I was also inaccurate in my statement: both the eccentricity and the anomaly are required in the equation i'm interested in, and your API can provide both. This is fun - seriously. In this simple topic, I managed to fall into all the traps you can think of 🤣 🤣 I was getting zeros all the time initially, and by re-reading your post, realized the velocity is mandatory for this to work out. Then, after starting using it, rapidly saw that it did more harm than good to my PVT solutions. Resolve without taking relativistic effect into account : (basically, where I was when I asked this question) rinex-cli -p --lsqspp -P GPS \
-c config.json \
-f test_resources/CRNX/V3/ESBC00DNK_R_20201770000_01D_30S_MO.crx.gz \
-f test_resources/NAV/V3/ESBC00DNK_R_20201770000_01D_MN.rnx.gz \
-f test_resources/SP3/GRG0MGXFIN_20201770000_01D_15M_ORB.SP3.gz
cat config.json {
"timescale": "GPST",
"interp_order": 11,
"max_sv": 10,
"min_sv_elev": 20.0,
"min_snr": 20.0,
"modeling": {
"sv_clock_bias": true,
"sv_total_group_delay": true,
"tropo_delay": true,
"iono_delay": true,
"earth_rotation": true,
"relativistic_clock_bias": false
}
} Compensate for relativistic clock bias with {
"timescale": "GPST",
"interp_order": 11,
"max_sv": 10,
"min_sv_elev": 20.0,
"min_snr": 20.0,
"modeling": {
"sv_clock_bias": true,
"sv_total_group_delay": true,
"tropo_delay": true,
"iono_delay": true,
"earth_rotation": true,
"relativistic_clock_bias": true
}
} Side note: check out how Earth's rotation during the signal time travel, ends up as a static bias that simply offset the solutions to the East {
"timescale": "GPST",
"interp_order": 11,
"max_sv": 10,
"min_sv_elev": 20.0,
"min_snr": 20.0,
"modeling": {
"sv_clock_bias": true,
"sv_total_group_delay": true,
"tropo_delay": true,
"iono_delay": true,
"earth_rotation": false,
"relativistic_clock_bias": true
}
}
Yeah, that I understand since you helped me out in early September.
Then I need to keep up to date and will need to understand what migrating will require |
Beta Was this translation helpful? Give feedback.
Hi Guillaume,
Yes, the
ecc
function returns the eccentricity of the osculating orbit, specifically, the norm of the eccentricity vector calculated with this formula.For an end-to-end example, I'd recommend looking at the "cosmic" integration test here. Essentially, you need to load the planetary information (using
Cosm::de438s()
for example), retrieve the relevant frame (in your case, it's the Earth Mean Equator J2000, or EME2000, also called Earth J2000 -- it's the Earth centered inertial frame), define the epoch, and then build an orbit structure.Ignoring the imports, your code will look like something like this: