EKF-based LiDAR-Inertial Map matching Localization
Note This code is still undergoing stabilization, but it is currently usable.
- CUDA based ICP
- Localization evaluation on public dataset
- System Architecture
- Dependency
- How to use
- EKF Localization
- PCM Matching
- Parameter Settings
- Test record file
ekf_localization
: 24-DOF EKF-based localizationpcm_matching
: Point cloud Map Matching
localization/
├─ ekf_localization/
├─ localization_interface/
├─ pcm_matching/
└─ README.md
- for Ubuntu 20.04 (noetic)
sudo apt install ros-noetic-jsk-rviz-plugins ros-noetic-ros-numpy ros-noetic-nmea-msgs ros-noetic-gps-common ros-noetic-can-msgs ros-noetic-derived-object-msgs
- other libraries
sudo apt install net-tools libpugixml-dev libgeographic-dev rospack-tools libeigen3-dev liblapack-dev pkg-config swig cmake
sudo apt-get install ros-noetic-mrt-cmake-modules
- Georgia Tech Smoothing and Mapping library
sudo add-apt-repository ppa:borglab/gtsam-release-4.0
sudo apt install libgtsam-dev libgtsam-unstable-dev
Clone code as workspace
git clone https://github.com/jaeyoungjo99/ELiMaLoc.git
cd ELiMaLoc
catkin_make
config/localization.ini
config/calibration.ini
resources/map/pcm
- ekf_localization
- Set location parameters. Modify ref lat, lon, hgt if necessary
- Set /use_sim_time to true when using bag data
- pcm_matching
- Set location parameters. Modify map_path if necessary
- Set /use_sim_time to true when using bag data
location
: location name in launch file
bag
: true or false for using bag data
- Launch at once
roslaunch launch/ELiMaLoc.launch location:=hanyang bag:=true
- Launch each
rviz -d $(rospack find ekf_localization)/rviz/ekf_localization_rviz.rviz
roslaunch ekf_localization ekf_localization.launch
roslaunch pcm_matching pcm_matching.launch
See CallbackInitialPose function for more details.
- Change Views Type to
TopDownOrtho
- Click the green
2D Pose Estimate
on the top panel and drag in the desired direction - Check the terminal for the purple
[Init Pose] Publish Init ...
message - If
[Init Pose] ICP failed!
appears, click again to reinitialize
- 24-DOF EKF for IMU gravity estimation and bias removal (refer to FAST-LIO equations)
- Supports various state updates (PCM, GPS, NavSatFix, CAN)
- Supports ZUPT through vehicle stop detection
- Input
- IMU data sensor_msgs/Imu
- Update
- PCM estimated position nav_msgs/Odometry
- PCM estimated initial position nav_msgs/Odometry
- NavSatFix nav_msgs/NavSatFix
- CAN
- Basic CAN geometry_msgs::TwistStamped
- Output
- Estimated position nav_msgs/Odometry
- Point cloud Deskewing
- Voxel Hashing-based map structuring and nearest point search
- Supports various ICP methods (P2P, GICP, VGICP, AVGICP)
- Supports initial position setting via Rviz click (/init_pose)
- Detailed description: PCM Matching README.md
- Input
- Estimated position nav_msgs/Odometry
- Point cloud sensor_msgs/PointCloud2
- Output
- Estimated position nav_msgs/Odometry (Position, Covariance)
- PCM visualization sensor_msgs/PointCloud2
- Provides key functions and structures for localization algorithms
- Functions related to Lie Algebra, structures related to EKF State
/config/localization.ini
- Sensor settings and basic coordinate system settings
lidar_type
: Type of LiDAR to use (velodyne, ouster)lidar_scan_time_end
: 1 if LiDAR time is 0.0 for the last point, otherwise 0lidar_time_delay
: LiDAR delay (sec)lidar_topic_name
: LiDAR topic name (sensor_msgs/PointCloud2)can_topic_name
: CAN topic name (geometry_msgs/TwistStamped)imu_topic_name
: IMU topic name (sensor_msgs/Imu)navsatfix_topic_name
: NavSatFix topic name (sensor_msgs/NavSatFix)projection_mode
: Coordinate system projection method (Cartesian, UTM)
- EKF algorithm settings
- Debug output
debug_print
: Whether to output debug input datadebug_imu_print
: Whether to output IMU debug
- IMU settings
imu_gravity
: Initial value of gravitational accelerationimu_estimate_gravity
: Whether to estimate gravitational accelerationuse_zupt
: Whether to use ZUPTuse_complementary_filter
: Whether to use Complementary Filter (forced in BESTPOS mode)
- GPS settings
gps_type
: GPS type (0: INSPVAX, 1: BESTPOS and BESTVEL, 2: NavSatFix)gnss_uncertainy_max_m
: Maximum cov limit for GPS input
- Sensor usage
use_gps
: Use GPS updateuse_imu
: Use IMU prediction (if not used, CA model prediction using ROS Time)use_can
: Use CAN speed updateuse_pcm_matching
: Use PCM matching
- CAN settings
can_vel_scale_factor
: CAN speed scale factor
- Initial state and uncertainty
ekf_init_x/y/z_m
: Initial positionekf_init_roll/pitch/yaw_deg
: Initial attitudeekf_state_uncertainty_*
: State uncertainty settingsekf_imu_uncertainty_*
: IMU sensor uncertainty settingsekf_imu_bias_cov_*
: IMU bias uncertainty settingsekf_gnss_min_cov_*
: Minimum GPS uncertainty settingsekf_can_meas_uncertainty_*
: CAN measurement uncertainty settings
- Debug output
- PCM matching settings
- Debug output
debug_print
: Whether to output debug
- Map settings
pcm_voxel_size
: Voxel size (m) (recommended 0.5 ~ 2.0)pcm_voxel_max_point
: Maximum points in a voxel (search speed slows if too large for P2P, GICP) (recommended ~50)
- Input preprocessing
input_max_dist
: Input point cloud distance filtering (recommended ~100)input_index_sampling
: Point cloud index sampling (recommended 5 or more)input_voxel_ds_m
: Input point voxel sampling size (recommended 1.0 ~ 2.0)
- ICP settings
icp_method
: ICP method selection (0: P2P, 1: GICP, 2: VGICP, 3: AVGICP)max_iteration
: Maximum ICP iterationsmax_search_dist
: Maximum search distance for correspondences (m) (recommended ~5.0)lm_lambda
: Levenburg lambda value (recommended ~0.5)icp_termination_threshold_m
: ICP termination translation+angle threshold (recommended ~0.02)min_overlap_ratio
: Minimum overlap ratio with map (0 ~ 1.0)max_fitness_score
: Maximum fitness score considered as ICP success (recommended ~0.5)gicp_cov_search_dist
: Search range for cov calculation around target points in GICP (recommended 0.5 ~ 1.0)
- Radar settings
use_radar_cov
: Whether to use radar cov (0: do not use radar cov)doppler_trans_lambda
: 0.0 geometric, 1.0 doppler (applies only when use_radar_cov is 1)range_variance_m
: Radar distance uncertaintyazimuth_variance_deg
: Radar horizontal resolution uncertaintyelevation_variance_deg
: Radar vertical resolution uncertainty
- Debug output
Hanyang University - Google Drive
- init_x: 3.11
- init_y: 2.60
- init_z: -0.4
- init_yaw: 150.13
hanyang_gps_imu_velodyne
├─ 37.238551_126.772530_0.000000_kcity_1203_filtered_02.pcd
├─ hanyang_loop.7z (.bag file)
└─ calibration.ini
K City - Google Drive
- init_x: 52.56
- init_y: 70.09
- init_z: 6.32
- init_yaw: 62.17
kcity_gps_imu_velodyne
├─ 37.558200_127.044500_66.000000_hanyang_02m.pcd
├─ kcity_loop.7z (.bag file)
└─ calibration.ini
- EKF State Estimation: FAST-LIO2 Xu, Wei, et al. (HKU MARS Lab)
- ICP Framework: KISS-ICP Vizzo, Ignacio, et al. (PRBonn Lab)
- ICP Methodology: FAST GICP Koide, Kenji, et al. (Tokyo Institute of Technology)
- Deskewing and Utility Functions: LIO-SAM Shan, Tixiao, et al. (Harbin Institute of Technology)
- Lie Algebra Functions: Sophus Strasdat et al.
- 2024/11/19: Initial version (Jaeyoung Jo wodud3743@gmail.com)
- 2024/12/05: ini modification (Jaeyoung Jo wodud3743@gmail.com)
- 2024/12/11: Final modification (Jaeyoung Jo wodud3743@gmail.com)
- 2024/12/18: Remove private dependency (Jaeyoung Jo wodud3743@gmail.com)
- 2024/12/19: Add private test record file (Jaeyoung Jo wodud3743@gmail.com)