Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Empty file modified .gitignore
100644 → 100755
Empty file.
19 changes: 15 additions & 4 deletions CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 2.8.3)
project(lvi_sam)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options(-Wno-error=deprecated-declarations)

################## 编译开关 compile switch##############
# -DIF_OFFICIAL=1: use origin official LVI-SAM code
# -DIF_OFFICIAL=0: use modified code of this repo
Expand All @@ -13,6 +17,7 @@ add_definitions(-DIF_OFFICIAL=0)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -pthread")
#set(OpenCV_DIR "/LVI-SAM/opencv-4.8.1/build/installed")

######################
### Packages
Expand All @@ -37,10 +42,10 @@ find_package(catkin REQUIRED COMPONENTS

find_package(OpenMP REQUIRED)
find_package(PCL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(OpenCV 4 REQUIRED)
find_package(Ceres REQUIRED)
find_package(GTSAM REQUIRED QUIET)
find_package(Boost REQUIRED COMPONENTS filesystem program_options system timer)
find_package(Boost REQUIRED COMPONENTS filesystem program_options system timer serialization thread)


######################
Expand Down Expand Up @@ -120,7 +125,7 @@ target_link_libraries(${PROJECT_NAME}_visual_loop ${catkin_LIBRARIES} ${PCL_LIBR

# IMU Preintegration
add_executable(${PROJECT_NAME}_imuPreintegration src/lidar_odometry/imuPreintegration.cpp)
target_link_libraries(${PROJECT_NAME}_imuPreintegration ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} gtsam Boost::timer)
target_link_libraries(${PROJECT_NAME}_imuPreintegration ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} gtsam Boost::timer Boost::serialization Boost::thread)
# Range Image Projection
add_executable(${PROJECT_NAME}_imageProjection src/lidar_odometry/imageProjection.cpp)
add_dependencies(${PROJECT_NAME}_imageProjection ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_generate_messages_cpp)
Expand All @@ -133,4 +138,10 @@ target_link_libraries(${PROJECT_NAME}_featureExtraction ${catkin_LIBRARIES} ${PC
add_executable(${PROJECT_NAME}_mapOptmization src/lidar_odometry/mapOptmization.cpp)
add_dependencies(${PROJECT_NAME}_mapOptmization ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_generate_messages_cpp)
target_compile_options(${PROJECT_NAME}_mapOptmization PRIVATE ${OpenMP_CXX_FLAGS})
target_link_libraries(${PROJECT_NAME}_mapOptmization PRIVATE ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${OpenMP_CXX_FLAGS} gtsam Boost::timer)
target_link_libraries(${PROJECT_NAME}_mapOptmization PRIVATE ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${OpenMP_CXX_FLAGS} gtsam Boost::timer Boost::serialization Boost::thread)

# Scan-to-map minimal node (LOAM-style optimizer)
add_executable(${PROJECT_NAME}_scan_to_map src/lidar_odometry/scan_to_map.cpp)
add_dependencies(${PROJECT_NAME}_scan_to_map ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_generate_messages_cpp)
target_compile_options(${PROJECT_NAME}_scan_to_map PRIVATE ${OpenMP_CXX_FLAGS})
target_link_libraries(${PROJECT_NAME}_scan_to_map PRIVATE ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${OpenMP_CXX_FLAGS} gtsam Boost::timer Boost::serialization Boost::thread)
59 changes: 59 additions & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,62 @@ Due to the special IMU (the Euler angle coordinate system is different from the
## Acknowledgement

- Origin official [LVI-SAM](https://github.com/TixiaoShan/LVI-SAM).

---

## 添加的 scan_to_map 节点 — 编译与运行说明(我已把源文件和 launch 放入仓库,但未编译)

我已将一个最小化的 LOAM-style scan-to-map 优化器(角点/面点 + LM)添加到本仓库,用于快速验证与二次开发:

- 源文件:`src/lidar_odometry/scan_to_map.cpp`
- 启动文件:`launch/kitti_scan_to_map.launch`(默认会加载 `config/KITTI_lidar.yaml` 与 `config/KITTI_camera.yaml`)

下面给出如何在本地把该文件编译进 `lvi_sam` 包的精确说明(我已在仓库中做了最小的 CMake/package 修改,但我**没有**在容器中编译):

1) CMakeLists.txt 中的可执行目标(仓库已包含以下块):

```cmake
# Scan-to-map minimal node (LOAM-style optimizer)
add_executable(${PROJECT_NAME}_scan_to_map src/lidar_odometry/scan_to_map.cpp)
add_dependencies(${PROJECT_NAME}_scan_to_map ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_generate_messages_cpp)
target_compile_options(${PROJECT_NAME}_scan_to_map PRIVATE ${OpenMP_CXX_FLAGS})
target_link_libraries(${PROJECT_NAME}_scan_to_map PRIVATE ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${OpenMP_CXX_FLAGS} gtsam Boost::timer)
```

2) `package.xml` 中需要(仓库已追加)声明的依赖示例:

```xml
<build_depend>pcl_ros</build_depend>
<run_depend>pcl_ros</run_depend>
<build_depend>ceres-solver</build_depend>
<run_depend>ceres-solver</run_depend>
```

注意:不同 ROS 发行版或 OS 上 package 名称可能稍有差异(例如在 Debian/Ubuntu 上是 `libceres-dev` 等),如果你在编译时遇到找不到包或找不到库,请按系统提示安装对应的系统/ROS 包。

3) 推荐的本地编译步骤(示例,catkin 工作区)

```bash
cd /home/what/ros_ws/LVI_ws
catkin_make
source devel/setup.bash
```

4) 运行(KITTI 示例)

```bash
rosparam set /use_sim_time true
# 在另一个终端回放 kitti bag: rosbag play /path/to/kitti.bag --clock
roslaunch LVI-SAM-Easyused kitti_scan_to_map.launch
```

5) 常见问题与排查建议

- 如果出现找不到 `lvi_sam::cloud_info` 的 topic/type,先确保 `imageProjection` 与 `featureExtraction` 节点已启动(它们负责发布 `PROJECT_NAME/lidar/feature/cloud_info`)。
- 如果链接错误提示找不到 gtsam/ceres/PCL 库,请先确认系统已安装对应开发包,例如(Ubuntu + ROS):
```bash
sudo apt install -y libceres-dev libgtsam-dev ros-${ROS_DISTRO}-pcl-ros
```
- 若编译失败且错误不明显,把 `catkin_make` 的完整输出贴给我,我可以基于错误信息给出精确修复补丁。

如果你同意我现在将继续保持“不编译”的状态,但可以帮你完成后续的本地编译或修复工作,请回复 `A`(我将执行编译并修复编译错误)。如需我撤回 `package.xml` 的依赖修改,也请说明。
Empty file modified README_CN.md
100644 → 100755
Empty file.
Empty file modified config/M2DGR_camera.yaml
100644 → 100755
Empty file.
Empty file modified config/M2DGR_lidar.yaml
100644 → 100755
Empty file.
Empty file modified config/brief_k10L6.bin
100644 → 100755
Empty file.
Empty file modified config/brief_pattern.yml
100644 → 100755
Empty file.
Empty file modified config/extrinsic_parameter_example.pdf
100644 → 100755
Empty file.
Empty file modified config/fisheye_mask_720x540.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified config/params_camera.yaml
100644 → 100755
Empty file.
Empty file modified config/params_camera_official.yaml
100644 → 100755
Empty file.
Empty file modified config/params_lidar.yaml
100644 → 100755
Empty file.
Empty file modified config/params_lidar_official.yaml
100644 → 100755
Empty file.
32 changes: 32 additions & 0 deletions config/params_lidar_tuning.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Tuning params for IMU preintegration timing and numeric safety
# Load this file with rosparam (e.g. in your launch file) to override defaults in code.

lvi_sam:
# imu_time_tolerance (seconds)
# Accept small "late" IMU samples relative to correction time. Negative means we accept IMU
# with timestamp up to |imu_time_tolerance| seconds after correction time (useful when IMU
# timestamps are slightly later than lidar/odom timestamps). Default in code: -0.002
imu_time_tolerance: -0.002

# preint_dt_floor (seconds)
# Minimum deltaT below which preintegration is considered too small to be reliable. When
# actual preintegration deltaT <= preint_dt_floor the node will avoid adding degenerate
# IMU/Between factors and use mild priors instead. Default in code: 1e-4
preint_dt_floor: 1e-4

# min_bias_sigma
# Per-component minimum standard deviation (sigma) for the bias-between factor. This avoids
# zero or near-zero sigmas which create singular information matrices for GTSAM. Default: 1e-5
min_bias_sigma: 1e-5

# Suggested tuning for priors (experiment with these if you see large jumps):
# prior_vel_sigma: standard deviation (m/s) for initial velocity prior (default in code: 1.0)
prior_vel_sigma: 1.0
# prior_bias_sigma: standard deviation for bias prior components (default in code: 1e-2)
prior_bias_sigma: 1e-2

# Usage:
# In your launch file, add:
# <rosparam command="load" file="$(find LVI-SAM-Easyused)/config/params_lidar_tuning.yaml"/>
# or run:
# rosparam load $(rospack find LVI-SAM-Easyused)/config/params_lidar_tuning.yaml
Binary file added doc/920ad1643a61547f0000adbf12073fbc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/backbag.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/gate_01.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/handheld-official.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/handheld.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/imu.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/kaist1.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/kaist2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/kitti.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/ljj.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/official-equipment.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/fig/urbannav.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/paper.pdf
100644 → 100755
Empty file.
Empty file modified docker/Dockerfile
100644 → 100755
Empty file.
Empty file modified docker/docker_start.md
100644 → 100755
Empty file.
Empty file modified docker/ros_entrypoint.sh
100644 → 100755
Empty file.
Empty file modified launch/KAIST.launch
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions launch/KITTI.launch
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
<include file="$(find lvi_sam)/launch/include/module_rviz.launch" />
<!--- SAM -->
<include file="$(find lvi_sam)/launch/include/module_sam.launch" />

<!-- scan_to_map: LOAM-style scan2map optimizer (added for KITTI runs) -->
<node name="scan_to_map" pkg="lvi_sam" type="lvi_sam_scan_to_map" output="screen">
</node>
</launch>
Empty file modified launch/M2DGR.launch
100644 → 100755
Empty file.
Empty file modified launch/UrbanNavDataset.launch
100644 → 100755
Empty file.
Empty file modified launch/backbag.launch
100644 → 100755
Empty file.
Loading