NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
spaced_feature_tracker.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 #ifndef VISION_COMMON_SPACED_FEATURE_TRACKER_H_
20 #define VISION_COMMON_SPACED_FEATURE_TRACKER_H_
21 
27 
28 #include <set>
29 #include <vector>
30 
31 namespace vision_common {
32 class SpacedFeatureTracker : public FeatureTracker<SpacedFeatureTrack> {
34 
35  public:
36  explicit SpacedFeatureTracker(const SpacedFeatureTrackerParams& params);
37 
38  // Default constructor only for serialization
39  SpacedFeatureTracker() = default;
40 
41  // Updates FeatureTracker and updates allowed timestamps.
42  void Update(const FeaturePoints& feature_points) final;
43 
44  // Removes old points from FeatureTracker and allowed timestamps.
45  void RemoveOldPoints(const localization_common::Time oldest_allowed_time) final;
46 
47  // Clears FeatureTracker and allowed timestamps.
48  void Clear() final;
49 
50  // Returns feature tracks spaced using allowed timestamps.
51  // Skips feature tracks with no allowed timestamps.
52  std::vector<FeaturePoints> SpacedFeatureTracks() const;
53 
54  private:
55  // Serialization function
57  template <class ARCHIVE>
58  void serialize(ARCHIVE& ar, const unsigned int /*version*/) {
59  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
60  ar& BOOST_SERIALIZATION_NVP(allowed_timestamps_);
61  ar& BOOST_SERIALIZATION_NVP(params_);
62  }
63 
64  int measurement_count_;
65  std::set<localization_common::Time> allowed_timestamps_;
67 };
68 } // namespace vision_common
69 
70 #endif // VISION_COMMON_SPACED_FEATURE_TRACKER_H_
vision_common::SpacedFeatureTracker::access
friend class boost::serialization::access
Definition: spaced_feature_tracker.h:56
vision_common
Definition: brisk_feature_detector_and_matcher.h:25
vision_common::FeatureTracker
Definition: feature_tracker.h:32
vision_common::SpacedFeatureTracker
Definition: spaced_feature_tracker.h:32
spaced_feature_track.h
vision_common::SpacedFeatureTracker::Update
void Update(const FeaturePoints &feature_points) final
Definition: spaced_feature_tracker.cc:27
vision_common::SpacedFeatureTrackerParams
Definition: spaced_feature_tracker_params.h:24
vision_common::SpacedFeatureTracker::SpacedFeatureTracks
std::vector< FeaturePoints > SpacedFeatureTracks() const
Definition: spaced_feature_tracker.cc:45
timestamped_set.h
feature_tracker.h
vision_common::SpacedFeatureTracker::SpacedFeatureTracker
SpacedFeatureTracker()=default
vision_common::FeaturePoints
std::vector< FeaturePoint > FeaturePoints
Definition: feature_point.h:56
time.h
spaced_feature_tracker_params.h
vision_common::SpacedFeatureTracker::Clear
void Clear() final
Definition: spaced_feature_tracker.cc:40
vision_common::SpacedFeatureTracker::RemoveOldPoints
void RemoveOldPoints(const localization_common::Time oldest_allowed_time) final
Definition: spaced_feature_tracker.cc:34
localization_common::Time
double Time
Definition: time.h:23