-
Notifications
You must be signed in to change notification settings - Fork 798
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
ORB SLAM2 #287
Comments
Hi, You should not have to modify the cmake files. When using ORB_SLAM2, you cannot link on g2o installed in /usr/local. When doing "cmake WITH_G2O=OFF WITH_ORB_SLAM2=ON ..", g2o version in ORB_SLAM2 (which is not compatible with g2o version installed by source) will be used instead. On runtime, you should make sure to add the path of g2o library built in ORB_SLAM2 library to LD_LIBRARY_PATH so that libg2o.so can be found:
This is what I do in my .bashrc file: cheers, |
Thanks! |
…LAM2 with depth and RGB images with same size #287.
In the commit above, I added an option to RealSense driver to scale depth image to RGB size so that both images have the same size, which is required for ORB_SLAM2. The option is in Preferences->Source, then under RealSense group box: "Depth image scaled to RGB image size.". You can give a try. |
It runs for several seconds and then segmentation fault. Thread 21 "rtabmap" received signal SIGSEGV, Segmentation fault. |
You can do "bt" in gdb to get a backtrace. However, the error seems coming from ORB_SLAM2 library. I don't have this error on my system though, I can run it for minutes without crashing. Can you show how did you build ORB_SLAM2 and rtabmap (cmake command lines and cmake status)? Are you using PCL 1.8 as it may be an Eigen problem (PCL 1.8 is built with cheers, |
(gdb) bt RTABMAP
-- The imported target "vtk" references the file
-- Found libusb-1.0: /usr/include -- Info : -- Configuring done For ORBSLAM2 I applied this changes from the usual installation to reduce significantly the reading of the vocabulary in embedded platforms raulmur/ORB_SLAM2#21 |
I just checked the differences in my clone of ORB_SLAM2 code, and I removed
You may give a try. |
Thanks |
Hi Mathieu in the process modifying the files from the comitt with this steps replacing the files: cmake -DWITH_G2O=OFF .. |
It is strange, these functions should be in PreferencesDialog.cpp: rtabmap/guilib/src/PreferencesDialog.cpp Lines 5338 to 5341 in 89a0eb5
rtabmap/guilib/src/PreferencesDialog.cpp Lines 4416 to 4419 in 89a0eb5
|
I don't know. I don't remember to change more than what was made in the commit and don't open it again after that. |
I'm working in the way to add the commit raulmur/ORB_SLAM2#21 to reduce significantly the time of vocabulary reading within a binary file instead of the txt one which is determining to test this into a embedded system. So I will let this issue open if theres's no inconvenience. |
I tried to compile rtab-map with orb-slam2, but a segmentation fault occurred. The gdb debugging information is as follows: I don't know where to find the problem |
There is a patch here to make ORB_SLAM2 without |
Hi Mathieu
after several attempts following this http://official-rtab-map-forum.206.s1.nabble.com/How-to-use-ORB-SLAM2-library-in-rtabmap-td4230.html I managed to get the orb2 slam to be recognized in the cmake but after continuing the installation, trying to run rtabmap to set the odometry strategy I got this before anything works:
"rtabmap: error while loading shared libraries: libg2o.so: cannot open shared object file: No such file or directory" but it is in the place pointed by the findORB_SLAM2.cmake
I found almost similar situation with another libraries here and try sudo ldconfig but didn't work.
I try to run in gdb with bt as seen in other issues if I could find more information but:
*(gdb) run
Starting program: /usr/local/bin/rtabmap
/usr/local/bin/rtabmap: error while loading shared libraries: libg2o.so: cannot open shared object file: No such file or directory
[Inferior 1 (process 10258) exited with code 0177]
(gdb) bt
No stack.
*
System: ubuntu 16.04 rtabmap: standalone 0.17.2
edit*
next step
changing line 13 in findORB_SLAM2.cmake to: find_library(g2o_LIBRARY NAMES libg2o.so PATHS $ENV{ORB_SLAM2_ROOT_DIR}/Thirdparty/g2o/lib) that library is being recognized but in the make step,
after relink types_sba.h,types_six_dof_expmap.h and linear_solver_eigen.h to the right path in lines 73, 74, 75 respectively in OptimizerG2O.cpp, crash at 6% within building:
[ 6%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/OptimizerG2O.cpp.o
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp: In member function ‘virtual bool rtabmap::EdgeSE3Expmap::setMeasurementData(const double*)’:
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:794:24: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
Eigen::Map v(d);
^
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:794:37: error: template argument 1 is invalid
Eigen::Map v(d);
^
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:794:42: error: invalid conversion from ‘const double*’ to ‘int’ [-fpermissive]
Eigen::Map v(d);
^
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:795:32: error: no matching function for call to ‘g2o::SE3Quat::fromVector(int&)’
measurement.fromVector(v);
^
In file included from /usr/local/include/g2o/types/sba/sbacam.h:46:0,
from /usr/local/include/g2o/types/sba/types_sba.h:33,
from /home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:73:
/usr/local/include/g2o/types/slam3d/se3quat.h:145:19: note: candidate: void g2o::SE3Quat::fromVector(const Vector7&)
inline void fromVector(const Vector7& v){
^
/usr/local/include/g2o/types/slam3d/se3quat.h:145:19: note: no known conversion for argument 1 from ‘int’ to ‘const Vector7& {aka const Eigen::Matrix<double, 7, 1, 0, 7, 1>&}’
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp: In member function ‘virtual bool rtabmap::EdgeSE3Expmap::getMeasurementData(double*) const’:
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:801:18: error: ‘Vector7d’ is not a member of ‘g2o’
Eigen::Mapg2o::Vector7d v(d);
^
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:801:18: error: ‘Vector7d’ is not a member of ‘g2o’
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:801:31: error: template argument 1 is invalid
Eigen::Mapg2o::Vector7d v(d);
^
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:801:36: error: invalid conversion from ‘double*’ to ‘int’ [-fpermissive]
Eigen::Mapg2o::Vector7d v(d);
^
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:802:9: error: cannot convert ‘g2o::Vector7 {aka Eigen::Matrix<double, 7, 1, 0, 7, 1>}’ to ‘int’ in assignment
v = measurement.toVector();
^
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp: In member function ‘virtual std::map<int, rtabmap::Transform> rtabmap::OptimizerG2O::optimizeBA(int, const std::map<int, rtabmap::Transform>&, const std::multimap<int, rtabmap::Link>&, const std::map<int, rtabmap::CameraModel>&, std::map<int, cv::Point3 >&, const std::map<int, std::map<int, cv::Point3 > >&, std::set)’:
/home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:907:104: error: no matching function for call to ‘g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::BlockSolver(g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::LinearSolverType&)’
w g2o::OptimizationAlgorithmLevenberg(new g2o::BlockSolver_6_3(linearSolver)));
^
In file included from /usr/local/include/g2o/core/block_solver.h:199:0,
from /home/antonioguerrero/rtabmap/corelib/src/OptimizerG2O.cpp:43:
/usr/local/include/g2o/core/block_solver.hpp:40:1: note: candidate: g2o::BlockSolver::BlockSolver(std::unique_ptr) [with Traits = g2o::BlockSolverTraits<6, 3>; typename Traits::LinearSolverType = g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> >]
BlockSolver::BlockSolver(std::unique_ptr linearSolver
^
/usr/local/include/g2o/core/block_solver.hpp:40:1: note: no known conversion for argument 1 from ‘g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::LinearSolverType* {aka g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> >*}’ to ‘std::unique_ptr<g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> >, std::default_delete<g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> > > >’
corelib/src/CMakeFiles/rtabmap_core.dir/build.make:1027: fallo en las instrucciones para el objetivo 'corelib/src/CMakeFiles/rtabmap_core.dir/OptimizerG2O.cpp.o'
edit2*
to solve problems of OptimizerG2O.cpp from 794 to 802 correct the code this way:
Eigen::Mapg2o::Vector7d -> Eigen::Mapg2o::Vector7
still workin on problem line 907
The text was updated successfully, but these errors were encountered: