openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

add_pid_unit_tests

Open WilliamBonilla62 opened this issue 8 months ago • 2 comments

Purpose

Add unit tests for the PIDController class to improve code coverage and prevent regressions.

Summary

This PR adds 10 automated pytest unit tests for the PIDController class, ensuring its core functionalities are validated:

  • Initialization (scalar and list parameters)
  • Reset behavior
  • Basic update step
  • Override mode
  • Freeze integrator mode
  • Control output clipping
  • Error integral property
  • Feedforward gain
  • Speed interpolation behavior

Verification

  • All tests pass locally with pytest. image

Command used for testing:

pytest common/tests/test_pid.py

WilliamBonilla62 avatar Apr 28 '25 13:04 WilliamBonilla62

This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity.

github-actions[bot] avatar May 08 '25 02:05 github-actions[bot]

@maxime-desroches could you review this PR, please?

WilliamBonilla62 avatar May 08 '25 03:05 WilliamBonilla62

This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity.

github-actions[bot] avatar May 18 '25 02:05 github-actions[bot]

This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes.

github-actions[bot] avatar May 21 '25 02:05 github-actions[bot]