Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef LINK_H_
00029 #define LINK_H_
00030
00031 #include "rtabmap/core/RtabmapExp.h"
00032
00033 #include <rtabmap/core/Transform.h>
00034 #include <opencv2/core/core.hpp>
00035
00036 namespace rtabmap {
00037
00038 class RTABMAP_EXP Link
00039 {
00040 public:
00041 enum Type {
00042 kNeighbor,
00043 kGlobalClosure,
00044 kLocalSpaceClosure,
00045 kLocalTimeClosure,
00046 kUserClosure,
00047 kVirtualClosure,
00048 kNeighborMerged,
00049 kUndef};
00050 Link();
00051 Link(int from,
00052 int to,
00053 Type type,
00054 const Transform & transform,
00055 const cv::Mat & infMatrix = cv::Mat::eye(6,6,CV_64FC1),
00056 const cv::Mat & userData = cv::Mat());
00057 Link(int from,
00058 int to,
00059 Type type,
00060 const Transform & transform,
00061 double rotVariance,
00062 double transVariance,
00063 const cv::Mat & userData = cv::Mat());
00064
00065 bool isValid() const {return from_ > 0 && to_ > 0 && !transform_.isNull() && type_!=kUndef;}
00066
00067 int from() const {return from_;}
00068 int to() const {return to_;}
00069 const Transform & transform() const {return transform_;}
00070 Type type() const {return type_;}
00071 const cv::Mat & infMatrix() const {return infMatrix_;}
00072 double rotVariance() const;
00073 double transVariance() const;
00074
00075 void setFrom(int from) {from_ = from;}
00076 void setTo(int to) {to_ = to;}
00077 void setTransform(const Transform & transform) {transform_ = transform;}
00078 void setType(Type type) {type_ = type;}
00079 void setInfMatrix(const cv::Mat & infMatrix);
00080 void setVariance(double rotVariance, double transVariance);
00081
00082 void setUserDataRaw(const cv::Mat & userDataRaw);
00083 void setUserData(const cv::Mat & userData);
00084 const cv::Mat & userDataRaw() const {return _userDataRaw;}
00085 const cv::Mat & userDataCompressed() const {return _userDataCompressed;}
00086 void uncompressUserData();
00087 cv::Mat uncompressUserDataConst() const;
00088
00089 Link merge(const Link & link, Type outputType) const;
00090 Link inverse() const;
00091
00092 private:
00093 int from_;
00094 int to_;
00095 Transform transform_;
00096 Type type_;
00097 cv::Mat infMatrix_;
00098
00099
00100 cv::Mat _userDataCompressed;
00101 cv::Mat _userDataRaw;
00102 };
00103
00104 }
00105
00106
00107 #endif