Skip to content

Conversation

@sunnyhaibin
Copy link
Collaborator

@sunnyhaibin sunnyhaibin commented Apr 14, 2025

test_models failed for Yaris: https://github.com/sunnypilot/sunnypilot/actions/runs/14455511807/job/40537737850?pr=819

Reverts #93

Summary by Sourcery

Revert changes related to Toyota SecOC Longitudinal Control, removing specific handling for SecOC vehicles in safety and control modules

Bug Fixes:

  • Removed specialized SecOC longitudinal control logic that was causing test failures

Chores:

  • Deleted SecOC-specific files and removed related imports
  • Simplified Toyota safety and control logic

@sourcery-ai
Copy link

sourcery-ai bot commented Apr 14, 2025

Reviewer's Guide by Sourcery

This pull request reverts the changes related to Toyota SecOC longitudinal control due to test failures. It removes the SecOCLongCarController, associated files, and updates the safety tests and message handling to remove SecOC specific logic.

Updated class diagram for CarController

classDiagram
  class CarController {
    -params: CarControllerParams
    -last_torque: float
    -last_angle: float
    -last_steer_override: bool
    -last_standstill: bool
    -steer_rate_limiter: RateLimiter
    -accel: float
    -apply_steer_last: float
    -pcm_override: bool
    -pcm_cancel_cmd: bool
    -permit_braking: bool
    -standstill_req: bool
    -distance_button: int
    -secoc_prev_reset_counter: int
    +__init__(dbc_names: list[str], CP: CarParams, CP_SP: CarParams)
    +update(CC: CarControl, CC_SP: CarControlSP, CS: CarState, now_nanos: int) -> list[bytes]
  }

  class CarControllerBase {
    +__init__(dbc_names: list[str], CP: CarParams, CP_SP: CarParams)
  }

  CarController --|> CarControllerBase

  note for CarController "Removed inheritance from SecOCLongCarController"
Loading

File-Level Changes

Change Details Files
Reverts changes related to SecOC longitudinal control due to test failures.
  • Removes ACC_CONTROL_2 message from the list of transmitted messages for SecOC cars.
  • Removes the ACC_CONTROL_2 message from the list of forwarded messages for SecOC cars.
  • Removes the SecOCLongCarController class and its usage in CarController.
  • Removes the secoc_long.py file.
  • Removes the test_secoc_long_base.py file.
  • Removes the SECOC_LONG parameter from the create_accel_command function.
  • Removes the check for toyota_secoc when setting openpilotLongitudinalControl in interface.py.
opendbc/safety/tests/test_toyota.py
opendbc/safety/safety/safety_toyota.h
opendbc/car/toyota/carcontroller.py
opendbc/car/toyota/interface.py
opendbc/car/toyota/toyotacan.py
opendbc/sunnypilot/car/toyota/secoc_long.py
opendbc/sunnypilot/car/toyota/tests/test_secoc_long_base.py
Removes ecu_disabled parameter from test_diagnostics function.
  • Removes the ecu_disabled parameter from the test_diagnostics function in TestToyotaSafetyBase.
  • Removes the ecu_disabled parameter from the call to super().test_diagnostics in TestToyotaSecOcSafety.
opendbc/safety/tests/test_toyota.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sunnyhaibin sunnyhaibin merged commit df33c86 into master-new Apr 14, 2025
7 checks passed
@sunnyhaibin sunnyhaibin deleted the revert-93-sp-module branch April 14, 2025 21:04
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