Skip to content

feat: multi-level stair climbing demo with landing zone constraint - #8

Merged
Mr-tooth merged 7 commits into
mainfrom
feature/stair-demo
Mar 17, 2026
Merged

feat: multi-level stair climbing demo with landing zone constraint#8
Mr-tooth merged 7 commits into
mainfrom
feature/stair-demo

Conversation

@Mr-tooth

@Mr-tooth Mr-tooth commented Mar 17, 2026

Copy link
Copy Markdown
Member

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::debugFlag defaulted to true, causing plotExpansion() to crash in matplotlibcpp on every A* expansion. Fixed by defaulting to false.

Obstacle collision: isAnyVertexOfFootInsideStairRegion only rejected steps where foot vertices were inside the obstacle — partial overlaps were missed. Replaced with isFootPolygonCollidedWithPolygon (full polygon-polygon intersection via isConvexPolygonIntersect).

demo_stairs.cpp (new)

  • Base plane (h=0) + 5 stepping stones (5–15cm random height)
  • 3.5m distance, 11 steps
  • FollowBodyPath=false for long-distance search

demo_obstacle.cpp (rewritten)

  • No body path guidance — pure A* collision avoidance
  • 8 steps, clear detour around obstacle
  • Uses isFootPolygonCollidedWithPolygon for robust collision

demo_visualize.py

  • Compact layout (tight margins, larger fonts)
  • load_body_path() with graceful fallback when body_path.csv is missing
  • Stone colors: blue gradient by height, with annotations
  • Body path hidden when not available
  • 3 reference-height legend entries for stairs mode

All GIFs regenerated

  • flat.gif (238KB, 25 steps) — body path following
  • obstacle.gif (251KB, 8 steps) — collision avoidance
  • stairs.gif (241KB, 11 steps) — stepping stones

Mr-tooth 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
Mr-tooth merged commit a788b3f into main Mar 17, 2026
4 checks passed
Mr-tooth added a commit that referenced this pull request Mar 20, 2026
feat: multi-level stair climbing demo with landing zone constraint
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