wzj5530 / vins-on-android Goto Github PK
View Code? Open in Web Editor NEWDeploy VINS on android platform, it could run in real time
Deploy VINS on android platform, it could run in real time
I'm a student new on using android studio.
I have got these two errors while building the app using mac m2.
For these problems, is it because I'm using macOS, should I switch to use ubuntu?
Does anyone have an idea on how to solve this? Many thanks!
native-lib.cpp:3:10: fatal error: 'bits/stdc++.h' file not found
Build command failed.
Error while executing process /Users/sue/Library/Android/sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C /Users/sue/Documents/Vins-On-Android-master4/Vins-Droidcv310/app/.cxx/Release/l4h4jp5k/arm64-v8a native-lib}
ninja: Entering directory `/Users/sue/Documents/Vins-On-Android-master4/Vins-Droidcv310/app/.cxx/Release/l4h4jp5k/arm64-v8a'
[1/1] Linking CXX shared library ../../../../build/intermediates/cxx/Release/l4h4jp5k/obj/arm64-v8a/libnative-lib.so
FAILED: ../../../../build/intermediates/cxx/Release/l4h4jp5k/obj/arm64-v8a/libnative-lib.so
: && /Users/sue/Library/Android/sdk/ndk/18.1.5063045/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=/Users/sue/Library/Android/sdk/ndk/18.1.5063045/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/sue/Library/Android/sdk/ndk/18.1.5063045/sysroot -fPIC -isystem /Users/sue/Library/Android/sdk/ndk/18.1.5063045/sysroot/usr/include/aarch64-linux-android -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -frtti -fexceptions -std=c++0x -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot /Users/sue/Library/Android/sdk/ndk/18.1.5063045/platforms/android-21/arch-arm64 -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -L/Users/sue/Library/Android/sdk/ndk/18.1.5063045/sources/cxx-stl/llvm-libc++/libs/arm64-v8a -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libnative-lib.so -o ../../../../build/intermediates/cxx/Release/l4h4jp5k/obj/arm64-v8a/libnative-lib.so CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/estimator_node.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/parameters.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/estimator.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/feature_manager.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/factor/pose_local_parameterization.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/factor/projection_factor.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/factor/marginalization_factor.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/utility/utility.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/utility/visualization.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/initial/solve_5pts.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/initial/initial_aligment.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/initial/initial_sfm.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/initial/initial_ex_rotation.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/ThirdParty/DBoW/BowVector.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/ThirdParty/DBoW/FBrief.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/ThirdParty/DBoW/FeatureVector.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/ThirdParty/DBoW/QueryResults.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/ThirdParty/DBoW/ScoringObject.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/ThirdParty/DUtils/Random.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/ThirdParty/DUtils/Timestamp.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/ThirdParty/DVision/BRIEF.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/ThirdParty/VocabularyBinary.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/loop_closure.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/keyframe.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/loop-closure/keyframe_database.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/feature_tracker/feature_tracker.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/chessboard/Chessboard.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/calib/CameraCalibration.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/camera_models/Camera.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/camera_models/CameraFactory.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/camera_models/CostFunctionFactory.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/camera_models/PinholeCamera.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/camera_models/CataCamera.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/camera_models/EquidistantCamera.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/camera_models/ScaramuzzaCamera.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/sparse_graph/Transform.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/gpl/gpl.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/camera_model/src/gpl/EigenQuaternionParameterization.cc.o CMakeFiles/native-lib.dir/src/main/cpp/src/a2ir/log_util.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/a2ir/phone_sensor.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/a2ir/timer.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/draw_result/delaunay.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/draw_result/draw_result.cpp.o CMakeFiles/native-lib.dir/src/main/cpp/src/vins_estimator/src/draw_result/triangle.cpp.o ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so ../../../../src/main/jniLibs/arm64-v8a/libopencv_calib3d.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_core.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_features2d.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_flann.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_highgui.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_imgcodecs.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_imgproc.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_ml.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_objdetect.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_photo.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_shape.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_stitching.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_superres.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_ts.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_video.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_videoio.a ../../../../src/main/jniLibs/arm64-v8a/libopencv_videostab.a ../../../../src/main/jniLibs/arm64-v8a/libceres.a ../../../../src/main/jniLibs/arm64-v8a/libboost_filesystem-gcc-mt-1_53.a ../../../../src/main/jniLibs/arm64-v8a/libboost_program_options-gcc-mt-1_53.a ../../../../src/main/jniLibs/arm64-v8a/libboost_system-gcc-mt-1_53.a -landroid -llog -lgomp -latomic -lm "/Users/sue/Library/Android/sdk/ndk/18.1.5063045/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so" && :
/Users/sue/Library/Android/sdk/ndk/18.1.5063045/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find -lgomp
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
前提描述:
在Pixel2手机上成功运行,euroc_config_pixel.yaml文件设置的分辨率为640x360,在其他品牌的手机上一律闪退。如果在其他手机上,想要不闪退运行,需要根据手机支持的分辨率(可用CPU监控大师查看)对euroc_config_pixel.yaml中的height和width进行设置(只能比)。比如 我另外台手机,设置的352 X 288,运行起来不闪退,但是可能由于分辨率或未标定的原因,红色有效特征点极少导致不能进入轨迹。
问题:
euroc_config_pixel.yaml中,修改为其他分辨率,如640X480,运行apk会出现以下错误导致崩溃:
OpenCV error: Cannot load info library for OpenCV
Couldn't load BLASTBufferQueue Class
Couldn't find UndequeuedBufferCount functions
E/cv::error(): OpenCV Error: Assertion failed (0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows) in cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&), file /builds/master_pack-android/opencv/modules/core/src/matrix.cpp, line 456
2022-03-09 20:03:58.248 23115-23282/? A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 23282 (Thread-3), pid 23115 (.ads.testopencv)
详细描述:分辨率的设置有两个文件,一个是 euroc_config_pixel.yaml,我们用ros下opencv的camera_calibration工具进行手机相机的标定,默认的分辨率为640X480。作者这里设置的是640x360,我们进行更改就会造成以上的错我崩溃或app卡死。第二个是:app下MainActivity.java里,对于IMG_Width = 640;IMG_Height =360;的设置。这里的值,作者设置和yaml文件时一致的。如果我们将两个文件参数也设置成同样的,比如640X480.出现的现象是:正常进入app特征点提取界面(红色有效点非常少),但不要手机移动。如果想进行轨迹标定和显示,需要进行手机移动吧,如果一移动,就会app卡死(不闪退)。
我想得到什么帮助:我们拿到一台手机,在正常搭建好app后,做好相机640X480的标定数据文件,如何让app进行正常的工作(创建轨迹)?
其他:作者和同行,有思路和交流,欢迎Emai:[email protected]
I'm a student new on using android studio.
I have got these two errors while building the app using mac m2.
Does anyone have an idea to solve this? Many thanks!
1.
:app:buildCMakeRelease
Task :app:buildCMakeRelease
C/C++: ninja: Entering directory `/Users/sue/Documents/VINS-Mobile-Android-master2/VINS_Mobile_AndroidPort/app/.cxx/Release/101n6327/arm64-v8a'
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Task :app:buildCMakeRelease FAILED
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Java heap space
Possible solution:
楼主你好,我的程序跑起来了,可以进行拍照并看到很多捕获点,但你视频上的那个轨迹是怎么跳出来的?多谢。
'''
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
'''
编译的时候遇到这个问题~不是很熟悉安卓,百度了一些方案都没绝解决成功
Build command failed.
Error while executing process E:\Users\Dell\Android\cmake\3.6.4111459\bin\cmake.exe with arguments {-HE:\VS-Prj\Vins-On-Android\Vins-Droidcv310\app -BE:\VS-Prj\Vins-On-Android\Vins-Droidcv310\app\.externalNativeBuild\cmake\debug\arm64-v8a -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-21 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=E:\VS-Prj\Vins-On-Android\Vins-Droidcv310\app\build\intermediates\cmake\debug\obj\arm64-v8a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=E:\Users\Dell\Android\ndk-bundle -DCMAKE_CXX_FLAGS=-frtti -fexceptions -std=c++0x -DCMAKE_TOOLCHAIN_FILE=E:\Users\Dell\Android\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=E:\Users\Dell\Android\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja -DCMAKE_BUILD_TYPE=Release -DANDROID_STL=gnustl_static}
CMake Error at E:/Users/Dell/Android/ndk-bundle/build/cmake/android.toolchain.cmake:265 (message):
gnustl_static is no longer supported. Please switch to either c++_shared
or c++_static. See
https://developer.android.com/ndk/guides/cpp-support.html for more
information.
Call Stack (most recent call first):
E:/Users/Dell/Android/cmake/3.6.4111459/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
I cannot link the gomp in my Android studio.
My Enverment is:
Android Studio 3.2.1
Build #AI-181.5540.7.32.5056338, built on October 9, 2018
JRE: 1.8.0_152-release-1136-b06 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1
and I tried to remove the gomp in "CMakelist.txt" and add it to the gradle file of app. and change the gunstd to c++_static, because my ndk no longer support gnustl. but it also does not work.
my app gradle looks like this:
externalNativeBuild {
cmake {
//"-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang",
// arguments "-DCMAKE_BUILD_TYPE=Release" ,"-DANDROID_STL=gnustl_static", "-DCMAKE_VERBOSE_MAKEFILE=1"
// "-DANDROID_TOOLCHAIN=gcc"
arguments "-DCMAKE_BUILD_TYPE=Release" ,"-DANDROID_STL=c++_static", "-DCMAKE_VERBOSE_MAKEFILE=1"
// cppFlags "-std=c++0x","-frtti", "-fexceptions"
cppFlags "-frtti -fexceptions -std=c++0x -fopenmp"
}
}
文件路径:Vins-On-Android-master\Vins-Droidcv310\app\release\app-release.apk
描述:是已经编译好的APP,在手机上能够运行,进行角点检测。
目的:想要学习一下这部分的程序。
I changed app/build.gradle:
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a'
}
and got this problem:
【Build command failed.
Error while executing process D:\android-sdk-windows_r24\cmake\3.6.4111459\bin\cmake.exe with arguments {--build E:\android_code\Vins-On-Android-master\Vins-Droidcv310\app.externalNativeBuild\cmake\release\armeabi-v7a --target native-lib}
ninja: error: '../../../../src/main/jniLibs/armeabi-v7a/libopencv_calib3d.a', needed by '../../../../build/intermediates/cmake/release/obj/armeabi-v7a/libnative-lib.so', missing and no known rule to make it
】
It seems that your apk in this project is support armeabi-v7a, so that if you can share the libs please?
com.martin.ads.testopencv E/OpenCV/StaticHelper: OpenCV error: Cannot load info library for OpenCV
when I debug the project ,I found this in logcat ,but I have copy that 'brief_k10L6.bin' three files in my phone ,can you tell me what can I do ?
作者您好,我成功地运行了您的代码,试图调用drawAR来实现平面上绘制箱子的功能。
但是其中发现一些令人费解的代码,比如在drawGround函数中
cv::Mat aa(HEIGHT,WIDTH,CV_8UC3,Scalar(0,0,0));
result = aa;
该部分会导致运行时出现卡死并且报错,我将其注释掉之后成功绘制平面,但是平面的点极其不稳定
后面的drawBox函数也似乎无法实现其功能,希望您可以给一些代码上修改的建议或者提示
11-15 14:44:16.498 757-979/com.martin.ads.testopencv A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x2ffe01008 in tid 979 (.ads.testopencv)
调试发现缺少libceres.a文件,我自己编译出来的文件放进去还是报错。能否更新下这个文件或者提供这个文件的编译命令,非常感谢。
作者你好,我编译并运行了你的项目。轨迹之在最开始转动才有效,之后会大幅度偏移。
相机未知经常无缘故漂移到无限远。我看到draw_result.hpp的相机内参和euroc_config_pixel.yaml的相机内参不同。当我尝试更改draw_result.hpp的相机内参式,相机的轨迹图变得更加离谱。
所以相机的位姿预测和内参标定的具体关系是什么?另外如果要自己标定。我看到当我把最后的图片缩放成不同大小事会得到完全不同的畸变参数和相机内参。那么如果我更改相机的焦距(电子变焦),相机内参也会变化吗?
我看到你的视频中,相机位置的变化是准确的。你是自己重新进行了相机标定并更改code中的参数吗?如果是的话,你们教我该如何做。
感谢!
目前我已经成功编译运行了·但是存在些问题想向您请教一下··就关于这个手机参数校正问题,1 如何知道app采集照片的尺寸,比如我手机拍照有一个尺寸设置,我想知到这个app获得的尺寸多少,默认手机的拍照尺寸的吗?2 关于IMU 的allen 方差分析,我想知道app 采集的imu频率可以设置吗 ?因为利用第三app 采集手机IMU 数据 的时候可以选择采样频率 normal game fastest 等等··我应该选哪一个,以及对应的手机vins-on-android的采样频率是多少 ····
com.martin.ads.testopencv E/OpenCV/StaticHelper: OpenCV error: Cannot load info library for OpenCV
when I debug the project ,I found this in logcat ,but I have copy that 'brief_k10L6.bin' three files in my phone ,can you tell me what can I do ?
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.