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 kPosePrior,
00050 kUndef = 99};
00051 Link();
00052 Link(int from,
00053 int to,
00054 Type type,
00055 const Transform & transform,
00056 const cv::Mat & infMatrix = cv::Mat::eye(6,6,CV_64FC1),
00057 const cv::Mat & userData = cv::Mat());
00058
00059 bool isValid() const {return from_ > 0 && to_ > 0 && !transform_.isNull() && type_!=kUndef;}
00060
00061 int from() const {return from_;}
00062 int to() const {return to_;}
00063 const Transform & transform() const {return transform_;}
00064 Type type() const {return type_;}
00065 const cv::Mat & infMatrix() const {return infMatrix_;}
00066 double rotVariance() const;
00067 double transVariance() const;
00068
00069 void setFrom(int from) {from_ = from;}
00070 void setTo(int to) {to_ = to;}
00071 void setTransform(const Transform & transform) {transform_ = transform;}
00072 void setType(Type type) {type_ = type;}
00073
00074 const cv::Mat & userDataRaw() const {return _userDataRaw;}
00075 const cv::Mat & userDataCompressed() const {return _userDataCompressed;}
00076 void uncompressUserData();
00077 cv::Mat uncompressUserDataConst() const;
00078
00079 Link merge(const Link & link, Type outputType) const;
00080 Link inverse() const;
00081
00082 private:
00083 void setInfMatrix(const cv::Mat & infMatrix);
00084
00085 private:
00086 int from_;
00087 int to_;
00088 Transform transform_;
00089 Type type_;
00090 cv::Mat infMatrix_;
00091
00092
00093 cv::Mat _userDataCompressed;
00094 cv::Mat _userDataRaw;
00095 };
00096
00097 }
00098
00099
00100 #endif