Hello,
Background information:
- I am using the Machine Vision SDK v1.2.10 (865)
- I am running on an 865 board
- I am running on an RBK5 board that is running ubuntu 18.04 with linux kernel version 4.19.95
- I am trying to get VISLAM working
- The system is 64 bit and I am compiling on target with the native 64bit gcc compiler
The Problem Im having:
I am having some issues getting mvVISLAM_Initialize to work. Whenever I call mvVISLAM_Initialize, the MV library causes a segfault. At the end of this post I have added a small snippet of test code that causes the segfault (I took this code from the vio example). I have confirmed using valgrind that the issue is coming from within mvVISLAM_Initialize. Below is the valgrind output:
==2988== Memcheck, a memory error detector
==2988== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2988== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==2988== Command: ./voxl-snapdragon-vio
==2988==
(src/main.cpp:48): Starting Snap VIO Application
(src/snap_vio.cpp:79): Initing MV VIO
Here
MachineVision is licensed as community user
LNX_8074 supported? 1
LNX_8096 supported? 1
LNX_IA64 supported? 1
WINDOWS supported? 1
AR ERROR: arFileOpen(): Failed to open file: /root/ali_dev/snap_vio/build/vislam/Configuration.SF.xml
mempool cur block size 307200, new block size 307200
==2988== Invalid write of size 8
==2988== at 0x49CCFC4: ??? (in /usr/lib/libmv1.so)
==2988== by 0x49D230F: ??? (in /usr/lib/libmv1.so)
==2988== by 0x49AC15B: ??? (in /usr/lib/libmv1.so)
==2988== by 0x491AC7F: mvVISLAM_Initialize (in /usr/lib/libmv1.so)
==2988== by 0x10ED7B: SnapVIO::initMVLibrary(ConfigReader::SnapVIOConfig const&) (in /root/ali_dev/snap_vio/build/voxl-snapdragon-vio)
==2988== by 0x10E9BF: SnapVIO::init(ConfigReader::SnapVIOConfig const&) (in /root/ali_dev/snap_vio/build/voxl-snapdragon-vio)
==2988== by 0x10E883: main (in /root/ali_dev/snap_vio/build/voxl-snapdragon-vio)
==2988== Address 0x1ffeffd8e0 is on thread 1's stack
==2988== 16 bytes below stack pointer
==2988==
Here 1
(src/main.cpp:66): Done!!!!!!!!!!!!!!!!!!!!
==2988==
==2988== HEAP SUMMARY:
==2988== in use at exit: 14,044,155 bytes in 471 blocks
==2988== total heap usage: 4,309 allocs, 3,838 frees, 14,757,731 bytes allocated
==2988==
==2988== LEAK SUMMARY:
==2988== definitely lost: 1,576 bytes in 4 blocks
==2988== indirectly lost: 1,232,432 bytes in 13 blocks
==2988== possibly lost: 12,810,027 bytes in 450 blocks
==2988== still reachable: 120 bytes in 4 blocks
==2988== suppressed: 0 bytes in 0 blocks
==2988== Rerun with --leak-check=full to see details of leaked memory
==2988==
==2988== For counts of detected and suppressed errors, rerun with: -v
==2988== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
It can be seen from the valgrind output that the issue seems to be coming from some internal function within the MV library.
Any help would be greatly appreciated!
Thanks,
Ali
------------------------------------------------------------------------------------------------------------------------------------------------
This is some test code that causes the issue:
float32_t tbc[3] = { 0, 0, 0 };
float32_t ombc[3] = { 0, 0, 0 };
float32_t std0Tbc[3] = { 0.005, 0.005, 0.005 };
float32_t std0Ombc[3] = { 0.04, 0.04, 0.04 };
float32_t tba[3] = { 0, 0, 0 };
float32_t readoutTime = 0; // 0 for global shutter
float32_t delta = 0.0026; // FLIGHT PRO
float32_t std0Delta = 0.001; // firmware/driver upgrades may affect the time alignment
float32_t accelMeasRange = 156;
float32_t gyroMeasRange = 34;
float32_t stdAccelMeasNoise = 0.316227766016838; // sqrt(1e-1);
float32_t stdGyroMeasNoise = 1e-2; // sqrt(1e-4);
float32_t stdCamNoise = 100;
float32_t minStdPixelNoise = 0.5;
float32_t failHighPixelNoiseScaleFactor = 1.6651;
float32_t logDepthBootstrap = 0;
bool useLogCameraHeight = false;
float32_t logCameraHeightBootstrap = -3.22;
bool noInitWhenMoving = true;
float32_t limitedIMUbWtrigger = 35;
float32_t gpsImuTimeAlignment = 0.1;
bool mapping = false;
std::string staticMaskFileName = "";
mvCameraConfiguration camera;
camera.pixelWidth = 640;
camera.pixelHeight = 480;
camera.memoryStride = 640;
camera.uvOffset = 0;
camera.principalPoint[0] = 0;
camera.principalPoint[1] = 0;
camera.focalLength[0] = 0;
camera.focalLength[1] = 0;
for (int i = 0; i < 8; i++)
{
camera.distortion[i] = 0;
}
camera.distortionModel = 0;
mvVISLAM* viSlamTracker = mvVISLAM_Initialize( &camera, readoutTime,
tbc, ombc, delta, std0Tbc, std0Ombc, std0Delta,
accelMeasRange, gyroMeasRange, stdAccelMeasNoise, stdGyroMeasNoise,
stdCamNoise, minStdPixelNoise, failHighPixelNoiseScaleFactor,
logDepthBootstrap, useLogCameraHeight, logCameraHeightBootstrap,
noInitWhenMoving, limitedIMUbWtrigger, staticMaskFileName.c_str(),
gpsImuTimeAlignment, tba, mapping );
// Never Gets Here
@ali.younis, I am facing the same issue on RB5 development kit. Were you able to solve it? If yes, how?
The default MVSDK deb package available on the qualcomm website is for armhf while RB5 is arm64. I am using the package from Modal-AI. I am able to build the package(similar to yours), but am facing run-time segmentation faults on call to mvVISLAM_Initialize function. Need some help regarding the same.