Comments (4)
I solved the problem by extracting timestamp information, which are used as key frames! :D
from orb_slam2.
@dk683 hi, could you please make a brief instruction on how you did this? I mean what is the format of your data(tum or ros .bag)? How to extract timestamp of the video/images?
from orb_slam2.
Hello @riematrix. My data format is .bag.
I added the following function to src.System.cc. The following function will save timestamp & pose of key-frames to .txt files.
P.S. Please don't forget to call the added function in a ros file, e.g., ROS/ORB_SLAM2/src/ros_mono.cc.
Cheers!
void System::keyFrameTimeStamp_sim3(const string ×tampFile, const string &sim3File) {
cout << endl << "Saving keyFrameTimeStamp_sim3 to " << timestampFile << " & " << sim3File << " ..." << endl;
vector<KeyFrame*> vpKFs = mpMap->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.
ofstream f1;
f1.open(timestampFile.c_str());
f1 << fixed;
ofstream f2;
f2.open(sim3File.c_str());
f2 << fixed;
// For all keyframes
for(size_t i=0; i<vpKFs.size(); i++) {
KeyFrame* pKF = vpKFs[i];
if(pKF->isBad())
continue;
// timestamp
f1 << setprecision(6) << pKF->mTimeStamp << endl;
// sim3
cv::Mat pose = pKF->GetPose();
f2 << setprecision(8) << pose.at<float>(0,0) << " " << pose.at<float>(0,1) << " " << pose.at<float>(0,2) << " " << pose.at<float>(0,3) << endl <<
pose.at<float>(1,0) << " " << pose.at<float>(1,1) << " " << pose.at<float>(1,2) << " " << pose.at<float>(1,3) << endl <<
pose.at<float>(2,0) << " " << pose.at<float>(2,1) << " " << pose.at<float>(2,2) << " " << pose.at<float>(2,3) << endl <<
pose.at<float>(3,0) << " " << pose.at<float>(3,1) << " " << pose.at<float>(3,2) << " " << pose.at<float>(3,3) << endl;
}
f1.close();
f2.close();
cout << endl << "timestamp & sim3 saved!" << endl;
}
from orb_slam2.
@dk683 Thank you! I'd like to try this out.
from orb_slam2.
Related Issues (20)
- I am getting this error while building the ORB_SLAM2 file please help.. I m running this on NVIDIA JETSON ORIN NANO
- Build failed on Ubuntu 22.04 and ros2 humble
- Stereo baseline of Da Vinci Xi surgical robot
- camera postion please ?
- Why not do `mpCurrentKeyFrame->AddMapPoint(pMP, i)` after `pMP->AddObservation(mpCurrentKeyFrame, i)` during LocalMapping::ProcessNewKeyframe ?
- KeyFrameTrajectory.txt?
- Fix cmake to work with new version of opencv please? I have 4.5.4 HOT 1
- Program does not go forward after initialization while doing rgb-d example.
- compilation issue -- ORB_SLAM2/Thirdparty/g2o/g2o/types/../core/openmp_mutex.h:30:10: fatal error: ../../config.h: No such file or HOT 2
- Running Stereo Node Error
- /usr/bin/ld: Cannot find -lEigen3::Eigen
- When using a undistored image as input image
- C++ Version and OpenCV version
- Gazebo and ORBSLAM
- Run Tracking, Local Mapping, and Loop Closure on a single thread
- makefile found - problem
- Error when using RGBD mode with depth obtained by monocular depth estimate
- Use forward declaration in header but also include corresponding header file at same time HOT 1
- fatal error: opencv2/photo/photo_c.h: 没有那个文件或目录 HOT 1
- When I run './build.sh', I made an error like ‘recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/FrameDrawer.cc.o' failed’
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orb_slam2.