| 25 | }; |
| 26 | |
| 27 | struct Landmark { |
| 28 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
| 29 | /** |
| 30 | * @brief Constructor. |
| 31 | * @param id ID of the point. E.g. landmark ID. |
| 32 | * @param point Homogeneous coordinate of the point. |
| 33 | * @param quality Quality of the point. Usually between 0 and 1. |
| 34 | */ |
| 35 | Landmark(uint64_t id, const Eigen::Vector3d& point, double quality, const Eigen::Vector3d& color) |
| 36 | : id_(id), point_(point), quality_(quality), color_(color) {} |
| 37 | Landmark() : id_(0), point_(Eigen::Vector3d::Zero()), quality_(0), color_(Eigen::Vector3d::Zero()) {} |
| 38 | |
| 39 | uint64_t id_; //< ID of the point. E.g. landmark ID. |
| 40 | Eigen::Vector3d point_; //< coordinate of the point. |
| 41 | double quality_; //< Quality of the point. Usually between 0 and 1. |
| 42 | Eigen::Vector3d color_; //< Color of the point. |
| 43 | |
| 44 | std::unordered_map<uint64_t, Observation> keyframe_observations_; // < Keyframe index, observation |
| 45 | |
| 46 | uint64_t latest_kf_obs_; |
| 47 | |
| 48 | void updateObservation(uint64_t keyframe_id, |
| 49 | const Eigen::Vector3d& position, |
| 50 | double quality, |
| 51 | const Eigen::Vector3d& color); |
| 52 | }; |
| 53 | |
| 54 | std::ostream& operator<<(std::ostream& os, const Landmark& landmark); |
| 55 | |