Program Listing for File landmark-quality-metrics.h

Return to documentation for file (map-structure/vi-map/include/vi-map/landmark-quality-metrics.h)

#ifndef VI_MAP_LANDMARK_QUALITY_METRICS_H_
#define VI_MAP_LANDMARK_QUALITY_METRICS_H_

#include <vector>

#include <Eigen/Core>
#include <aslam/common/memory.h>

namespace vi_map {
class VIMap;
class Landmark;
}

namespace vi_map {

struct LandmarkWellConstrainedSettings {
  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
  double max_distance_to_closest_observer;
  double min_distance_to_closest_observer;
  double min_observation_angle_deg;
  size_t min_observers;

  LandmarkWellConstrainedSettings();
};

// These methods use the number of observers, the incident rays from the
// observers as well as the distance to the camera to determine the landmark
// quality.
bool isLandmarkWellConstrained(
    const vi_map::VIMap& map, const vi_map::Landmark& landmark);

inline bool isLandmarkWellConstrained(
    const Aligned<std::vector, Eigen::Vector3d>& G_normalized_incidence_rays,
    double signed_distance_to_closest_observer,
    const LandmarkWellConstrainedSettings& settings);

// Re-evaluates the quality even if the landmark quality is known if the
// parameter re_evaluate_quality is set to true.
bool isLandmarkWellConstrained(
    const vi_map::VIMap& map, const vi_map::Landmark& landmark,
    bool re_evaluate_quality);

}  // namespace vi_map
#include "./landmark-quality-metrics-inl.h"
#endif  // VI_MAP_LANDMARK_QUALITY_METRICS_H_