Skip to content

Conversation

@JMPZ11
Copy link
Contributor

@JMPZ11 JMPZ11 commented Jun 8, 2022

In preparation for non-ASCM based Silverado, Suburban and Tahoe support, safety model options
have been added to enable forwarding between the camera and powertrain bus (with appropriate
message filtering), and to optionally allow the use of stock ACC.
(Note that these changes should apply to any GM vehicle with ACC + LKAS that doesn't use an ASCM)

The friction brake command is permitted for tx on powertrain, and included in ACC command fwd filter.

Regen paddle updated to set brake_pressed instead of directly unsetting controls_allowed.

Contains WIP LKAS timing enforcement wrapped in an #ifdef for easy removal -
may be necessary until the OP side EPS fix is completed.

TODO:

  • REMINDER: carcontroller.py should omit ASCM keepalive messages if they can be forwarded from the cam.
  • Testing of new scenarios and messages must be implemented
  • [ ] Work on preventing remaining EPS faults in OP This will be done in OP
  • [ ] Determine why steering limit code is being triggered and resolve if possible This will be a separate issue
  • Regression testing
  • Determine if any changes are necessary in safety code for self-contained ACC modules vs stock camera-based VOACC
  • Determine if changes are required if the front camera isn't connected (nothing to forward)
  • [ ] Reminder: Current port doesn't monitor the status of the brake controller on the chassis bus - might be good to add Not in scope for this PR
  • [ ] Reminder: Investigate brake controller status for cars that use the PT bus for friction brakes Not in scope for this PR
  • Resolve any MISRA violations introduced

JMPZ11 added 3 commits June 8, 2022 15:58
 * Complete rewrite / simplification
 * Add param for cam harness (default is OBD2)
   - Forward btw 0 and 2
   - Filter LKAS and optionally ACC from cam
 * Add param for stock ACC
   - Allows ACC on PT bus when set, not otherwise
   - Allows ACC from cam when set, not otherwise
 * Add temporary WIP EPS timing workaround in ifdef
@adeebshihadeh adeebshihadeh added the car safety vehicle-specific safety code label Jun 8, 2022
@adeebshihadeh adeebshihadeh changed the title [WIP] GM Safety - Add support for GM cam harness & stock ACC GM: Add support for cam harness & stock ACC Jun 15, 2022
@JMPZ11 JMPZ11 mentioned this pull request Jun 16, 2022
4 tasks
@JMPZ11
Copy link
Contributor Author

JMPZ11 commented Jun 20, 2022

@sshane is helping to update the tests, otherwise I think the main code is ready for review - I'm removing this from draft status

@JMPZ11 JMPZ11 marked this pull request as ready for review June 20, 2022 06:39
JMPZ11 added a commit to opgm/openpilot that referenced this pull request Jun 21, 2022
@sshane
Copy link
Contributor

sshane commented Aug 11, 2022

  • Remove resume safety

@sshane sshane requested a review from adeebshihadeh August 12, 2022 08:04
@adeebshihadeh adeebshihadeh merged commit 5e0dde7 into commaai:master Aug 12, 2022
@sshane sshane deleted the gm-cam-harness branch August 12, 2022 22:57
mlocoteta pushed a commit to mlocoteta/panda that referenced this pull request Apr 29, 2023
* Allow brake TX on PT bus

* Initial Panda GM cam harness support
 * Complete rewrite / simplification
 * Add param for cam harness (default is OBD2)
   - Forward btw 0 and 2
   - Filter LKAS and optionally ACC from cam
 * Add param for stock ACC
   - Allows ACC on PT bus when set, not otherwise
   - Allows ACC from cam when set, not otherwise
 * Add temporary WIP EPS timing workaround in ifdef

* Remove keepalive; regen == braking

* Fix MISRA violations

* EPS timing opt-in by param

* Minor clean up

* remove timing code for readability

fix and formatting

* we only need to send one message if cam harness and stock long

* Simplify params

* Removed dup brake msg

* revised params, split 3-ways

* add test

* clean up a bit, no need to send ACC yet

like this

* split out button enable and pcm enable into seperate tests

* some formatting

some formatting

* GM CAM uses PCM cruise for controls_allowed

* fix gas safety tests

* misra

* fix static analysis

comment

* fix brake pressed

* Add OP VOACC override stock cam

* Add VOACC safetyparam to init.py

* Revert "Add VOACC safetyparam to init.py"

This reverts commit 2e46f87.

* Revert "Add OP VOACC override stock cam"

This reverts commit a4b096c.

* better comments

* better comments

better comments

fix

* move non-base msg definitions to subclass

* various comments

* TODO: add button safety

* add button safety

* use new pcm_cruise_check

* revert regen braking change

* only cancel button allowed

* Apply suggestions from code review

* Update board/safety/safety_gm.h

Co-authored-by: Adeeb Shihadeh <[email protected]>

* fix suggestion

* Fix tests

* Revert "Fix tests"

This reverts commit 5005779.

* this is a much simpler fix, do full fix in another PR

* tx button safety

Co-authored-by: Shane Smiskol <[email protected]>
Co-authored-by: Adeeb Shihadeh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car safety vehicle-specific safety code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants