-
Notifications
You must be signed in to change notification settings - Fork 794
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
expected type-specifier before ‘OdometryORBSLAM’ : ORBSLAM2 RTAB-MAP. #1232
Comments
Avoid the problem. Do not download the latest rtab-map version, select the suffix melodic (ubuntu18), and ros corresponding to this version, you will not encounter this problem when runningm, choose anth |
The ORB_SLAM integration has been updated to support ORB_SLAM2 and ORB_SLAM3 in that commit aaff1ab. Based on your error, there is indeed a bug here: rtabmap/corelib/src/Odometry.cpp Lines 88 to 92 in 52e1b01
It should be: #if defined(RTABMAP_ORB_SLAM) and RTABMAP_ORB_SLAM == 2
odometry = new OdometryORBSLAM2(parameters);
#else
odometry = new OdometryORBSLAM3(parameters);
#endif |
Fixed in commit above. I tested on ubuntu 20.04 / OpenCV 4, so I used this PR: raulmur/ORB_SLAM2#1075 with these local changes: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 465e9ff..7bdab9c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,8 +7,8 @@ ENDIF()
MESSAGE("Build type: " ${CMAKE_BUILD_TYPE})
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native ")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 ")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3")
# Check c++14 or C++0x support
include(CheckCXXCompilerFlag)
diff --git a/Thirdparty/DBoW2/CMakeLists.txt b/Thirdparty/DBoW2/CMakeLists.txt
index e20f340..a174009 100644
--- a/Thirdparty/DBoW2/CMakeLists.txt
+++ b/Thirdparty/DBoW2/CMakeLists.txt
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 2.8)
project(DBoW2)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native ")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 ")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 ")
set(HDRS_DBOW2
DBoW2/BowVector.h
diff --git a/Thirdparty/g2o/CMakeLists.txt b/Thirdparty/g2o/CMakeLists.txt
index 620e688..c1a3c91 100644
--- a/Thirdparty/g2o/CMakeLists.txt
+++ b/Thirdparty/g2o/CMakeLists.txt
@@ -54,8 +54,8 @@ IF(OPENMP_FOUND AND G2O_USE_OPENMP)
ENDIF(OPENMP_FOUND AND G2O_USE_OPENMP)
# Compiler specific options for gcc
-SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -march=native")
-SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -march=native")
+SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 ")
+SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 ") |
1 Thank you for your reply. My environment is ubuntu18. Now that ORBSLAM2 has been installed, which version of rtab-map should be installed later? Directly git the latest version or the --melodic version, such as 0.20.23-melodic? 2 My environment dependencies are: 3 When compiling ORBSLAM2, I directly git the version of ORBSLAM2, and then use orbslam2_f2e6f51_marchnative_disabled.patch: and then compile again. |
I completed all the compilation and ran roslaunch and this problem occurred. (rtab-map and rtab-map-ros both are obtained directly from github) roslaunch rtabmap_ros euroc_datasets.launch args:="Odom/Strategy 5 OdomORBSLAM/VocPath /home/shen/rtab_ws/src/ORB_SLAM2/Vocabulary/ORBvoc.txt" MH_seq:=true raw_images_for_odom:=true -Does the file actually exists? Yes, under /home/shen/rtab_ws/src/rtabmap_ros/rtabmap_examples/launch. Answer way: My commands are: there is an error: |
Hi, For your previous message, you should be able to build latest master branch on 18.04. The euroc_datasets.launch is now under rtabmap_examples package:
Tested with version above and I could not reproduce the error. Is it happening at the beginning or later in the bag? (to know at least it is somewhat working) My log just after starting the bag:
|
Sorry to bother you, my previous installation was to directly git the latest rtab-map and rtab-map-ros codes. |
Yeah, you can also create a docker to run on any ubuntu os. |
thank you so much!
…---- Replied Message ----
| From | ***@***.***> |
| Date | 03/17/2024 07:22 |
| To | introlab/rtabmap ***@***.***> |
| Cc | Dan ***@***.***>,
Author ***@***.***> |
| Subject | Re: [introlab/rtabmap] expected type-specifier before ‘OdometryORBSLAM’ : ORBSLAM2 RTAB-MAP. (Issue #1232) |
Yeah, you can also create a docker to run on any ubuntu os.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I installed ORBSLAM2 in conjunction with RTAB-MAP.
I get this error when RTAB-MAP executes make.
It looks like it's a problem with gcc g++.
In ORBSLAM2 patch (from https://zhuanlan.zhihu.com/p/426604435)
The reason for the error when executing the patch directly is that the changes to the CXX in the three CMakeLists are more or less the same, with only a few differences, and ORBSLAM2 compiles without problems.
install reference
https://zhuanlan.zhihu.com/p/528557998
https://zhuanlan.zhihu.com/p/426604435
the output:
[ 33%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/optimizer/OptimizerGTSAM.cpp.o
[ 33%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/optimizer/OptimizerCVSBA.cpp.o
[ 33%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/optimizer/OptimizerCeres.cpp.o
[ 34%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/Registration.cpp.o
[ 34%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/RegistrationIcp.cpp.o
[ 35%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/RegistrationVis.cpp.o
[ 35%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/Odometry.cpp.o
/home/master/study-learning/rtabmap/corelib/src/Odometry.cpp: In static member function ‘static rtabmap::Odometry* rtabmap::Odometry::create(rtabmap::Odometry::Type&, const ParametersMap&)’:
/home/master/study-learning/rtabmap/corelib/src/Odometry.cpp:89:18: error: expected type-specifier before ‘OdometryORBSLAM’
odometry = new OdometryORBSLAM(parameters);
^~~~~~~~~~~~~~~
corelib/src/CMakeFiles/rtabmap_core.dir/build.make:1650: recipe for target 'corelib/src/CMakeFiles/rtabmap_core.dir/Odometry.cpp.o' failed
make[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/Odometry.cpp.o] Error 1
CMakeFiles/Makefile2:267: recipe for target 'corelib/src/CMakeFiles/rtabmap_core.dir/all' failed
make[1]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
The text was updated successfully, but these errors were encountered: