Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9bbf5ba
feat:添加glog用于debug,适配新的vikit以及新版Sophus
yqmy0814 Apr 25, 2025
3eb1a51
style:调整命名,添加注释
yqmy0814 May 15, 2025
6ecc1ca
Merge branch 'hku-mars:main' into devel
yqmy0814 May 15, 2025
58dbf91
style:整合vikit
yqmy0814 May 15, 2025
8e41a6d
Merge branch 'devel' of https://github.com/yqmy0814/FAST-LIVO2 into d…
yqmy0814 May 15, 2025
1a0ed60
style:微调Cmake
yqmy0814 May 15, 2025
1e0f0dc
feat:voxel_map添加LRU
yqmy0814 May 20, 2025
e72a1bb
fix:去除不安全的多线程
yqmy0814 May 20, 2025
695bfd5
临时保存
yqmy0814 May 20, 2025
23f98c4
临时保存
yqmy0814 May 20, 2025
fc6fb73
style:微调vikit库
yqmy0814 May 20, 2025
a229dbb
Merge branch 'devel' into add_lru
yqmy0814 May 20, 2025
c015aa7
Merge branch 'add_lru' into test
yqmy0814 May 20, 2025
c98fe72
feat: 完成lio的LRU机制
yqmy0814 May 26, 2025
22c8bda
Merge remote-tracking branch 'origin/main' into devel
yqmy0814 May 26, 2025
a325b2b
merge
yqmy0814 May 26, 2025
72032d8
merge
yqmy0814 May 26, 2025
7344082
Merge remote-tracking branch 'origin/main' into devel
yqmy0814 May 26, 2025
a8f84ed
merge
yqmy0814 May 26, 2025
3a307d2
feat:vio添加LRU机制
yqmy0814 May 27, 2025
cc327c7
docs:修改Readme
yqmy0814 May 27, 2025
0d5eabd
docs:修改Readme
yqmy0814 May 27, 2025
7b0fe96
fix:修复了无法读取相机配置的问题
yqmy0814 May 27, 2025
ff5eb96
Merge remote-tracking branch 'origin/main' into merge
yqmy0814 May 29, 2025
c524f68
feat:添加glibc malloc优化和vio图像边界检查,删去了LO模式并简化了主处理流程
yqmy0814 Sep 3, 2025
0fe1a7d
docs: 更新README
yqmy0814 Sep 3, 2025
bfc968a
docs:更新README
yqmy0814 Sep 3, 2025
8d70e0f
Merge branch 'main' into devel
yqmy0814 Sep 15, 2025
3b93a23
fix: 修复vikit_common对Eigen的索引
yqmy0814 Nov 4, 2025
55b6d41
Merge remote-tracking branch 'origin/main' into devel
yqmy0814 Nov 4, 2025
6748d0e
Merge branch 'main' into merge
yqmy0814 Dec 31, 2025
20f38fa
fix: 修复VoxelOctoTree析构函数被注释和vio中vp_data_没有更新位置的问题
yqmy0814 Dec 31, 2025
0d2c034
[Docs] update FAST-LIVO2-Dataset download link.
xuankuzcr Mar 8, 2026
48a2a32
Merge branch 'main' into devel
yqmy0814 Mar 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,29 @@ find_package(catkin REQUIRED COMPONENTS
tf
message_generation
eigen_conversions
vikit_common
vikit_ros
cv_bridge
image_transport
)

add_subdirectory(vikit_common)

# glog
find_package(Glog REQUIRED)
include_directories(${GLOG_INCLUDE_DIR})

# gflags
find_package(Gflags REQUIRED)
include_directories(${GFLAGS_INCLUDE_DIR})

find_package(Eigen3 REQUIRED)
find_package(PCL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Sophus REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread)

set(Sophus_LIBRARIES libSophus.so)

# Define the catkin package
catkin_package(
CATKIN_DEPENDS geometry_msgs nav_msgs roscpp rospy std_msgs message_runtime cv_bridge vikit_common vikit_ros image_transport
DEPENDS EIGEN3 PCL OpenCV Sophus
CATKIN_DEPENDS geometry_msgs nav_msgs roscpp rospy std_msgs message_runtime cv_bridge image_transport
DEPENDS EIGEN3 PCL OpenCV
)

# Include directories for dependencies
Expand All @@ -113,12 +118,12 @@ include_directories(
${EIGEN3_INCLUDE_DIR}
${PCL_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${Sophus_INCLUDE_DIRS}
include
vikit_common/include
)

# Add libraries
add_library(vio src/vio.cpp src/frame.cpp src/visual_point.cpp)
add_library(vio src/vio.cpp src/image_frame.cpp)
add_library(lio src/voxel_map.cpp)
add_library(pre src/preprocess.cpp)
add_library(imu_proc src/IMU_Processing.cpp)
Expand All @@ -137,8 +142,10 @@ target_link_libraries(fastlivo_mapping
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${OpenCV_LIBRARIES}
${Sophus_LIBRARIES}
glog::glog
${GFLAGS_LIBRARIES}
${Boost_LIBRARIES}
vikit_plugin
)

# Link mimalloc if found
Expand Down
Empty file removed Log/image/.gitkeep
Empty file.
Empty file removed Log/pcd/.gitkeep
Empty file.
55 changes: 28 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# FAST-LIVO2
## 改进内容
1. 将sophus1.24.6和vikit整合至项目内,现在不再需要安装这两项依赖
2. 添加了LRU内存管理,控制内存增长速度
3. 使用谷歌风格对部分变量函数等进行了重命名,添加了部分注释
4. 引入了glog和gflags(可按照后续步骤安装),在程序崩溃时可以便捷地找到出错的位置,便于调试,同时便于外部参数输入
5. 添加了glibc malloc内存分配优化,避免长时间占用空闲内存(2025-09-03新增)
6. 删去了LO模式和若干冗余变量,主要处理流程更加清晰(2025-09-03新增)

## FAST-LIVO2: Fast, Direct LiDAR-Inertial-Visual Odometry

Expand Down Expand Up @@ -60,44 +67,38 @@ Eigen>=3.3.4, Follow [Eigen Installation](https://eigen.tuxfamily.org/index.php?

OpenCV>=4.2, Follow [Opencv Installation](http://opencv.org/).

### 2.3 Sophus

Sophus Installation for the non-templated/double-only version.

```bash
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff
mkdir build && cd build && cmake ..
make
sudo make install
```

### 2.4 Vikit

Vikit contains camera models, some math and interpolation functions that we need. Vikit is a catkin project, therefore, download it into your catkin workspace source folder.

```bash
# Different from the one used in fast-livo1
cd catkin_ws/src
git clone https://github.com/xuankuzcr/rpg_vikit.git
```

## 3. Build

Clone the repository and catkin_make:

```
cd ~/catkin_ws/src
git clone https://github.com/hku-mars/FAST-LIVO2
cd ../
git clone https://github.com/yqmy0814/FAST-LIVO2

# 安装glog和gflags,已安装则跳过
cd FAST-LIVO2/thirdparty
tar -xvf gflags-2.2.2.tar.gz
cd gflags-2.2.2
mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS=-fPIC ..
make -j4
sudo make install
cd ../..
tar -xvf glog-0.4.0.tar.gz
cd glog-0.4.0
mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=ON ..
make -j4
sudo make install

cd ~/catkin_ws
catkin_make
source ~/catkin_ws/devel/setup.bash
```

## 4. Run our examples

Download our collected rosbag files via OneDrive ([**FAST-LIVO2-Dataset**](https://connecthkuhk-my.sharepoint.com/:f:/g/personal/zhengcr_connect_hku_hk/ErdFNQtjMxZOorYKDTtK4ugBkogXfq1OfDm90GECouuIQA?e=KngY9Z)).
Download FAST-LIVO2-Dataset from [Global-LVBA](https://github.com/xuankuzcr/Global-LVBA) Section IV.

```
roslaunch fast_livo mapping_avia.launch
Expand All @@ -107,4 +108,4 @@ rosbag play YOUR_DOWNLOADED.bag

## 5. License

The source code of this package is released under the [**GPLv2**](http://www.gnu.org/licenses/) license. For commercial use, please contact me at <zhengcr@connect.hku.hk> and Prof. Fu Zhang at <fuzhang@hku.hk> to discuss an alternative license.
The source code of this package is released under the [**GPLv2**](http://www.gnu.org/licenses/) license. For commercial use, please contact me at <zhengcr@connect.hku.hk> and Prof. Fu Zhang at <fuzhang@hku.hk> to discuss an alternative license.
5 changes: 3 additions & 2 deletions config/HILTI22.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ common:
lid_topic: "/hesai/pandar"
imu_topic: "/alphasense/imu"
img_en: 1
lidar_en: 1
ros_driver_bug_fix: false

extrin_calib:
Expand Down Expand Up @@ -49,7 +48,6 @@ vio:
inv_expo_cov: 0.1

imu:
imu_en: true
imu_int_frame: 30
acc_cov: 0.5 # 0.1
gyr_cov: 0.01
Expand Down Expand Up @@ -98,3 +96,6 @@ pcd_save:
image_save:
img_save_en: false
interval: 1

lru_config:
lru_size: 1000000
7 changes: 4 additions & 3 deletions config/MARS_LVIG.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ common:
lid_topic: "/livox/lidar"
imu_topic: "/livox/imu"
img_en: 1
lidar_en: 1
ros_driver_bug_fix: false

extrin_calib:
Expand Down Expand Up @@ -65,7 +64,6 @@ vio:
inv_expo_cov: 0.1

imu:
imu_en: true
imu_int_frame: 30
acc_cov: 2.0 # 0.5
gyr_cov: 0.1 # 0.3
Expand Down Expand Up @@ -113,4 +111,7 @@ pcd_save:

image_save:
img_save_en: false
interval: 1
interval: 1

lru_config:
lru_size: 1000000
7 changes: 4 additions & 3 deletions config/NTU_VIRAL.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ common:
lid_topic: "/os1_cloud_node1/points"
imu_topic: "/imu/imu"
img_en: 1
lidar_en: 1
ros_driver_bug_fix: false

extrin_calib:
Expand Down Expand Up @@ -41,7 +40,6 @@ vio:
inv_expo_cov: 0.1

imu:
imu_en: true
imu_int_frame: 30
acc_cov: 0.5 # 0.2
gyr_cov: 0.3 # 0.5
Expand Down Expand Up @@ -89,4 +87,7 @@ pcd_save:

image_save:
img_save_en: false
interval: 1
interval: 1

lru_config:
lru_size: 1000000
15 changes: 8 additions & 7 deletions config/avia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ common:
lid_topic: "/livox/lidar"
imu_topic: "/livox/imu"
img_en: 1
lidar_en: 1
ros_driver_bug_fix: false

extrin_calib:
extrinsic_T: [0.04165, 0.02326, -0.0284]
extrinsic_R: [1, 0, 0, 0, 1, 0, 0, 0, 1]
Rcl: [0.00610193,-0.999863,-0.0154172,
-0.00615449,0.0153796,-0.999863,
0.999962,0.00619598,-0.0060598]
Pcl: [0.0194384, 0.104689,-0.0251952]
Rcl: [-0.0036250, -0.9998907, -0.0143360,
0.0075568, 0.0143083, -0.9998690,
0.9999649, -0.0037329, 0.0075041]
Pcl: [0.00549469, 0.0712101, 0.0322054]

time_offset:
imu_time_offset: 0.0
Expand All @@ -21,7 +20,7 @@ time_offset:

preprocess:
point_filter_num: 1
filter_size_surf: 0.1
filter_size_surf: 0.1
lidar_type: 1 # Livox Avia LiDAR
scan_line: 6
blind: 0.8
Expand All @@ -39,7 +38,6 @@ vio:
inv_expo_cov: 0.1

imu:
imu_en: true
imu_int_frame: 30
acc_cov: 0.5 # 0.2
gyr_cov: 0.3 # 0.5
Expand Down Expand Up @@ -88,3 +86,6 @@ pcd_save:
image_save:
img_save_en: false
interval: 1

lru_config:
lru_size: 1000000
16 changes: 8 additions & 8 deletions config/camera_pinhole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ cam_model: Pinhole
cam_width: 1280
cam_height: 1024
scale: 0.5
cam_fx: 1293.56944
cam_fy: 1293.3155
cam_cx: 626.91359
cam_cy: 522.799224
cam_d0: -0.076160
cam_d1: 0.123001
cam_d2: -0.00113
cam_d3: 0.000251
cam_fx: 1311.89517127580
cam_fy: 1311.36488586115
cam_cx: 656.523841857393
cam_cy: 504.136322840350
cam_d0: -0.0780830982640722
cam_d1: 0.146382433670493
cam_d2: -0.00110111633050301
cam_d3: -0.00110752991013068
Loading