@@ -46,6 +46,8 @@ void FlybyPoint::UpdateState(uint64_t currentSimNanos)
46
46
/* ! If this is the first read, seed the algorithm with the solution */
47
47
auto [r_BN_N, v_BN_N] = this ->readRelativeState ();
48
48
if (this ->firstRead ){
49
+ this ->previousFilterPosition = r_BN_N;
50
+ this ->previousFilterVelocity = v_BN_N;
49
51
this ->computeFlybyParameters (r_BN_N, v_BN_N);
50
52
this ->computeRN (r_BN_N, v_BN_N);
51
53
this ->firstRead = false ;
@@ -58,6 +60,8 @@ void FlybyPoint::UpdateState(uint64_t currentSimNanos)
58
60
59
61
/* ! update lastFilterReadTime to current time and dt to zero */
60
62
this ->lastFilterReadTime = currentSimNanos;
63
+ this ->previousFilterPosition = r_BN_N;
64
+ this ->previousFilterVelocity = v_BN_N;
61
65
this ->dt = 0 ;
62
66
}
63
67
}
@@ -110,6 +114,14 @@ bool FlybyPoint::checkValidity(Eigen::Vector3d &r_BN_N, Eigen::Vector3d &v_BN_N)
110
114
if (maxPredictedAcceleration > this ->maxAcceleration && this ->maxAcceleration > 0 ) {
111
115
valid = false ;
112
116
}
117
+ double deltaPositionNorm = (r_BN_N - (this ->previousFilterPosition + this ->dt *this ->previousFilterVelocity )).norm ();
118
+ double deltaVelocityNorm = (v_BN_N - this ->previousFilterVelocity ).norm ();
119
+ if (deltaPositionNorm > this ->positionKnowledgeSigma && this ->positionKnowledgeSigma > 0 ) {
120
+ valid = false ;
121
+ }
122
+ if (deltaVelocityNorm > this ->velocityKnowledgeSigma && this ->velocityKnowledgeSigma > 0 ) {
123
+ valid = false ;
124
+ }
113
125
114
126
return valid;
115
127
}
@@ -232,3 +244,31 @@ double FlybyPoint::getMaximumRateThreshold() const {
232
244
void FlybyPoint::setMaximumRateThreshold (double maxRateThreshold) {
233
245
this ->maxRate = maxRateThreshold;
234
246
}
247
+
248
+ /* ! Get the ground based positional knowledge standard deviation
249
+ @return sigma
250
+ */
251
+ double FlybyPoint::getPositionKnowledgeSigma () const {
252
+ return this ->positionKnowledgeSigma ;
253
+ }
254
+
255
+ /* ! Set the ground based positional knowledge sigma
256
+ @param sigma
257
+ */
258
+ void FlybyPoint::setPositionKnowledgeSigma (double positionKnowledgeStd) {
259
+ this ->positionKnowledgeSigma = positionKnowledgeStd;
260
+ }
261
+
262
+ /* ! Get the ground based velocity knowledge standard deviation
263
+ @return sigma
264
+ */
265
+ double FlybyPoint::getVelocityKnowledgeSigma () const {
266
+ return this ->velocityKnowledgeSigma ;
267
+ }
268
+
269
+ /* ! Set the ground based velocity knowledge sigma
270
+ @param sigma
271
+ */
272
+ void FlybyPoint::setVelocityKnowledgeSigma (double velocityKnowledgeStd) {
273
+ this ->velocityKnowledgeSigma = velocityKnowledgeStd;
274
+ }
0 commit comments