Skip to content

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

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

G1 raytracing navigation stack (unitree-g1-nav-simple)#2327
jeff-hykin wants to merge 31 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

Introduces the unitree-g1-nav-simple navigation stack for the Unitree G1, wiring FastLio2 → RayTracingVoxelMap → CostMapper → ReplanningAStarPlanner with a nix-built Rust ray-tracer. The PR also extracts reusable sub-blueprints (_unitree_g1_onboard, unitree_g1_vis, unitree_g1_primitive_no_nav), adds deadzone compensation to the G1 DDS SDK, and propagates OccupancyGrid.frame_id throughout the A* path builder.

  • New nav stack (unitree_g1_nav_simple): composes onboard sensors, ray-tracing voxel map, height-cost occupancy grid, and replanning A* planner with G1-specific clearance and rotation parameters.
  • Blueprint refactor: _unitree_g1_onboard, unitree_g1_vis, and unitree_g1_primitive_no_nav are extracted into standalone files; the nav_onboard blueprint is updated to reuse them.
  • DDS SDK deadzone boost: sub-threshold linear/angular velocity commands are snapped to a configurable minimum so the G1's motor deadzone doesn't silently drop small motion commands.

Confidence Score: 5/5

Safe to merge; the new nav stack is additive and existing stacks are unaffected.

All changes are either new files (new blueprint, sub-blueprints, Rust nix build) or targeted fixes (frame_id propagation, deadzone compensation). No existing navigation paths are broken. The one asymmetry in the FastLio2 TF publish only manifests when frame_id_prefix is explicitly set, which no current blueprint does.

dimos/hardware/sensors/lidar/fastlio2/module.py for the frame_id_prefix asymmetry introduced by the TF refactor.

Important Files Changed

Filename Overview
dimos/robot/unitree/g1/blueprints/navigation/unitree_g1_nav_simple.py New runnable blueprint composing _unitree_g1_onboard + RayTracingVoxelMap + CostMapper + ReplanningAStarPlanner + MovementManager + unitree_g1_vis; unitree_g1_vis is also already included inside _unitree_g1_onboard (flagged in prior thread).
dimos/robot/unitree/g1/blueprints/primitive/unitree_g1_onboard.py New sub-blueprint bundling FastLio2 (with global_map remapping), G1HighLevelDdsSdk, and unitree_g1_vis; cleanly extracted from unitree_g1_nav_onboard.
dimos/mapping/costmapper.py Adds initial_safe_radius_meters config, costmap_to_rerun helper, and numpy-based disc clearing; the disc is intentionally anchored to world origin (confirmed by developer) and the LUT covers the full 0–101 index range correctly.
dimos/hardware/sensors/lidar/fastlio2/module.py _on_odom_for_tf now reads frame_id through the Module property (applies frame_id_prefix) but child_frame_id directly from config (no prefix), creating a TF asymmetry when frame_id_prefix is set.
dimos/navigation/replanning_a_star/module.py Adds Odometry port and ReplanningAStarPlannerConfig with robot_width/robot_rotation_diameter overrides; both odom and odometry are subscribed unconditionally (flagged in prior thread).
dimos/navigation/replanning_a_star/min_cost_astar.py All hardcoded "world" frame_id strings in path construction replaced with costmap.frame_id; clean and consistent change.
dimos/robot/unitree/g1/effectors/high_level/dds_sdk.py Adds deadzone compensation via _boost_above_deadzone; configurable min_effective_linear/angular_velocity defaults (0.05 m/s, 0.2 rad/s) applied in move().
dimos/mapping/ray_tracing/module.py Switches build from cargo to nix and executable path from target/release to result/bin; aligns with FastLio2 pattern.
dimos/msgs/nav_msgs/Odometry.py Adds to_pose_stamped() conversion helper preserving ts, frame_id, position, and orientation.
dimos/robot/all_blueprints.py Registers unitree-g1-nav-simple and corrects the typo in unitree-g1-primitive-no-nav import path.

Sequence Diagram

sequenceDiagram
    participant HW as G1 Hardware
    participant FL as FastLio2
    participant RT as RayTracingVoxelMap
    participant CM as CostMapper
    participant RA as ReplanningAStarPlanner
    participant MM as MovementManager
    participant DDS as G1HighLevelDdsSdk

    HW->>FL: LiDAR scan
    FL->>RT: lidar (PointCloud2)
    FL->>RT: odometry (Odometry)
    RT->>CM: global_map (PointCloud2)
    CM->>RA: global_costmap (OccupancyGrid)
    FL->>RA: odometry → to_pose_stamped()
    RA->>MM: nav_cmd_vel (Twist)
    MM->>DDS: cmd_vel (Twist)
    DDS->>DDS: _boost_above_deadzone()
    DDS->>HW: motion command
Loading

Reviews (6): Last reviewed commit: "Merge branch 'jeff/feat/g1_raycast' of g..." | 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

Comment thread dimos/navigation/replanning_a_star/module.py
paul-nechifor
paul-nechifor previously approved these changes Jun 2, 2026
@jeff-hykin jeff-hykin enabled auto-merge (squash) June 7, 2026 05:23
@jeff-hykin
Copy link
Copy Markdown
Member Author

@paul-nechifor (sorry needs re-approval after merge with main)

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