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

Building on Raspberry PI #108

Open
e-maalouly opened this issue May 4, 2016 · 11 comments
Open

Building on Raspberry PI #108

e-maalouly opened this issue May 4, 2016 · 11 comments

Comments

@e-maalouly
Copy link

Is it possible for ORB Slam to work on raspberry pi? I have been trying to build it on a rpi 3 with raspbian jessie and ROS Indigo. I get the following error when trying to build g2o using make:

Scanning dependencies of target g2o
[ 3%] Building CXX object CMakeFiles/g2o.dir/g2o/types/types_sba.cpp.o
*** Error in `/usr/bin/c++': double free or corruption (top): 0x00c7a348 ***
CMakeFiles/g2o.dir/build.make:54: recipe for target 'CMakeFiles/g2o.dir/g2o/types/types_sba.cpp.o' failed
make[2]: *** [CMakeFiles/g2o.dir/g2o/types/types_sba.cpp.o] Aborted
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/g2o.dir/all' failed
make[1]: *** [CMakeFiles/g2o.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

Does anyone know how to solve this? Any help would be appreciated. Regards.

@riematrix
Copy link

@Clapton-Is-God Hi, the key message is "double free or corruption". I used to compile the project on Pi3 after adding an option in CMakelists.txt but i can't remember it now. However i couldn't run the program on my raspberry pi. It keeps showing thread error or bus error that I almost give up.

@ffntl
Copy link

ffntl commented Jun 30, 2016

I found the solution to run ORB_SLAM2 on the RPi2 but it is still 3x slower than the normal performance:

For the compilation:

  • Enable SWAP in the dphys-swapfile to 1536MB (enough for me on the RPi2)
  • Add -j2 after all make instructions in the build.sh (that's the trick!)
  • Use certain flags on your CMakeLists.txt : -Wall -mfpu=neon -O3 -pthread -std=c++11and enable neon with add_definitions("-DENABLE_NEON"). Don't use the -march=armv7-a flag, you may get a virtual function error (thread).
    If you try to compile the ROS version you might get an issue with Opencv, it is because you have two versions of opencv installed on your RPi, you might have to change some opencv headers on the code. I found that the version without ROS works better on the RPi.

It takes around 2min40 to load the ORB Vocabulary.

@riematrix
Copy link

Thank you so much for sharing this! @Fannief

BTW, the lode process could be much faster if you merge this binary vocabulary version. On my Pi3 it takes about 10 seconds.

@hyqneuron
Copy link

@Fannief May I ask what kind of framerate are you getting and what settings are you using? I used the default compilation flags and tried the default setting (TUM1.yaml) and seemed to be getting 2~3fps on RPi2 with a webcam.

@hyqneuron
Copy link

@riematrix How's the performance on RPi3?

@ffntl
Copy link

ffntl commented Nov 4, 2016

The settings depend on the dataset you are using, I tried to decrease at maximum the number of ORB features and the number of pyramid scales (most time consuming). I did also some modifications inside the code to get a framerate around 3-4fps for the KITTI dataset (07) and ~3fps for real time dataset with stereo camera, VGA images, 20fps. You can also try to add NEON instructions to speed up a bit more (I didn't try, but why not).
I couldn't record images and run ORB SLAM at the same time on the RPi, I had to use WiFi/Ethernet to get the frames in real time. RPi2 is very limited :/ I didn't try with RPi3

@hyqneuron
Copy link

@Fannief 20fps with VGA images?! May I know what exact settings are you using (number of points, scale and number of levels)? I'm using a VGA webcam and I'm only getting about 3fps on RPi3, with nFeatures=500, scaleFactor=1.5 and nLevels=3.

@ffntl
Copy link

ffntl commented Nov 5, 2016

20fps is just the input, my stereo camera frame rate. ~3fps is the output. It will be hard to do better than 4fps.

@diophantine86
Copy link

i build orbslam2 on raspberry pi3. but this occurs eigen dense storage error.

@zanazakaryaie
Copy link

Hello

Thanks for sharing

I have installed it on Rpi2 successuflly but when I run kitti example it first loads vocabulary and then throws an error:

Pangolin X11: Unable to retrieve framebuffer options

What should I do?

@ffntl
Copy link

ffntl commented Sep 30, 2017

raulmur/ORB_SLAM2#4
@'sunstarchan commented on Feb 1, 2016'

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

6 participants