feat: multi-level stair climbing demo with landing zone constraint - #8
Merged
Conversation
added 7 commits
March 17, 2026 20:35
- Add landingZonePolygons + useLandingZoneCheck parameters (parameters.h/cpp) - Step expansion validates foot containment in terrain patches - demo_stairs.cpp: 22-step L-shaped stair path with terrain patches - demo_visualize.py: terrain patch rendering (blue dashed polygons) - assets/stairs.gif: multi-level stair climbing visualization - README: all 3 demos documented (flat/obstacle/stairs) Key fix: terrain patches must use CCW vertex ordering (setClockwiseOrder(false)) for isConvexPolygonContained to work correctly with isPoint2DOnSideOfLine2D.
- 9 large (0.80×0.70m), sparse, rotated terrain patches - All 22 footsteps verified contained in patches (22/22 ✓) - Patches overlap to form continuous stepping-stone path - demo_visualize.py: distinct color per patch, white borders - New demo_stairs.cpp: 'shoot first, aim later' approach 1. Unconstrained planner → 22 steps 2. Design patches around path 3. Verify containment 4. Export for visualization - assets/stairs.gif: 348 KB animated GIF
- New start (0.05, 0.02) → goal (1.05, -0.55), diagonal path - 13 random patches: each unique hw (0.18-0.42), hh (0.15-0.42), angle - LCG random with seed 500 produces 19-step valid path - No 'aim first': planner searches patches from scratch - Patches overlap for A* to traverse end-to-end - assets/stairs.gif: 478 KB
- Heuclid v2.4: intersection area CW/CCW winding fix - isFootAreaContainedInTerrain: 70% overlap threshold - MaxStepLength=40cm, MaxStepWidth=35cm for sparse steps - 6 random patches (0.8-2.0m), unique size/rotation each - 11-step natural A* path through patches - New diagonal path: start(0.1,0.1) → goal(1.2,-0.5) - stairs.gif: 120 KB
- New demo design: large flat base plane (height=0) + 4~6 elevated stones (5~15cm) - 3.5m distance, 11 steps reaching goal - Stones evenly distributed along path, random heights - Visualization: base=grey dashed, stones=blue gradient by height - Height annotations on stones, step labels with white background - body path hidden in stairs mode (cleaner view) - terrain_heights.csv for height metadata - FollowBodyPath disabled for better long-distance search - GIF: 82KB, 12 frames
- README: all 3 demos in single row (table layout) - Added description table with step counts - Updated stairs to 'Stepping Stones' terminology - Chinese README: same layout, clean old sections - Stairs GIF updated in assets/
Mr-tooth
added a commit
that referenced
this pull request
Mar 20, 2026
feat: multi-level stair climbing demo with landing zone constraint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces overlapping-patch approach with base plane + stepping stones design. Also fixes pre-existing segfault and obstacle collision bugs.
Demo Layout
All 3 demos in single-row table with compact styling.
Bug Fixes
Segfault (issue #6):
parameters::debugFlagdefaulted totrue, causingplotExpansion()to crash in matplotlibcpp on every A* expansion. Fixed by defaulting tofalse.Obstacle collision:
isAnyVertexOfFootInsideStairRegiononly rejected steps where foot vertices were inside the obstacle — partial overlaps were missed. Replaced withisFootPolygonCollidedWithPolygon(full polygon-polygon intersection viaisConvexPolygonIntersect).demo_stairs.cpp (new)
FollowBodyPath=falsefor long-distance searchdemo_obstacle.cpp (rewritten)
isFootPolygonCollidedWithPolygonfor robust collisiondemo_visualize.py
load_body_path()with graceful fallback when body_path.csv is missingAll GIFs regenerated
flat.gif(238KB, 25 steps) — body path followingobstacle.gif(251KB, 8 steps) — collision avoidancestairs.gif(241KB, 11 steps) — stepping stones