From 1c543489862cd0bf9c559cee6575baf20f84b2d0 Mon Sep 17 00:00:00 2001 From: Martin Miller Date: Tue, 11 Apr 2017 10:57:04 -0500 Subject: Remove features after 5 timesteps without measurements --- src/feature.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/feature.cpp') diff --git a/src/feature.cpp b/src/feature.cpp index fbb1376..84575d1 100644 --- a/src/feature.cpp +++ b/src/feature.cpp @@ -36,6 +36,7 @@ Feature::Feature ( int id, const Vector3d &xs, const Vector3d &xr, xb0w = xbw; q0 = q; _patch = p; + lastseen = 0; } /* ----- end of method Feature::Feature (constructor) ----- */ /* @@ -61,6 +62,7 @@ Feature::Feature ( int id, const Vector3d &xs, const Vector3d &xbw, xb0w = xbw; q0 = q; _patch = p; + lastseen = 0; } @@ -1023,6 +1025,7 @@ Feature::sane ( ) void Feature::dx ( const Vector3d &del ) { + lastseen += 1; X += del; return ; } /* ----- end of method Feature::dx ----- */ @@ -1131,3 +1134,16 @@ Feature::reflectedPatch( const Camera &cam, const Quaterniond &q1 ) return cam.reflectPatch(_patch, q0, q1); } +void +Feature::seen ( ) +{ + lastseen = 0; + return ; +} /* ----- end of method Feature::seen ----- */ + +bool +Feature::since ( int N ) const +{ + return (lastseen