A ROS-based NDT localizer with multi-sensor state estimation
This repo is a ROS based multi-sensor robot localisation. An NDT localizer is loosely-coupled with wheeled odometry and IMU for continuous global localization within a pre-build point cloud map.
Prerequisites
You will need the robot_localization package. The configurations of multi-sensors of our robot are detailed in cfgs/global_ekf.yaml and cfgs/local_ekf.yaml.
Localization in a pointcloud map(pcd)
A demo video on CourtYard dataset:
How to use
Build in your ros workspace
clone this repo in your ros workspace/src/, and then catkin_make (or catkin build):
cd catkin_ws/src/
git clone https://github.com/FAIRSpace-AdMaLL/ndt_localizer.git
cd ..
catkin_make
Get a pcd map
You need a point cloud map (pcd format) for localization. You can get a HD point cloud map from any HD map supplier, or you can make one yourself (of course, the accuracy will not be as high as the HD map).
Previously-generated maps can be downloaded from here The court_yard data (rosbags) for mapping or testing ndt_localizer can be downloaded here: Court Yard Data The beach data (rosbags and previously-generated maps) can be downloaded here: Beach Data
Setup configuration
Config map loader
Move your map pcd file (.pcd) to the map folder inside this project (ndt_localizer/map), change the pcd_path in map_loader.launch to you pcd path, for example:
If your Lidar data is sparse (like VLP-16), you need to config smaller leaf_size in launch/points_downsample.launch like 1.0. If your lidar point cloud is dense (VLP-32, Hesai Pander40P, HDL-64 ect.), keep leaf_size as 2.0.
You can config NDT params in ndt_localizer.launch. Tha main params of NDT algorithm is:
">
<argname="trans_epsilon"default="0.05"doc="The maximum difference between two consecutive transformations in order to consider convergence" />
<argname="step_size"default="0.1"doc="The newton line search maximum step length" />
<argname="resolution"default="3.0"doc="The ND voxel grid resolution" />
<argname="max_iterations"default="50"doc="The number of iterations required to calculate alignment" />
<argname="converged_param_transform_probability"default="3.0"doc="" />
These default params work nice with 64 and 32 lidar.
Run the localizer
Once you get your pcd map and configuration ready, run the localizer with:
cd catkin_ws
source devel/setup.bash
roslaunch ndt_localizer ndt_localizer.launch
Wait a few seconds for the map to load, then you can see your pcd map in rviz.
Give a initial pose of current vehicle with 2D Pose Estimate in the rviz.
This operation will send a init pose to topic /initialpose. Then you will see the localization result:
Then, play the rosbag in other terminal (e.g. rosbag play --clock court_yard_wed_repeat_night_2021-03-03-19-07-18.bag).
The robot will start localization:
The final localization msg will send to /odometry/filtered/global by a multi-sensor state estimation using wheeled odometry, IMU and lidar localisation.
The localizer also publish a tf of base_link to map:
R2LIVE is a robust, real-time tightly-coupled multi-sensor fusion framework, which fuses the measurement from the LiDAR, inertial sensor, visual camera to achieve robust, accurate state estimation.
Generate Height map with Generator (OpenGL and imgui) and Construct Splat Map with generated height map using Algorithm(DPS, BFS, Gradient Descent ... etc) . At Renderer, with height map and blend map which are generated in front of this stage, render high quality terrain with OpenGL
Thank you for this very useful package. I tried to run the ndt_localizer with the court yard data but the localizer does not converge, and I get the following error below. I am quite new with ROS, and I am not sure how to establish the tf between odom to base link. Any help will be appreciated.
[ERROR] [1665524128.452658342, 1614894376.816401712]: Please publish TF odom to base_link
Yggdrasil Decision Forests (YDF) is a collection of state-of-the-art algorithms for the training, serving and interpretation of Decision Forest models. The library is developed in C++ and available in C++, CLI (command-line-interface, i.e. shell commands) and in TensorFlow under the name TensorFlow Decision Forests (TF-DF).
A real-time lidar-inertial odometry package. We strongly recommend the users read this document thoroughly and test the package with the provided dataset first.