localization is used to provide real-time relative or global positioning information. This project includes the following two modules:
msf_localization
is a fusion localization module based on the ESKF framework, which can provide relative positioning information based only on IMU + wheel speed and global positioning information by fusing point cloud localization results. This module can also be extended with other sensor observations.
lidar_localization
is a point cloud localization module based on point cloud maps, using ceres for optimization and pcl for point cloud processing.
This project is developed and tested based on ros2 humble/ros1 noetic
+ python 3.8.10
.
The msf_localization
and lidar_localization
modules depend on ros2/ros1
and the dependencies defined in package.xml
.
msf_localization
depend on glog to log information
Ubuntu:
sudo apt install libgoogle-glog-dev
Follow the specified content in the official tutorial for your operating system.
You can install Python3 by following the Python installation guide for your platform. It is recommended to use version 3.8.10
or above.
-
Windows: Download and run https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe to complete the installation.
-
Ubuntu:
sudo apt-get install -y python3 python3-pip
You can create a new folder or go into your existing ros
workspace and execute the following command to clone the code into the workspace.
git clone git@gitlab.robosense.cn:super_sensor_sdk/ros2_sdk/localization.git -b main
This project supports both ros1
and ros2
ros1:
Execute the following commands in your workspace to compile and install localization
.
catkin_make
After compilation and installation, it is recommended to refresh the workspace's bash profile
to ensure everything functions properly.
source devel/setup.bash
ros2:
Execute the following commands in your workspace to compile and install localization
.
colcon build --symlink-install
After compilation and installation, it is recommended to refresh the workspace's bash profile
to ensure everything functions properly.
source install/setup.bash
ros1:
Run the fusion localization node
rosrun msf_localization msf_localization_node
Run the point cloud localization node
rosrun lidar_localization lidar_localization_node
ros2:
Run the fusion localization node
ros2 run msf_localization msf_localization_node
Run the point cloud localization node
ros2 run lidar_localization lidar_localization_node
ros2:
rviz -d msf_localization/rviz/rviz2_config.rviz
ros2:
rviz2 -d msf_localization/rviz/rviz2_config.rviz
-
msf_localization
: IMU messages, wheel speed messages, lidar localization result (optional), user-extended other sensor messages (optional) -
lidar_localization
: LiDAR point cloud messages, msf localization result
fusion localization and lidar localization default initial position is' [0,0,0] ', and the default initial pose is the identity matrix. If the user
knows the initial pose in the pointcloud map or can obtain the initial pose through external devices such as RTK, they can modify the configuration file
- fusion localization:
msf_localization/config/loc_param.yaml
:
#init pose
x_init: 2.0
y_init: 4.0
z_init: 0.0
roll_init: 0.0
pitch_init: 0.0
yaw_init: 0.0
- lidar localization:
lidar_localization/config/config.yaml
:
#init position
init_position: [2.0, 4.0, 0.0] # x, y, z
#init euler
init_euler: [0.0, 0.0, 0.0] # roll, pitch, yaw
-
Point Cloud Map
: Point cloud map PCD files generated by rs_slam mapping software or other mapping software, placed inlidar_localization/map
directory, user need to setmap_path
parameter in configuration file of lidar localization -
Example Data Path
: https://cdn.robosense.cn/AC_wiki/localization_demo.zip
Fusion localization related configuration file: msf_localization/config/loc_param.yaml
Point cloud localization related configuration file: lidar_localization/config/config.yaml