MobiSense / SwarmMap

SwarmMap: Scaling Up Real-time Collaborative Visual SLAM at the Edge
Other
30 stars 4 forks source link

Server_map breaks down #6

Open LightwishWONG opened 1 year ago

LightwishWONG commented 1 year ago

Hello. I just completed building the SwarmMap project following the instructions. However, when I ran the server_map by ./swarm_map -d /home/lightwish/SwarmMap/config/mh123.yaml -v /home/lightwish/SwarmMap/code/Vocabulary/ORBvoc.bin -c 3 -l debug, many UI windows popped up on after another and then the program terminated, as shown in the following video.

https://github.com/MobiSense/SwarmMap/assets/97330420/9b873e7c-9678-4f05-ad97-3e700b123a73

My OS is Ubuntu 20.04 LTS with opencv 4.2.0 and CUDA 11.8. I've downloaded the EuRoC dataset. The mh123.yaml file is as follows:

%YAML:1.0

TYPE: 'euroc'
SETTING: '/home/lightwish/SwarmMap/code/Examples/Monocular/EuRoC.yaml'
IMAGES: ['/home/lightwish/SwarmMap/EuRoC_dataset/MH_01_easy/mav0/cam0/data', '/home/lightwish/SwarmMap/EuRoC_dataset/MH_02_easy/mav0/cam0/data', '/home/lightwish/SwarmMap/EuRoC_dataset/MH_03_medium/mav0/cam0/data']
TIMES: ['/home/lightwish/SwarmMap/code/Examples/Monocular/EuRoC_TimeStamps/MH01.txt', '/home/lightwish/SwarmMap/code/Examples/Monocular/EuRoC_TimeStamps/MH02.txt', '/home/lightwish/SwarmMap/code/Examples/Monocular/EuRoC_TimeStamps/MH03.txt']

# ID dispatch address and port
HOST: '0.0.0.0'
PORT: 10088

I have no idea what's going on. Could someone help me fix this? I really appreciate your help!

Halcao commented 1 year ago

Hi, it seems to be a segmentation fault error, but we need more information to detect its root cause. Please provide the detailed logs or error messages that occur when running the server_map command. Additionally, recompile the SwarmMap project with debug symbols enabled and use gdb to run the program. Set breakpoints at relevant points in the code to identify the specific line causing the segmentation fault. This will help us diagnose and resolve the issue.

LightwishWONG commented 1 year ago

@Halcao Hi Halcao. Many thanks for your help! Sorry for my late reply. I was working on another project. I recompiled the SwarmMap project with debug enabled and set breakpoints to debug as you suggested. I ran swarm_map and got the following error:

terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.2.0) /home/lightwish/Downloads/opencv-4.2.0/modules/core/src/cuda_stream.cpp:303: error: (-217:Gpu API call) unknown error in function 'Impl'

Line 303 in this cuda_stream.cpp file is cudaSafeCall( cudaStreamCreate(&stream) );. image

Then I set breakpoints to debug. I found that in /SwarmMap/code/src/ORBextractor.cc, an exception breakpoint occurred in line 344: gpuFast(iniThFAST, minThFAST), ic_angle(), gpuOrb(), as shown in the following figure. image

Seems like something went wrong with CUDA. I use opencv 4.2.0 and CUDA 11.8 on Ubuntu 20.04 LTS.

Halcao commented 1 year ago

Thank you for providing the information. Considering my CUDA version is 10.2, it would be worth trying this version first. If the issue persists, you can then consider switching to the OpenCV implementation of the ORB extractor as an alternative solution

LightwishWONG commented 1 year ago

Yeah I agree. I'm gonna switch my opencv/CUDA version to 3.4/10.2 and try again. I will feedback if I succeed later.

wonderfulplace commented 1 month ago

@LightwishWONG Hi, LightwishWONG. I have encountered the same problem as you. Is the solution you proposed feasible?