MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / getKeyframesDump

Method getKeyframesDump

pose_graph/src/pose_graph/LoopClosure.cpp:377–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377void LoopClosure::getKeyframesDump(std::vector<KeyframeDump>& out) const {
378 out.clear();
379 out.reserve(kfMapper_.size());
380 for (const auto& kv : kfMapper_) {
381 const Keyframe* kf = kv.second;
382 if (!kf) continue;
383 Eigen::Vector3d T;
384 Eigen::Matrix3d R;
385 const_cast<Keyframe*>(kf)->getPose(T, R); // getPose is non-const; safe as it doesn't mutate state here
386 Eigen::Quaterniond q(R);
387 KeyframeDump dump;
388 dump.id = kf->index;
389 dump.stamp = kf->time_stamp;
390 dump.qx = q.x(); dump.qy = q.y(); dump.qz = q.z(); dump.qw = q.w();
391 dump.tx = T.x(); dump.ty = T.y(); dump.tz = T.z();
392 out.push_back(dump);
393 }
394}

Callers 1

mainFunction · 0.80

Calls 3

getPoseMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected