Branch: Feat/ivan/m20 Optimized the adaptation of simple_nav for M20#2807
Branch: Feat/ivan/m20 Optimized the adaptation of simple_nav for M20#2807MeloLong wants to merge 2 commits into
Conversation
Greptile SummaryThis PR adds an M20-focused simple navigation path. The main changes are:
Confidence Score: 2/5The changed M20 navigation path and native map-save build need fixes before merging.
controllers.py, m20_simple_nav.py, map_save/cpp/main.cpp, terrain_analysis/result Important Files Changed
Reviews (1): Last reviewed commit: "修改 测试" | Re-trigger Greptile |
| if global_config.robot_model == "m20": | ||
| self._min_angular_velocity = 0.6 |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
| #include <limits> | ||
| #include <mutex> | ||
| #include <string> | ||
| #include <vector> |
There was a problem hiding this comment.
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.
| #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 | |||
There was a problem hiding this comment.
(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.
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_bridgedimos run m20-simple-nav