Skip to content

G1 raytracing navigation stack (unitree-g1-nav-simple)#2327

Open
jeff-hykin wants to merge 29 commits into
mainfrom
jeff/feat/g1_raycast
Open

G1 raytracing navigation stack (unitree-g1-nav-simple)#2327
jeff-hykin wants to merge 29 commits into
mainfrom
jeff/feat/g1_raycast

Conversation

@jeff-hykin
Copy link
Copy Markdown
Member

@jeff-hykin jeff-hykin commented Jun 2, 2026

How to Test

on g1:

dimos run unitree-g1-nav-simple

Contributor License Agreement

  • I have read and approved the CLA.

jeff-hykin added 24 commits May 27, 2026 00:00
Renames uintree_g1_primitive_no_nav.py to unitree_g1_primitive_no_nav.py,
adds unitree_g1_onboard.py at the corrected path, updates the variable
name and all importers, and regenerates the all_blueprints.py registry
keys (drops the typo'd uintree-g1-primitive-no-nav entry, adds the
correctly-spelled unitree-g1-onboard and unitree-g1-primitive-no-nav).
Prefix with _ so it is not registered as a standalone runnable
blueprint; it stays a shared composition for nav-simple and
nav-onboard. unitree-g1-nav-simple is the only new blueprint.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 2, 2026

Greptile Summary

This PR introduces a new unitree-g1-nav-simple navigation blueprint for the Unitree G1 robot, wiring FastLio2 LiDAR odometry through a Nix-built Rust raytracing voxel mapper into a CostMapper and A* replanner. It also refactors shared G1 primitives into reusable sub-blueprints (_unitree_g1_onboard, unitree_g1_vis), renames a misspelled blueprint file, propagates the costmap frame_id through path planning, and adds hardware deadzone compensation for small velocity commands.

  • Rust voxel mapper: Build system switched from cargo build --release to nix build path:.; a new flake.nix/flake.lock locks the Nix derivation, though the lock currently records a dev-branch ref that will become stale after merge.
  • Blueprint refactor: _unitree_g1_onboard centralises FastLio2 + DDS SDK + vis wiring; unitree_g1_nav_onboard reuses it but retains a now-redundant global_map_fastlio remapping that is already baked into the sub-blueprint.
  • Deadzone compensation: _boost_above_deadzone clips sub-threshold (but non-zero) velocity commands to the minimum effective magnitude, preventing the G1 from stalling on small planner corrections.

Confidence Score: 5/5

Safe to merge; the core data pipeline from LiDAR through raytracing to A* planning wires correctly and runtime behaviour is unaffected by the two findings.

The new navigation stack is cleanly decomposed and the frame_id propagation and deadzone compensation look correct. The two findings are both housekeeping items: a redundant remapping entry and a flake.lock that records a dev-branch ref which will need regenerating after merge. Neither affects runtime behaviour of the nav stack itself.

The flake.lock dev-branch ref and the duplicated global_map_fastlio remapping in unitree_g1_nav_onboard.py are the only items worth a second look before or shortly after merging.

Important Files Changed

Filename Overview
dimos/robot/unitree/g1/blueprints/navigation/unitree_g1_nav_simple.py New G1 raytracing navigation blueprint composing onboard sensors, RayTracingVoxelMap, CostMapper, A* replanner, and MovementManager; unitree_g1_vis added explicitly despite being included in _unitree_g1_onboard
dimos/robot/unitree/g1/blueprints/primitive/unitree_g1_onboard.py New shared sub-blueprint composing FastLio2, G1HighLevelDdsSdk, and unitree_g1_vis; remaps global_map → global_map_fastlio but this remapping is then duplicated in unitree_g1_nav_onboard
dimos/mapping/ray_tracing/rust/flake.lock New Nix flake lock file; dimos-repo input locks to rev on dev branch jeff/feat/g1_raycast which will become stale after merge if branch is deleted
dimos/robot/unitree/g1/blueprints/navigation/unitree_g1_nav_onboard.py Refactored to use _unitree_g1_onboard sub-blueprint, but the (FastLio2, global_map, global_map_fastlio) remapping is now duplicated — baked into _unitree_g1_onboard and repeated in the outer .remappings() call
dimos/navigation/replanning_a_star/module.py Adds odometry: In[Odometry] port and ReplanningAStarPlannerConfig with robot_width/rotation_diameter overrides; both odom and odometry subscribed unconditionally
dimos/robot/unitree/g1/effectors/high_level/dds_sdk.py Adds deadzone compensation for linear and angular velocity commands; _boost_above_deadzone correctly passes through zero and values above the deadzone threshold
dimos/mapping/costmapper.py Extracts costmap_to_rerun helper with a pre-built color LUT, adds initial_safe_radius_meters config; LUT indices 0-101 are all explicitly initialized
dimos/mapping/ray_tracing/module.py Switches build from cargo to nix build path:.; executable path updated from target/release to result/bin to match Nix output symlink
dimos/msgs/nav_msgs/Odometry.py Adds to_pose_stamped() conversion method used by the new odometry port in ReplanningAStarPlanner
dimos/navigation/replanning_a_star/min_cost_astar.py Replaces hardcoded world frame_id with costmap.frame_id in all path waypoints and Path objects

Sequence Diagram

sequenceDiagram
    participant FastLio2
    participant RayTracingVoxelMap
    participant CostMapper
    participant ReplanningAStarPlanner
    participant MovementManager
    participant G1HighLevelDdsSdk

    FastLio2->>RayTracingVoxelMap: lidar (PointCloud2)
    FastLio2->>RayTracingVoxelMap: odometry (Odometry)
    FastLio2->>ReplanningAStarPlanner: odometry (Odometry)
    Note over FastLio2: global_map remapped to global_map_fastlio (suppressed)
    RayTracingVoxelMap->>CostMapper: global_map (PointCloud2)
    CostMapper->>ReplanningAStarPlanner: global_costmap (OccupancyGrid)
    ReplanningAStarPlanner->>MovementManager: nav_cmd_vel (Twist)
    MovementManager->>G1HighLevelDdsSdk: move (Twist)
    Note over G1HighLevelDdsSdk: _boost_above_deadzone applied to vx, vy, vyaw
Loading

Reviews (5): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Comment thread dimos/mapping/costmapper.py
Comment thread dimos/navigation/replanning_a_star/module.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

config: ReplanningAStarPlannerConfig

odom: In[PoseStamped] # TODO: Use TF.
odometry: In[Odometry]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit confusing to have both odom and odometry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants