Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orbit.valid is always false #856

Open
fatimayousuf opened this issue Jan 30, 2022 · 0 comments
Open

Orbit.valid is always false #856

fatimayousuf opened this issue Jan 30, 2022 · 0 comments

Comments

@fatimayousuf
Copy link
Member

fatimayousuf commented Jan 30, 2022

We have been seeing that orbit.valid is always false, even though time.valid is sometimes true. I traced the issue this morning and found that it was related to the GPS issues regarding the GPS week number.

In FSW, we set orbit.valid in line 114 of OrbitEstimator.cpp:
orbit_valid_f.set(_estimate.valid());

We define _estimate.valid() in Orbit_Estimate.hpp:
bool valid() const {
return _orbit.valid();
}

_orbit.valid() is defined in Orbit.h:
bool valid() const{
return _valid;
}

We set _valid in _check_validity() which is defined on line 135 of Orbit.h. Looking at this function, there is:
//time check
if (!(_ns_gps_time <= MAXGPSTIME_NS)) goto INVALID;
if (!(_ns_gps_time >= MINGPSTIME_NS)) goto INVALID;

We defined:
GNC_TRACKED_CONSTANT(const int64_t, MAXGPSTIME_NS, (20LL*52LL+(int64_t)gnc::constant::init_gps_week_number)*(int64_t)gnc::constant::NANOSECONDS_IN_WEEK);
GNC_TRACKED_CONSTANT(const int64_t, MINGPSTIME_NS, (-20LL*52LL+(int64_t)gnc::constant::init_gps_week_number)*(int64_t)gnc::constant::NANOSECONDS_IN_WEEK);
GNC_TRACKED_CONSTANT(unsigned short, init_gps_week_number, 2045);

Given the previous GPS week number issues we had, this could maybe explain why orbit.valid is always false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant