How to convert GLIM saved map into FAST-LOCALIZATION format (poses mapping problem)
Hello, thank you for your great work on GLIM!
I am trying to convert a GLIM saved map into the FAST-LOCALIZATION format, which integrates with HBA. The required format is:
map/
├── pcd/
│ ├── 0.pcd
│ └── 1.pcd
└── pose.json (each line: tx ty tz qw qx qy qz)
GLIM dump format
My GLIM dump is saved in this structure:
.
├── 000000
│ ├── covs_compact.bin
│ ├── data.txt
│ ├── imu_rate.txt
│ └── points_compact.bin
├── 000001
│ ├── covs_compact.bin
│ ├── data.txt
│ ├── imu_rate.txt
│ └── points_compact.bin
├── 000002
│ ├── covs_compact.bin
│ ├── data.txt
│ ├── imu_rate.txt
│ └── points_compact.bin
├── config/...
├── graph.bin
├── graph.txt
├── odom_imu.txt
├── odom_lidar.txt
├── traj_imu.txt
├── traj_lidar.txt
└── values.bin
Each submap has points_compact.bin (point cloud) and data.txt, which includes:
T_world_origin:
0.894062 -0.445217 -0.0493368 -0.0447592
0.446668 0.894397 0.0232727 0.0388152
0.0337653 -0.0428444 0.998511 0.519722
0 0 0 1
My approach
-
I wrote a script to:
- Convert each
points_compact.bininto a.pcdfile. - Extract the pose from
data.txt(T_world_origin), convert it to quaternion(qw qx qy qz), and save it intopose.jsonastx ty tz qw qx qy qz.
- Convert each
-
Example of my generated
pose.json:
-0.031940 -0.000772 -0.018251 0.997738 -0.022076 -0.063127 -0.006820
...
- Then I visualized the transformed PCDs using Open3D.
Problem
When I open the map in GLIM offline viewer (offline_viewer with optimization enabled), the map looks nice and globally consistent.
But when I visualize my converted format, the map is distorted after applying the poses from data.txt.
Questions
-
What is the correct source of ** submap poses** used for the transformation of submap .bin for export?
-
data.txt→ contains rawT_world_origin -
traj_lidar.txt→ contains timestamped LiDAR poses (timestamp tx ty tz qx qy qz qw)
-
-
How can I correctly map submap directories (
000000/,000001/, …) to the poses? -
Is there already a recommended method in GLIM to export submap poses after global optimization (the same poses that
offline_viewerapplies internally)?
Summary
- My script works, but produces a distorted map.
- GLIM offline viewer shows a correct optimized map.
- I need guidance on how to extract the optimized T_world_submap values for each submap so that my exported format matches what the viewer shows.
Thank you very much!