Skip to content

Costmap based precision controller for trajectory controller#2350

Draft
mustafab0 wants to merge 52 commits into
mainfrom
mustafa/feature/auto-emax-governor
Draft

Costmap based precision controller for trajectory controller#2350
mustafab0 wants to merge 52 commits into
mainfrom
mustafa/feature/auto-emax-governor

Conversation

@mustafab0
Copy link
Copy Markdown
Contributor

Auto e_max governor for precision-nav

Adds a CostmapPrecisionGovernor module that watches the global costmap and continuously sets the precision path follower's corridor half-width (e_max) from how cluttered the area around the robot is. Open spaces relax the corridor so the robot can drive faster; tight cluttered areas tighten it so the robot slows and tracks the path closely.

What's in this PR

  • dimos/navigation/costmap_precision_governor/module.py — the new governor module.
    Subscribes to global_costmap: In[OccupancyGrid] and odom: In[PoseStamped],
    and publishes e_max: Out[Float32].

The governor is purely costmap-driven and does not read the characterization artifact. Plant-aware speed scaling stays in PrecisionPathFollowerTask.

How to test

On the robot:

dimos run unitree-go2-precision-nav

Open rerun, click a goal, watch the robot drive. In open space e_max should be near the high end (~0.9 m); near walls or in clutter it should drop toward the low end (~0.05 m). The robot visibly slows in tight areas and speeds up in open ones along the same path.

Where to change the artifact path

The characterization artifact path is set in dimos/robot/unitree/go2/blueprints/basic/unitree_go2_coordinator.py on the precision_follower TaskConfig (around line 100). Default points at data/characterization/go2/go2_config_hw_concrete_2026-05-28_normal.json.

To override per run without editing the file:

dimos run unitree-go2-precision-nav \
  -o coordinator.tasks[2].params.artifact_path=<full/path/to.json>

tasks[2] is the precision_follower (after vel_go2 and path_follower in the task list).

Config knobs (governor)

All live on CostmapPrecisionGovernorConfig and are overridable per-run with -o costmap_precision_governor.<knob>=...:

knob default meaning
d_near 0.30 m clearance at or below this → e_max_low
d_far 1.50 m clearance at or above this → e_max_high
e_max_low 0.10 m corridor in tight spaces
e_max_high 0.90 m corridor in open spaces
hysteresis_delta 0.02 m minimum change before republishing
lookahead_m 0.50 m sample point projected along robot heading (0 = at robot)
obstacle_threshold 50 costmap cell value treated as occupied

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant