Skip to content

Wire per-sample locomotion mode classification; add CSV inspector - #33

Closed
CatYang3 wants to merge 1 commit into
mainfrom
locomotionMode_integration
Closed

Wire per-sample locomotion mode classification; add CSV inspector#33
CatYang3 wants to merge 1 commit into
mainfrom
locomotionMode_integration

Conversation

@CatYang3

Copy link
Copy Markdown
Contributor

Integrates the locomotion-mode pipeline end-to-end and adds supporting diagnostics + offline-replay tooling.

Control logic:

  • main: read classification_left/right per row and call amplitude_modulation.set_mode each sample; respect main_switch with controller reset on the falling edge; add --fast batch mode that dumps every internal intermediate to _output.csv and opens the result in the new CSV inspector.
  • WalkOnController: expose last_filtered_signal and last_gait_phase_rad; safety-gate the motor command to 0 when the filtered angle is negative.
  • AmplitudeModulation: cache per-stage values in a new AmplitudeIntermediates dataclass; retune Ascend/Descend stair-mode scale/power parameters.
  • MotorReferenceController / SogiFllFiltering / SensorPreprocessor: expose last_* attributes for offline logging of internal signals.
  • PreprocessorConfig: new VelocityInputAngle option (RAW / DRIFT_REMOVED / FILTERED); default keeps the previous behavior.
  • definitions: retune SOGI cadence bounds, initial frequency guess, LPF cutoffs, AMPLITUDE_GAIN (-6.5 -> -7), PID P gain (14 -> 8). Add main_switch column constant.

Tooling:

  • CSVPlayer: tolerate semicolon delimiters, European decimals, alternate header names, missing timestamp/velocity/main_switch/ classification columns. Returns a new PlayerStep bundle.
  • plotter: new Simulink-Data-Inspector-style csv_inspector module with linked-axis stacked subplots and per-subplot pan/zoom/pick tools. Runnable via 'python -m hip_controller.plotter'.
  • init: fall back to '0.0.0+unknown' when neither installed package metadata nor pyproject.toml is reachable.
  • Tests updated for the PlayerStep return type; new csv_inspector tests added.

Also includes a small ruff-format-driven consolidation of duplicate imports in tests/conftest.py.

Summary

Describe the main changes in this PR:


Code Quality Checklist

Before requesting review, ensure:

  • All CI/CD pipelines pass
  • Code includes docstrings and type hints
  • I added new tests where necessary
  • I ran make tree to update the README.md

Additional Notes

  • Anything else reviewers should know?
  • Attach outputs, plots, logs, or GIFs here.

Integrates the locomotion-mode pipeline end-to-end and adds supporting
diagnostics + offline-replay tooling.

Control logic:
- __main__: read classification_left/right per row and call
  amplitude_modulation.set_mode each sample; respect main_switch with
  controller reset on the falling edge; add --fast batch mode that
  dumps every internal intermediate to <input>_output.csv and opens
  the result in the new CSV inspector.
- WalkOnController: expose last_filtered_signal and last_gait_phase_rad;
  safety-gate the motor command to 0 when the filtered angle is negative.
- AmplitudeModulation: cache per-stage values in a new
  AmplitudeIntermediates dataclass; retune Ascend/Descend stair-mode
  scale/power parameters.
- MotorReferenceController / SogiFllFiltering / SensorPreprocessor:
  expose last_* attributes for offline logging of internal signals.
- PreprocessorConfig: new VelocityInputAngle option (RAW /
  DRIFT_REMOVED / FILTERED); default keeps the previous behavior.
- definitions: retune SOGI cadence bounds, initial frequency guess,
  LPF cutoffs, AMPLITUDE_GAIN (-6.5 -> -7), PID P gain (14 -> 8).
  Add main_switch column constant.

Tooling:
- CSVPlayer: tolerate semicolon delimiters, European decimals,
  alternate header names, missing timestamp/velocity/main_switch/
  classification columns. Returns a new PlayerStep bundle.
- plotter: new Simulink-Data-Inspector-style csv_inspector module
  with linked-axis stacked subplots and per-subplot pan/zoom/pick
  tools. Runnable via 'python -m hip_controller.plotter'.
- __init__: fall back to '0.0.0+unknown' when neither installed
  package metadata nor pyproject.toml is reachable.
- Tests updated for the PlayerStep return type; new csv_inspector
  tests added.

Also includes a small ruff-format-driven consolidation of duplicate
imports in tests/conftest.py.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@CatYang3 CatYang3 closed this Jun 17, 2026
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.

2 participants