Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result is slower than original ORBSLAM2 #5

Open
antithing opened this issue May 28, 2017 · 5 comments
Open

result is slower than original ORBSLAM2 #5

antithing opened this issue May 28, 2017 · 5 comments

Comments

@antithing
Copy link

antithing commented May 28, 2017

Hi again, I have your code building, and running on windows, with cuda 8 on a GTX 970 card. I am running it on a stereo dataset that gives a frame time of 45ms with original ORBSLAM2 (cpu). using your code, the frame time is 78ms. Also, it resets a few times when launched, before it can initialize.

What can I look at to debug this, and get it running faster?

thanks again for making the code available!

@silverneko
Copy link
Collaborator

Hi again, I have your code building, and running on windows, with cuda 8 on a GTX 970 card. I am running it on a stereo dataset that gives a frame time of 45ms with original ORBSLAM2 (cpu). using your code, the frame time is 78ms.

What about monocular, is it also slower on a monocular dataset ?

Also, it resets a few times when launched, before it can initialize.

I don't get it. What do you mean by "resets a few times" ?

What can I look at to debug this, and get it running faster?

Not sure. I haven't done a thorough test on the stereo tracker. I suggest you start by trying to validate the correctness of result first (the "resets a few times" thing sounds fishy). Perhaps its something about thread-safety, so change this concurrent call to a sequential call may (or may not) help.
Or if you're familiar with nvvp, try to record a execution timeline to see it something's wrong.

@antithing
Copy link
Author

antithing commented May 31, 2017

Hi, thank you again for your time on this. I have switched to Monocular to get everything working, and after I found a typo i made when converting from linux to windows, it runs well, around 30% faster than the original. :)

Now i am back to looking at stereo...

I have tried your suggestion, changing the thread functions to:

thread threadLeft(&Frame::ExtractORB,this,0,imLeft, imRight);

void Frame::ExtractORB(int flag, const cv::Mat &imL, const cv::Mat &imR)
{
   
        (*mpORBextractorLeft)(imL,cv::Mat(),mvKeys,mDescriptors);
   
        (*mpORBextractorRight)(imR,cv::Mat(),mvKeysRight,mDescriptorsRight);
}

The result is the same, sadly. It compiles and runs smoothly, with no resetting, but is only about half as fast as cpu orbslam. Sorry to bug you, but is there anything else you can suggest to get stereo running as well as mono? thank you again.

@antithing
Copy link
Author

Ah, after more thorough testing, it is not actually slower, it is the almost exactly same as cpu-orbslam, as if the gpu acceleration is not running on the stereo tracking. The original code and your improvements are within 3ms in average frame time, over a 2000 frame dataset. Do I need to enable the gpu for stereo? (monocular is running 30% faster than cpu-orbslam) Thank you for your time!

@zmzmdr
Copy link

zmzmdr commented Nov 7, 2017

@antithing Hi, I also run gpu-slam-stereo-tracking on windows, with cuda 9 on a GTX 960 card, and meaning tracking time per frame was nearly 50ms. As u say , it is the almost exactly same as cpu-orbslam.
I want to know whether u make it(gpu-slam-stereo-tracking ) faster recently?
Thank u.

@SquirminatorHotHead
Copy link

I have experienced the similar issues. I believe it must be something wrong with the OpenCV built with your Jetpack has the conflict with the ROS version. Try to build OpenCV by yourself.https://github.com/jetsonhacks/buildOpenCVTX2 Here is the useful link.

Another way is to change the Cmakefile:

find_package(OpenCV REQUIRED
NO_MODULE
PATHS /usr/local
NO_DEFAULT_PATH)
this will avoid that Cmake to search for OpenCV in the ROS directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants