28#ifndef CORELIB_INCLUDE_RTABMAP_CORE_LANDMARK_H_
29#define CORELIB_INCLUDE_RTABMAP_CORE_LANDMARK_H_
31#include <rtabmap/core/rtabmap_core_export.h>
32#include <rtabmap/core/Transform.h>
72 Landmark(
const int &
id,
const float & size,
const Transform & pose,
const cv::Mat & covariance) :
76 covariance_(covariance)
80 UASSERT(covariance_.cols == 6 && covariance_.rows == 6 && covariance_.type() == CV_64FC1);
81 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(0,0)) && covariance_.at<
double>(0,0)>0,
uFormat(
"Linear covariance should not be null! Value=%f.", covariance_.at<
double>(0,0)).c_str());
82 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(1,1)) && covariance_.at<
double>(1,1)>0,
uFormat(
"Linear covariance should not be null! Value=%f.", covariance_.at<
double>(1,1)).c_str());
83 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(2,2)) && covariance_.at<
double>(2,2)>0,
uFormat(
"Linear covariance should not be null! Value=%f.", covariance_.at<
double>(2,2)).c_str());
84 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(3,3)) && covariance_.at<
double>(3,3)>0,
uFormat(
"Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<
double>(3,3)).c_str());
85 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(4,4)) && covariance_.at<
double>(4,4)>0,
uFormat(
"Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<
double>(4,4)).c_str());
86 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(5,5)) && covariance_.at<
double>(5,5)>0,
uFormat(
"Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<
double>(5,5)).c_str());
92 RTABMAP_DEPRECATED
Landmark(
const int &
id,
const Transform & pose,
const cv::Mat & covariance);
97 const int &
id()
const {
return id_;}
99 const float &
size()
const {
return size_;}
119 covariance_(covariance)
123 UASSERT(covariance_.cols == 6 && covariance_.rows == 6 && covariance_.type() == CV_64FC1);
124 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(0,0)) && covariance_.at<
double>(0,0)>0,
uFormat(
"Linear covariance should not be null! Value=%f.", covariance_.at<
double>(0,0)).c_str());
125 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(1,1)) && covariance_.at<
double>(1,1)>0,
uFormat(
"Linear covariance should not be null! Value=%f.", covariance_.at<
double>(1,1)).c_str());
126 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(2,2)) && covariance_.at<
double>(2,2)>0,
uFormat(
"Linear covariance should not be null! Value=%f.", covariance_.at<
double>(2,2)).c_str());
127 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(3,3)) && covariance_.at<
double>(3,3)>0,
uFormat(
"Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<
double>(3,3)).c_str());
128 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(4,4)) && covariance_.at<
double>(4,4)>0,
uFormat(
"Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<
double>(4,4)).c_str());
129 UASSERT_MSG(
uIsFinite(covariance_.at<
double>(5,5)) && covariance_.at<
double>(5,5)>0,
uFormat(
"Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<
double>(5,5)).c_str());
Some conversion functions.
std::string UTILITE_EXPORT uFormat(const char *fmt,...)
ULogger class and convenient macros.
#define UASSERT(condition)
Basic mathematics functions.
bool uIsFinite(const T &value)
Optimized pose of a visual landmark (e.g. ArUco/AprilTag) in the map.
const cv::Mat & covariance() const
Landmark(const int &id, const float &size, const Transform &pose, const cv::Mat &covariance)
Constructs a landmark with size, pose, and covariance.
Landmark()
Default-constructs an invalid landmark (id == 0).
const Transform & pose() const
const float & size() const
std::map< int, Landmark > Landmarks
Map of landmark id → Landmark (typically positive keys).