Skip to content

Branch: Feat/ivan/m20 Optimized the adaptation of simple_nav for M20#2807

Open
MeloLong wants to merge 2 commits into
dimensionalOS:feat/ivan/m20from
MeloLong:feat/ivan/m20
Open

Branch: Feat/ivan/m20 Optimized the adaptation of simple_nav for M20#2807
MeloLong wants to merge 2 commits into
dimensionalOS:feat/ivan/m20from
MeloLong:feat/ivan/m20

Conversation

@MeloLong

@MeloLong MeloLong commented Jul 8, 2026

Copy link
Copy Markdown
  1. Costmap Optimization

(1) Introduced local ground height estimation to suppress the influence of elevated structures on costmap generation.

A local ground height is first estimated. If a grid cell only contains points that are significantly higher than the estimated ground, those points are treated as ceiling or elevated structures and ignored, instead of being directly used to generate the traversal cost. This prevents elevated points from being mistakenly classified as ground bumps or obstacles, thereby avoiding the incorrect removal of traversable areas.

(2) Relaxed the ground continuity constraint to improve robustness under sparse point cloud observations.

The original method required a grid cell and all four of its neighboring cells (front, back, left, and right) to have valid observations before slope and traversability costs could be computed reliably. Under sparse point clouds or local ground gaps, this strict requirement caused many valid ground cells to be marked as unknown. We therefore relaxed the criterion from complete neighborhood observation to a sufficient number of valid neighboring observations, reducing the spread of unknown regions caused by sparse measurements and improving the completeness of traversable areas.

  1. Trajectory Controller Optimization

Resolved the M20 velocity command response issue by enforcing the robot's minimum velocity response thresholds in the simple_nav trajectory planner. The minimum command limits are:

Linear velocity (x): ≥ 0.2 m/s

Linear velocity (y): ≥ 0.3 m/s

Angular velocity (yaw): ≥ 0.6 rad/s

When linear and angular motions are commanded simultaneously: yaw ≥ 0.2 rad/s

How to run:

Tips: m20 is a IP of m20 robot, please replace it.

DIMOS_ZENOH_CONNECT=tcp/m20_ip python -m dimos.robot.deeprobotics.m20.zenoh_lcm_bridge
dimos run m20-simple-nav

@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds an M20-focused simple navigation path. The main changes are:

  • New M20 simple-nav blueprint wiring SLAM points, cost mapping, A* replanning, and movement control.
  • Costmap settings for overhead filtering and sparse point-cloud gradients.
  • M20-specific yaw command thresholds in the replanning controller.
  • New native point-cloud map-save wrapper and C++ accumulator.
  • Blueprint, connection, flake, ignore-file, and local artifact updates.

Confidence Score: 2/5

The changed M20 navigation path and native map-save build need fixes before merging.

  • The M20 yaw floor can turn every non-zero correction into a fixed yaw command.
  • The sparse-gradient setting can mark weakly observed cells as known terrain.
  • The new C++ map-save target is missing a required standard-library include.
  • The committed result link depends on one machine's Nix store.

controllers.py, m20_simple_nav.py, map_save/cpp/main.cpp, terrain_analysis/result

Important Files Changed

Filename Overview
dimos/mapping/pointclouds/occupancy.py Adds configurable sparse-gradient handling and overhead-only filtering for height-based occupancy costs.
dimos/navigation/replanning_a_star/controllers.py Adds an M20 yaw minimum that can override the controller's proportional angular output.
dimos/robot/deeprobotics/m20/nav/m20_simple_nav.py Introduces the M20 simple-nav stack and opts into relaxed sparse-gradient costmap behavior.
dimos/robot/deeprobotics/m20/nav/map_save/cpp/main.cpp Adds the native point-cloud accumulator, but the new target is missing a required include.
dimos/navigation/nav_stack/modules/terrain_analysis/result Adds a host-specific absolute Nix store symlink as a committed artifact.

Reviews (1): Last reviewed commit: "修改 测试" | Re-trigger Greptile

Comment on lines +53 to +54
if global_config.robot_model == "m20":
self._min_angular_velocity = 0.6

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.

P1 Yaw Floor Overrides Proportional Control

When robot_model is m20, the controller clips angular speed to self._speed before applying this new 0.6 minimum. The default planner speed is 0.55, so any non-zero heading error becomes ±0.6 rad/s, including tiny corrections while driving forward; the M20 path follower can zig-zag or overshoot instead of making proportional yaw corrections.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

can_climb=m20_max_step_height,
ignore_noise=0.08,
smoothing=1.5,
min_gradient_neighbors=2,

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.

P1 Sparse Cells Become Known Terrain

This M20 config accepts a gradient when only 2 of the center/N/S/E/W cells are observed. In sparse SLAM clouds, a boundary cell with mostly unknown neighbors now receives a finite cost from smoothed or zero-filled heights instead of staying unknown, so A* can prefer it as known traversable ground and route the robot through poorly observed obstacles or drop-offs.

Comment on lines +20 to +23
#include <limits>
#include <mutex>
#include <string>
#include <vector>

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.

P0 Missing Iostream Include

This new native target uses std::cout and std::endl, but the file does not include <iostream>. Building m20_pointcloud_map_save will fail as soon as this module is enabled or compiled directly.

Suggested change
#include <limits>
#include <mutex>
#include <string>
#include <vector>
#include <iostream>
#include <limits>
#include <mutex>
#include <string>
#include <vector>

@@ -0,0 +1 @@
/nix/store/nk8n7m2h8lcanp77aypjsq1pa6xs2fh0-smartnav-terrain-analysis-0.1.0 No newline at end of file

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.

P1 Host-Local Result Symlink

This commits a result symlink to an absolute /nix/store/... path. On a fresh checkout, CI runner, or another robot without that exact store path, the link is dangling and any terrain-analysis build or runtime path that expects this artifact will fail with a missing file.

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