You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running ORB-SLAM3 in mono-inertial mode on EuroC dataset. For each frame processed, I want to get the last 20 keyframes.
What I do is that, I get the active map from Atlas and then extract the keyframes in that active map. The problem is that when I do this, I get only a few keyframes compared to the total number of keyframes shown in the visualization window. For example, usually, it is only 2 keyframes up to 9 or so.
The following is the code I use in a function that is called inside the euroc mono_inertial main
allPoses.clear();
// current pose info
vector<double> curr_pose;
curr_pose.reserve(8);
// get the active map (current map, since we are working in real time)
Map* pActiveMap = mpAtlas->GetCurrentMap();
if (pActiveMap == NULL)
{
cout << "TEST: active map is null" << endl;
}
// get all keyframes and sort them using their ID
vector<KeyFrame*> vpKFs = pActiveMap->GetAllKeyFrames();
sort(vpKFs.begin(),vpKFs.end(),KeyFrame::lId);
// Transform all keyframes so that the first keyframe is at the origin.
// After a loop closure the first keyframe might not be at the origin.
for(size_t i=0; i<vpKFs.size(); i++)
{
curr_pose.clear();
curr_pose.reserve(8);
KeyFrame* pKF = vpKFs[i];
// if keyframe is culled , go to the next one
if(!pKF || pKF->isBad())
continue;
// else, get info of the current transform of the pose
Sophus::SE3f T_base;
Eigen::Quaternionf q;
Eigen::Vector3f t;
if (mSensor == IMU_MONOCULAR || mSensor == IMU_STEREO || mSensor==IMU_RGBD)
{
T_base = pKF->GetImuPose();
}
else
{
T_base = pKF->GetPoseInverse();
}
q = T_base.unit_quaternion();
t = T_base.translation();
std::vector<double> currPose;
// push all pose transform data to vector
currPose.push_back(1e9*pKF->mTimeStamp);
currPose.push_back(t(0));
currPose.push_back(t(1));
currPose.push_back(t(2));
currPose.push_back(q.x());
currPose.push_back(q.y());
currPose.push_back(q.z());
currPose.push_back(q.w());
// submit this pose to poses repository
allPoses.push_back(currPose);
}
The text was updated successfully, but these errors were encountered:
Hello,
I am running ORB-SLAM3 in mono-inertial mode on EuroC dataset. For each frame processed, I want to get the last 20 keyframes.
What I do is that, I get the active map from Atlas and then extract the keyframes in that active map. The problem is that when I do this, I get only a few keyframes compared to the total number of keyframes shown in the visualization window. For example, usually, it is only 2 keyframes up to 9 or so.
The following is the code I use in a function that is called inside the euroc mono_inertial main
The text was updated successfully, but these errors were encountered: