Modifying relocalization and mapping for using mid360 lidar - #3393
Modifying relocalization and mapping for using mid360 lidar#3393sharnam2015 wants to merge 18 commits into
Conversation
…the normal lidar stream
…n and smaller things
…n directly through the CLI as a config and load the modified voxel size for the map when chosen, default is go2 voxel size
Greptile SummaryThe PR adds Mid-360 voxel presets, Point-LIO replay support, relocalization metrics, native-build adjustments, and a Go2/Mid-360 visualization blueprint.
Confidence Score: 3/5The PR is not yet safe to merge because Point-LIO replay leaves incompatible root frames and relocalization accepts transforms using a fitness metric inconsistent with its yaw-sensitive gate. Point-LIO clouds are labeled Files Needing Attention: dimos/robot/unitree/go2/connection.py, dimos/mapping/relocalization/relocalize.py, dimos/mapping/relocalization/module.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
REC[Point-LIO recording] --> DEC[Replay decoder]
DEC --> CLOUD[Cloud labeled odom]
REC --> ODOM[Point-LIO odometry]
ODOM --> BASE[world to base_link TF]
REC --> STF[Recorded odom to mid360_link TF]
CLOUD --> MAP[Voxel mapping and relocalization]
STF --> TF[TF consumers]
BASE --> TF
CLOUD -. missing world to odom bridge .-> TF
MAP --> ICP[Wall candidate scoring]
ICP --> FULL[Full-cloud final ICP]
FULL --> GATE[Fitness threshold gate]
Reviews (2): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile |
| tf = Transform.from_pose( | ||
| cloud.frame_id, | ||
| PoseStamped( | ||
| ts=cloud.ts, | ||
| frame_id="odom", | ||
| position=pose.position, | ||
| orientation=pose.orientation, | ||
| ), | ||
| ) | ||
| out = cloud.transform(tf) | ||
| out.frame_id = "odom" |
There was a problem hiding this comment.
Point-LIO replay loses its root frame
When replaying a dataset recorded with Point-LIO rooted at world, this decoder applies the world-relative observation pose but unconditionally labels the resulting cloud as odom. The replay then publishes world→base_link and recorded world→mid360_link transforms without a world→odom bridge, causing TF-based consumers and visualization to place the lidar in a disconnected or incorrect frame relative to the robot.
Knowledge Base Used: Launching Robots via the CLI and Hardware Vendor Integration
| @@ -231,4 +234,4 @@ def fine_fitness(T: np.ndarray) -> float: | |||
| tukey, | |||
| _reg.ICPConvergenceCriteria(max_iteration=50), | |||
| ) | |||
| return np.asarray(final.transformation), best_fit | |||
| return np.asarray(final.transformation), float(final.fitness), float(final.inlier_rmse) | |||
There was a problem hiding this comment.
Full-cloud fitness breaks pose gating
In indoor scenes where floor or ceiling points dominate, returning final.fitness lets horizontal-plane matches inflate the value even when a candidate's walls have the wrong yaw. RelocalizationModule compares this new metric against the unchanged threshold calibrated for wall-only fitness, causing incorrect world-to-map transforms to be accepted or valid transforms to be rejected.
| unitree_mid360_basic = ( | ||
| autoconnect( | ||
| _with_vis, | ||
| GO2Connection.blueprint(), | ||
| ).global_config(n_workers=4, robot_model="unitree_go2") | ||
| # we temporarily disabled sensor timestamps | ||
| # and are derriving all timestmaps upon reception | ||
| # this is because image webrtc stream doesn't have timestamps, | ||
| # so it's difficult to corelate the streams otherwise | ||
| # | ||
| # .configurators(ClockSyncConfigurator()) |
There was a problem hiding this comment.
Mid-360 preset remains disabled
Launching unitree-mid360-basic leaves GlobalConfig.lidar_config at default because this blueprint never selects mid360. Mappers that inherit the global preset therefore resolve to 5 cm voxels instead of the new 3 cm Mid-360 setting, so choosing the Mid-360 blueprint does not activate the advertised denser mapping behavior.
Knowledge Base Used:
…voxel size so that there is no conflict potential
… rerank distance and fine voxel
…fine voxel and rerank distrance
…g on the lidar mounting angle on robot
…, lidar mounting angle
…ar-config mid360 setting by using the seperate mid360 blueprint
…on changes for pointlio odometry
Contribution path
A PR for some of the main things needed for incorporating a mid360 lidar instead of the go2 default.
PLEASE NOTE: Tests still need to be added and the code needs to be cleaned up, formatted
Video link of the relocalization with the 0.03 voxel size (...screen2) attached below
mid360_relocalization_screen_2.mp4
youtube link - https://youtu.be/cWDTVGVOkOM
Video link of the relocalization with all the changes for the mid360 0.03 voxel size, fine voxel adjustment and redist change - https://youtu.be/X0Blmo3WqXE
video link for all the changes with the 0.03 voxel size and pointlio odometry
https://youtu.be/XYFap8_wz-k
Problem
Modifying relocalization specifically for mid360-
Solution
Changed files to first accept the pointlio stream
Then changed voxel size for the more dense mid360 point cloud.
Added a config option for using mid360 settings as a user directly during map building, relocalization and more
Added some evaluation metrics that show the fitness, ICP RMSE values , log them
The changed fine_voxels and redist values for the relocalization for mid360
For mid360 also incorporated pointlio odometry instead of legged odometry in go2
How to Test
Running the relocalization with the mid360 config
cd ~/dimos
source .venv/bin/activate
export LD_LIBRARY_PATH=$HOME/.local/lib:${LD_LIBRARY_PATH:-}
dimos --replay --replay-db=data/recording_mid360_1stofficetrial
--lidar-config mid360
--viewer rerun
run unitree-go2-mid360-relocalization
--map-file=data/recording_mid360_1stofficetrial3
Command to build premap
dimos map global data/recording_mid360_1stofficetrial --export --lidar-config mid360
Logging fitness, and other values after first relocalization
dimos log -f | rg 'relocalize first event|relocalize:'
Using a more refined voxel size while keeping the number of voxels the same - imporves accuracy while just linearly increasing compute a little for mapping , while the ICP registration compute is still the same as number of voxels are the same

Sensor Specs comparison mid360 with go2

Test script and other testing still needs to be added (Ongoing)
FUTURE and NEXT STEPS
all tuned for the mid360
AI assistance
Used cursor
Checklist