-
for velodyne or other pointcloud users.
-
you dont need livox-related packages!!
| Component | Version |
|---|---|
| OS | Ubuntu 22.04 |
| ROS | Humble Hawksbill |
| Eigen3 | 3.4.0 |
| Lidar | Velodyne-VLP16 |
| IMU | Xsens MTi-610 |
pcl
Eigen
sophus
gtsam(optional for LC)
sudo apt install libpcap-dev libpcl* pcl-tools ros-humble-pcl-ros -y
sudo apt install ros-humble-gtsam -yros-humble-gtsam-dbgsym(optional)
eigen
pkg-config --modversion eigen3gtsam (select one)
gtsam_version
pkg-config --modversion gtsamcd
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout 1.22.10
mkdir build && cd build
cmake .. -DSOPHUS_USE_BASIC_LOGGING=ON
make
sudo make installros2 launch fastlio2 lio_launch.py
ros2 launch pgo pgo_launch.py
ros2 service call /pgo/save_maps interface/srv/SaveMaps "{file_path: 'your_save_dir', save_patches: true}"
- Launch the Relocalization Node
ros2 launch localizer localizer_launch.py
ros2 bag play your_bag_file // optional- Set Initial Relocalization Values
ros2 service call /localizer/relocalize interface/srv/Relocalize "{"pcd_path": "your_map.pcd", "x": 0.0, "y": 0.0, "z": 0.0, "yaw": 0.0, "pitch": 0.0, "roll": 0.0}"- Check Relocalization Result
ros2 service call /localizer/relocalize_check interface/srv/IsValid "{"code": 0}"- Launch the Map Optimization Node
ros2 launch hba hba_launch.py- Call the Optimization Service
ros2 service call /hba/refine_map interface/srv/RefineMap "{"maps_path": "your maps directory"}"Note: If you plan to call the optimization service, you must set save_patches to true when saving the map.
This code mainly uses timerCB to trigger the main function at a fixed frequency.
In ROS2, timer, subscriber, and service callbacks are executed in the same thread. On machines with limited performance, this can cause blocking issues.
To improve performance, it is recommended to use multithreading so that time-consuming callbacks (e.g., timerCB) run in a separate thread.