Skip to content

Merge branches - #34

Closed
CatYang3 wants to merge 13 commits into
mainfrom
rebase
Closed

Merge branches#34
CatYang3 wants to merge 13 commits into
mainfrom
rebase

Conversation

@CatYang3

Copy link
Copy Markdown
Contributor

Summary

Describe the main changes in this PR:

  • Merge everything in branches locomotionMode_integration, config, and baseline
  • The new plotter allows visual validation of the different strategies
  • TODO: some tests don't pass, possibly due to new parameters of the filters?

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.

zg1in and others added 13 commits May 20, 2026 16:11
Co-authored-by: Copilot <copilot@github.com>
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

Copy link
Copy Markdown
Contributor Author

Note: the plot tests are skipped in CI because certain libraries from PyQt6 cannot be imported in the CI environment. I modified ci.yml so that the two tests are skipped. They can still be run on the local machine.

@CatYang3 CatYang3 closed this Jul 27, 2026
@CatYang3
CatYang3 deleted the rebase branch July 27, 2026 15:08
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.

3 participants