Quadruped-PyMPC icon indicating copy to clipboard operation
Quadruped-PyMPC copied to clipboard

Fix touchdown detection logic in SwingTrajectoryController

Open amlansahoo07 opened this issue 7 months ago • 1 comments

The check_touch_down_condition() method in SwingTrajectoryController had incorrect logic that detected lift-off events instead of touchdown events. This caused step frequency optimization to fail with slow gaits, particularly crawl patterns at 0.5 Hz step frequency.

Implemented a robust three-stage touchdown detection algorithm:

  • Fixed core logic to detect touchdown instead of lift-off
  • Added proper state management with automatic reset
  • Implemented stability delay to prevent premature optimization triggers

This fix enables proper step frequency optimization for crawl gaits and improves the reliability of gait adaptation across all locomotion patterns.

amlansahoo07 avatar Jul 10 '25 14:07 amlansahoo07

Thanks Amlan. I'm planning to review this PR this week.

giulioturrisi avatar Jul 15 '25 12:07 giulioturrisi