MIT-SPARK / Kimera-Multi-LCD

BSD 2-Clause "Simplified" License
34 stars 8 forks source link

Installation of `mit_voc.yaml` is not out-of-the-box #3

Closed LimHyungTae closed 2 weeks ago

LimHyungTae commented 3 weeks ago

As mentioned in https://github.com/MIT-SPARK/Kimera-Multi/issues/18, currently vocab.zip file is not automatically installed in the kimera_multi_lcd directory, which leads to an error like that:

F0817 17:58:18.718714 4103241 LoopClosureDetector.cpp:65] Check failed: f_vocab.good() LoopClosureDetector: Incorrect vocabulary path: /home/shapelim/kimera_multi_ws/src/kimera_multi_lcd/vocab/mit_voc.yml
*** Check failure stack trace: ***
    @     0x7fc0551c5703  google::LogMessage::Fail()
    @     0x7fc0551ca4ab  google::LogMessage::SendToLog()
    @     0x7fc0551c53ff  google::LogMessage::Flush()
    @     0x7fc0551c5c2f  google::LogMessageFatal::~LogMessageFatal()
    @     0x7fc0501f8bef  VIO::loadOrbVocabulary()
    @     0x7fc0501f8ccc  VIO::PreloadedVocab::PreloadedVocab()
    @     0x7fc054f4d43d  VIO::KimeraVioRos::runKimeraVio()
    @     0x55934ef3c9c9  main
    @     0x7fc054621083  __libc_start_main
    @     0x55934ef3ca4e  _start
================================================================================REQUIRED process [acl_jackal2/kimera_vio_ros/kimera_vio_ros_node-1] has died!
process has died [pid 4103241, exit code -6, cmd /home/shapelim/kimera_multi_ws/devel/lib/kimera_vio_ros/kimera_vio_ros_node --use_lcd=true --vocabulary_path=/home/shapelim/kimera_multi_ws/src/kimera_multi_lcd/vocab/mit_voc.yml --flagfile=/home/shapelim/kimera_multi_ws/src/kimera_multi/params/D455/flags/Mesher.flags --flagfile=/home/shapelim/kimera_multi_ws/src/kimera_multi/params/D455/flags/VioBackend.flags --flagfile=/home/shapelim/kimera_multi_ws/src/kimera_multi/params/D455/flags/RegularVioBackend.flags --flagfile=/home/shapelim/kimera_multi_ws/src/kimera_multi/params/D455/flags/Visualizer3D.flags --use_external_odometry=true --do_coarse_imu_camera_temporal_sync=false --do_fine_imu_camera_temporal_sync=false --lcd_no_optimize=true --lcd_no_detection=false --depth_image_mask= --logtostderr=1 --colorlogtostderr=1 --log_prefix=1 --minloglevel=0 --v=0 --log_output=false --log_euroc_gt_data=false --output_path=/home/shapelim/kimera_multi_ws/src/Kimera-VIO-ROS/output_logs/ --lcd_disable_stereo_match_depth_check=true --no_incremental_pose=true --viz_type=2 --visualize=true left_cam/image_raw:=/acl_jackal2/forward/infra1/image_rect_raw left_cam/image_raw/compressed:=/acl_jackal2/forward/infra1/image_rect_raw/compressed right_cam/image_raw:=/acl_jackal2/forward/infra2/image_rect_raw right_cam/image_raw/compressed:=/acl_jackal2/forward/infra2/image_rect_raw/compressed imu:=/acl_jackal2/forward/imu external_odom:=/acl_jackal2/jackal_velocity_controller/odom reinit_flag:=reinit_flag reinit_pose:=reinit_pose odometry:=odometry resiliency:=resiliency imu_bias:=imu_bias optimized_trajectory:=optimized_trajectory pose_graph:=pose_graph mesh:=mesh frontend_stats:=frontend_stats debug_mesh_img/image_raw:=debug_mesh_img/image_raw feature_tracks/image_raw:=feature_tracks/image_raw time_horizon_pointcloud:=time_horizon_pointcloud __name:=kimera_vio_ros_node __log:=/home/shapelim/.ros/log/e8f4c314-5ccf-11ef-8b10-89c894c2eed9/acl_jackal2-kimera_vio_ros-kimera_vio_ros_node-1.log].
log file: /home/shapelim/.ros/log/e8f4c314-5ccf-11ef-8b10-89c894c2eed9/acl_jackal2-kimera_vio_ros-kimera_vio_ros_node-1*.log
Initiating shutdown!
================================================================================

image

yunzc commented 3 weeks ago

Hi @LimHyungTae technically it should be automatically downloaded!

Please see here. Though it is indeed a problem that it fails silently sometimes. https://github.com/MIT-SPARK/Kimera-Multi-LCD/blob/main/cmake/vocab_download.cmake

LimHyungTae commented 3 weeks ago

Thanks for taking your time in weekend, @yunzc

Yep it should be, but I found that it does not work now, and I've realized that

file(DOWNLOAD
       https://drive.google.com/uc?export=download&confirm=9iBg&id=1N4y0HbgA3PHQ73ZxFJvy5dgvV_0cTBYF
       ${CMAKE_CURRENT_SOURCE_DIR}/vocab.zip
       SHOW_PROGRESS
       STATUS voc_download_success
       TIMEOUT 60)

this block does not work as we intended. It generates a weird vocab.zip file (i.e. vocab.zip file should be around 30 MB, but it outputs weird lightweight vocab.zip file).


Debugging

I also tested the below code after manually putting the original vocab.zip file, and it worked.

### Download and unzip the vocabulary file
message("[Kimera-Multi-LCD] Trying to download and unzip the vocabulary file...")
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/vocab/mit_voc.yml)
  message("[Kimera-Multi-LCD] Downloading vocabulary file from drive.")
#  file(DOWNLOAD
#       https://drive.google.com/uc?export=download&confirm=9iBg&id=1N4y0HbgA3PHQ73ZxFJvy5dgvV_0cTBYF
#       ${CMAKE_CURRENT_SOURCE_DIR}/vocab.zip
#       SHOW_PROGRESS
#       STATUS voc_download_success
#       TIMEOUT 60)
  set(voc_download_success True)
  if(voc_download_success)
    message("[Kimera-Multi-LCD] Unzipping vocabulary file...")

    execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/vocab.zip
                            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/)
#    execute_process(COMMAND ${CMAKE_COMMAND} -E rm ${CMAKE_CURRENT_SOURCE_DIR}/vocab.zip)
  else()
    message(FATAL_ERROR "[Kimera-Multi-LCD] Failed to download vocabulary file. Please download manually.")
  endif()
else()
  message("[Kimera-Multi-LCD] Vocabulary file exists, will not download.")
endif()
LimHyungTae commented 3 weeks ago

Potential solution

What about updating that line using an address, not the Google Share link? For instance, here's an example that normally works:

https://github.com/url-kaist/Quatro/blob/82d034385eb43cd9566b83ca743b03cfb66cc653/CMakeLists.txt#L57

I guess the file address should be complete.

LimHyungTae commented 3 weeks ago

I tested it by making my repository (https://github.com/LimHyungTae/kimera-multi-vocab)

and run wget https://github.com/LimHyungTae/kimera-multi-vocab/raw/master/vocab.zip,

and it successfully works!!! XD