Skip to content

fix: segfault + obstacle collision + regenerated demo GIFs#9

Merged
Mr-tooth merged 5 commits into
mainfrom
feature/segfault-collision-fix
Mar 17, 2026
Merged

fix: segfault + obstacle collision + regenerated demo GIFs#9
Mr-tooth merged 5 commits into
mainfrom
feature/segfault-collision-fix

Conversation

@Mr-tooth

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

Copy link
Copy Markdown
Member

Summary

Fixes segfault (issue #6), obstacle collision bug, and regenerates all demo GIFs with corrected layout.

Bug Fixes

Segfault (issue #6): parameters::debugFlag defaulted to true, crashing plotExpansion() in matplotlibcpp. Fixed to false.

Obstacle collision: Replaced isAnyVertexOfFootInsideStairRegion with isFootPolygonCollidedWithPolygon (full polygon-polygon intersection via isConvexPolygonIntersect). Fixes partial overlap misses.

GIF frame mixing: demo_visualize.py hardcoded frames_flat/ for all modes. Old frames contaminated new GIFs. Fixed to use frames_{mode}/.

Demo GIFs

Row 1
Flat (25 steps) Obstacle (23 steps)
Row 2 (full width)
Stepping Stones (11 steps)
Row 3 (full width)
Summary table

Changes

  • src/FootstepPlannerLJH/parameters.cpp:60 — debugFlag truefalse
  • src/.../ParameterBasedStepExpansion.cpp:126-128 — collision check uses isFootPolygonCollidedWithPolygon
  • demo/demo_obstacle.cpp — 23-step detour with body path guidance
  • demo/demo_visualize.py — mode-specific frame directories
  • README.md, README_CN.md — two-row layout with summary table

Mr-tooth added 5 commits March 17, 2026 22:52
**Segfault fix (issue #6)**:
- Changed parameters::debugFlag default from true to false
- plotExpansion was crashing in matplotlibcpp during every A* expansion

**Obstacle collision fix**:
- Replaced isAnyVertexOfFootInsideStairRegion with isFootPolygonCollidedWithPolygon
- Old check: only rejected steps where foot vertices were INSIDE obstacle
- New check: full polygon-polygon intersection (isConvexPolygonIntersect)
- Now correctly rejects partial overlaps

**Obstacle demo rewrite**:
- Removed body path guidance (FollowBodyPath=false)
- Pure A* collision avoidance demonstration
- Added load_body_path() with graceful fallback for missing body_path.csv

**All 3 demos regenerated**:
- flat.gif (238KB, 25 steps) - body path following
- obstacle.gif (251KB, 8 steps) - collision avoidance
- stairs.gif (241KB, 11 steps) - stepping stones
- README: compact single-row layout with updated filenames
- Obstacle demo: 23 steps, clear detour around obstacle (body path retained)
- GIF shows footsteps routing around gray obstacle box
- README: flat+obstacle in first row (50/50), stairs+table in second row
- Same layout for Chinese README
- demo_visualize.py: frames_flat/ hardcoded → frames_{mode}/
- Old frames no longer contaminate new GIFs
- README layout: flat+obstacle row / stairs full-width / summary table
- All three GIFs regenerated with clean frames
@Mr-tooth Mr-tooth merged commit 8ac592e into main Mar 17, 2026
0 of 3 checks passed
Mr-tooth pushed a commit that referenced this pull request Mar 18, 2026
Mr-tooth pushed a commit that referenced this pull request Mar 18, 2026
PR #9 changed stair collision from isAnyVertexOfFootInsideStairRegion
to isFootPolygonCollidedWithPolygon (full polygon intersection).
With ~1677 neighbors per A* expansion and no obstacle pruning,
this made block_test too slow for CI (60s timeout).

Revert stair collision to fast vertex-inside check. Foot-foot
collision remains polygon-intersection (already was before PR #9).
This restores block_test to <1s runtime.
Mr-tooth added a commit that referenced this pull request Mar 20, 2026
fix: segfault + obstacle collision + regenerated demo GIFs
Mr-tooth added a commit that referenced this pull request Mar 20, 2026
Mr-tooth added a commit that referenced this pull request Mar 20, 2026
PR #9 changed stair collision from isAnyVertexOfFootInsideStairRegion
to isFootPolygonCollidedWithPolygon (full polygon intersection).
With ~1677 neighbors per A* expansion and no obstacle pruning,
this made block_test too slow for CI (60s timeout).

Revert stair collision to fast vertex-inside check. Foot-foot
collision remains polygon-intersection (already was before PR #9).
This restores block_test to <1s runtime.
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