37 : mnMaxKFid(0), mnBigChangeIdx(0)
137 WAI::V3 a = mpv[0]->worldPosVec();
143 a.
x = fmax(v.
x, a.
x);
144 a.
y = fmax(v.
y, a.
y);
145 a.
z = fmax(v.
z, a.
z);
147 b.
x = fmin(v.
x, b.
x);
148 b.
y = fmin(v.
y, b.
y);
149 b.
z = fmin(v.
z, b.
z);
154 return sqrt(a.
x * a.
x + a.
y * a.
y + a.
z * a.
z);
198 sx = sqrt(s2.at<
float>(0, 0));
199 sy = sqrt(s2.at<
float>(1, 1));
200 sz = sqrt(s2.at<
float>(2, 2));
203 t.rowRange(0, 3).col(0) *= 1.0f / sx;
204 t.rowRange(0, 3).col(1) *= 1.0f / sy;
205 t.rowRange(0, 3).col(2) *= 1.0f / sz;
213 Tcw.at<
float>(0, 3) *= sx;
214 Tcw.at<
float>(1, 3) *= sy;
215 Tcw.at<
float>(2, 3) *= sz;
219 kf->SetPose(Twc.inv());
226 cv::Mat p = (cv::Mat_<float>(4, 1) << 0, 0, 0, 1.0f);
227 cv::Mat wp = pt->GetWorldPos();
228 wp.copyTo(p.rowRange(0, 3));
230 p.rowRange(0, 3).copyTo(wp);
237 mp->UpdateNormalAndDepth();
238 mp->ComputeDistinctiveDescriptors();
248 cout <<
"rot: " << rot << endl;
255 Twc = kf->GetPose().inv();
258 kf->SetPose(Twc.inv());
263 Mat rot33 = rot.rowRange(0, 3).colRange(0, 3);
266 Pw = rot33 * pt->GetWorldPos();
267 pt->SetWorldPos(rot33 * pt->GetWorldPos());
275 cout <<
"trans: " << trans << endl;
282 cv::Mat Twc = kf->GetPose().inv();
283 Twc.rowRange(0, 3).col(3) += trans;
285 kf->SetPose(Twc.inv());
291 pt->SetWorldPos(trans + pt->GetWorldPos());
300 cv::Mat Tcw = kf->GetPose();
301 std::cout <<
"Tcw before: " << Tcw << std::endl;
302 Tcw.rowRange(0, 3).col(3) *= value;
303 std::cout <<
"Tcw after: " << Tcw << std::endl;
316 pt->SetWorldPos(value * pt->GetWorldPos());
323 cout <<
"apply transform with value: " << value << endl;
354 mp->UpdateNormalAndDepth();
355 mp->ComputeDistinctiveDescriptors();
363 _mapNode->updateAll(*
this);
376 Mat trans = cv::Mat::zeros(3, 1, CV_32F);
380 trans.at<
float>(0, 0) = val;
385 trans.at<
float>(1, 0) = -val;
390 trans.at<
float>(2, 0) = -val;
400 Mat rot = Mat::ones(4, 4, CV_32F);
406 rot = (Mat_<float>(4, 4) << 1, 0, 0, 0, 0, cos(valDeg), -sin(valDeg), 0, 0, sin(valDeg), cos(valDeg), 0, 0, 0, 0, 1);
411 rot = (Mat_<float>(4, 4) << cos(valDeg), 0, sin(valDeg), 0, 0, 1, 0, 0, -sin(valDeg), 0, cos(valDeg), 0, 0, 0, 0, 1);
418 rot = (Mat_<float>(4, 4) << cos(valDeg), -sin(valDeg), 0, 0, sin(valDeg), cos(valDeg), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
432 std::size_t sizeOfMapPoints = 0;
435 sizeOfMapPoints += mp->getSizeOf();
439 std::size_t sizeOfKeyFrames = 0;
442 sizeOfKeyFrames += kf->getSizeOf();
446 size +=
sizeof(*this);
447 size += sizeOfMapPoints;
448 size += sizeOfKeyFrames;
static long unsigned int nNextId
AR Keyframe database class.
void erase(WAIKeyFrame *pKF)
static long unsigned int nNextId
int _numberOfLoopClosings
long unsigned int KeyFramesInMap()
vector< WAIKeyFrame * > mvpKeyFrameOrigins
void rotate(float degVal, int type)
long unsigned int GetMaxKFid()
std::vector< WAIKeyFrame * > _deletedKeyFrames
WAIMap(WAIKeyFrameDB *kfDB)
std::vector< WAIMapPoint * > mvpReferenceMapPoints
long unsigned int mnMaxKFid
void AddKeyFrame(WAIKeyFrame *pKF)
long unsigned int MapPointsInMap()
void translate(float value, int type)
std::set< WAIMapPoint * > mspMapPoints
void applyTransformation(double value, TransformType type)
void EraseKeyFrame(WAIKeyFrame *pKF)
void SetReferenceMapPoints(const std::vector< WAIMapPoint * > &vpMPs)
cv::Mat buildRotMat(float &valDeg, int type)
void setNumLoopClosings(int n)
bool isKeyFrameInMap(WAIKeyFrame *pKF)
cv::Mat buildTransMat(float &val, int type)
void transform(cv::Mat transform)
void EraseMapPoint(WAIMapPoint *pMP)
std::vector< WAIKeyFrame * > GetAllKeyFrames()
void AddMapPoint(WAIMapPoint *pMP)
std::mutex _mutexLoopClosings
std::set< WAIKeyFrame * > mspKeyFrames
std::vector< WAIMapPoint * > GetAllMapPoints()
int GetLastBigChangeIdx()
void InformNewBigChange()
void incNumLoopClosings()
static const float DEG2RAD
V3 v3(float x, float y, float z)