beewe / orb_slam2_windows Goto Github PK
View Code? Open in Web Editor NEWThis project forked from raulmur/orb_slam2
Windows Version of ORB_SLAM2, see website.
Home Page: https://github.com/raulmur/ORB_SLAM2
License: Other
This project forked from raulmur/orb_slam2
Windows Version of ORB_SLAM2, see website.
Home Page: https://github.com/raulmur/ORB_SLAM2
License: Other
As the description mentioned that it was tested under Windows 7, Visual Studio 2013 (MSVC 12), OpenCV3. I am wondering do you have detail guide to build it for Visual Studio.
Thank you very much for your help.
Hello,
I am trying to run the ORB_SLAM2 using visual studio but it takes a lot of time for initilaization and loading of new frames. So I tried commenting out the sleep call of the main thread as follows.
double T=0;
if (ni<nImages - 1)
{
T = vTimestamps[ni + 1] - tframe;
}
else if (ni>0)
{
T = tframe - vTimestamps[ni - 1];
}
if (ttrack < T)
{
//std::this_thread::sleep_for(std::chrono::milliseconds((int)((T - ttrack)*1e6)));
}
Now the speed has improved significantly but not real time.
Also I did not understand why the above piece of code is used.
Can someone explain this?
Hi! I have this code running great, but the rotation I am exporting seems strange. I get the camerapose from TrackStereo, then invert it with the code from:
void MapDrawer::GetCurrentOpenGLCameraMatrix(pangolin::OpenGlMatrix &M)
{
if(!mCameraPose.empty())
{
cv::Mat Rwc(3,3,CV_32F);
cv::Mat twc(3,1,CV_32F);
{
unique_lock<mutex> lock(mMutexCamera);
Rwc = mCameraPose.rowRange(0,3).colRange(0,3).t();
twc = -Rwc*mCameraPose.rowRange(0,3).col(3);
}
Then send the Rwc Matrix to the converter:
std::vector<float> Converter::toQuaternion(const cv::Mat &M)
{
Eigen::Matrix<double,3,3> eigMat = toMatrix3d(M);
Eigen::Quaterniond q(eigMat);
std::vector<float> v(4);
v[0] = q.x();
v[1] = q.y();
v[2] = q.z();
v[3] = q.w();
return v;
}
What I see is this: (compared with inertial data)
The middle section, where the data is incorrect, is when I rotate in Yaw 180 degrees. Am I going wrong with my conversions somewhere?
Thanks yet again! :)
Hello,Thanks for sharing orb_slam2_windows. I met different errors while running rgbd-tum under Windows 7 ,VS2013.
when I choose release running, It said"A buffer overrun has occurred in rgbd_tum.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program."
when I choose debug, It failed with "Opengl error ".
Did you erver meet this kind of error?Any suggestions?
Hi ,
I am trying run it on windows and in doing so I have successfully compiled dbow , pangolin . However I am not able to build g2o on windows . It requires LAPACK and BLAS for it, which some strage reason I am not able to build.
Is there is any workaround it? I checked original g2o libraries CMAKELIST file its seems like they are putting it as a optional thing for windows.
CMakeLists.txt From original G2o
I tried to do the same with our CMAKE file.By this I am able to generate and compile g2o successfully.
CMakeLists.txt Modified
But it seems like something is going wrong after compilation I am getting following error while running mono kitti . I suspect it is because of faulty Dll compilation of g2o .
If you have, can you please provide .lib and .dll for g2o for x64 and x86? Any tip for g2o compilation with LAPACK and BLAS would also help.
Thanks in Advance
I have come across various compilation issues and solved them, so I'll put the process here for everyone else. I may not have the same problems as other people, but hopefully this is helpful!
Operating System: Windows 10, 64 bit
Compiler: Visual Studio 2015
Half of the changes are to support more recent libraries such as OpenCV3 and Eigen3. I think these are all the changes I made:
(1) g2o can't find BLAS and LAPACK. The original ORB_SLAM2 g2o CMakeLists.txt file has removed the following two lines, and it seems to work:
- FIND_PACKAGE(BLAS REQUIRED)
- FIND_PACKAGE(LAPACK REQUIRED)
I also removed the g2o cmake_modules
folder, since it apparently isn't needed either. I think it works because BLAS and LAPACK are in Eigen3?
(2) Every time there was an OpenCV dependency, I changed the following lines to support OpenCV3. This is only necessary if you use 3:
- find_package(OpenCV 2.4.3 REQUIRED)
+ find_package(OpenCV 3.0 QUIET)
+ if(NOT OpenCV_FOUND)
+ find_package(OpenCV 2.4.3 REQUIRED)
+ endif()
(3) I also had to change line 56 of linear_solver_eigen.h to support eigen3.3 (g2o will compile without this change, ORB_SLAM2 may not):
- typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;
+ typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic> PermutationMatrix;
(4) When configuring ORB_SLAM2 itself, I had another issue in PangolinConfig.cmake, so I've fixed by removing:
- add_library(_libjpeg STATIC IMPORTED)
- set_target_properties(_libjpeg PROPERTIES
- IMPORTED_LOCATION C:/Program Files/Pangolin/build/external/libjpeg/lib/jpeg.lib
- )
Important: I also put quotes around all of directories in that file.
(5) If the linker can't find anything such as "_libjpeg", go into Project -> Properties -> Linker -> Input
, and into Additional Dependencies
. Double check all the values in there. As for _libjpeg.lib, I replaced it with C:/Program Files/Pangolin/build/external/libjpeg/lib/jpeg.lib
(or the relevant location).
(6) It also complained about a runtime library mismatch
. The two options are:
BUILD_SHARED_LIBS
is ON
and MSVC_USE_STATIC_CRT
to OFF
in CMake).Project -> Properties -> C/C++ -> Code Generation
, set Runtime Library
from Multi-threaded DLL (/MD)
to Multi-threaded (/MT)
. You may need to do this for each individual project. I didn't get this method to work, because it would involve a lot of recompiling.Also make sure that each time you compile something, the Debug
/Release
mode is consistent.
Hi again, not an issue, just a question... I am going to update my stereo camera setup to run your system live. Is 640 x 480 enough? Or would you recommend a higher resolution?
Global shutter, 120 fps...
Thanks again for your code!
Hi Beewe,
I am running your windows version in vs 2015, it gets compiled ok, but when I run the program in monocular mode( either mono_kitti or mono_tum), it always hangs forever when returning from calling
mCurrentFrame = Frame(mImGray,timestamp,mpIniORBextractor,mpORBVocabulary,mK,mDistCoef,mbf,mThDepth). I stepped into frame function, it successfully returned to where it was called, then when I stepped into the next line of code, the program just hang there forever. The debugger doesn't say anything wrong.
Have you ever had this problem? Do you have any idea why this happens? Thanks!
Hello,
I would like to use ORB_SLAM in windows and I came up to your repository. I was able to compile DBoW2 but unfortunatelly I was not able to compile compile g2o. Is is possible to give some more instructions on how to compile ORB_SLAM on windows?
Thank you in advance,
Vasilis
Hi @Beewe ,
I am using orbslam2 to get the odometry in metres. It gives good results. But, after a few rotations especially in new areas, there are huge chance that the internal scale changes drastically. So, I have to calculate the scale again.
But I want to know if there is some parameter in the software which is affected by the change in internal scale and can be used to convey the information.
Thanks a lot
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.