Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Control Library StateSpace with Custom Implementation Using NumPy #33127

Closed
wants to merge 5 commits into from

Conversation

Ayushmaan06
Copy link

@Ayushmaan06 Ayushmaan06 commented Jul 29, 2024

Fixes #33092

This pull request replaces the usage of the StateSpace class from the control library with a custom implementation using pure Python and NumPy. This change is focused on simplifying dependencies and maintaining functionality in the test file openpilot/selfdrive/controls/lib/tests/test_vehicle_model.py.

Changes:

Added a custom StateSpace class
Implements initialization, state update, output calculation, and discretization using NumPy.
Updated test_vehicle_model.py to use the custom StateSpace class instead of the control library's version.
Ensured the tests for yaw rate calculation and state-space simulation remain functionally equivalent with the new implementation.

Benefits:

Reduces dependency on the control library, simplifying the dependency tree.
Maintains all existing functionality

Copy link
Contributor

github-actions bot commented Jul 29, 2024

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

@maxime-desroches
Copy link
Contributor

Thanks for the PR, but we don't want to add scipy as a dependency by removing control.
Also in the future, try to only change what you are adding, not old code. This makes PRs hard to review otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove control dependency
2 participants