Conversation
|
ok, makes sense. I think a clean way to handle this safety mode is to add safetyModelPassive in While for most of the other cars that don't have a specific passive safety mode, it will look like: |
|
|
||
| const safety_hooks gm_passive_hooks = { | ||
| .init = gm_init, | ||
| .rx = gm_passive_rx_hook, |
There was a problem hiding this comment.
I think it's ok to just use gm_rx_hook here. As long as nooutput_tx_hook and default_fwd_hook are set, there is really no risk.
There was a problem hiding this comment.
@rbiasini, actually gm_rx_hook modifies contorls_allowed, and that goes into both health packet, and controls green LED of the panda. I thought it would be misleading to have a wrong value for that, hence copy-pasted code for determining the ignition.
|
makes sense
…On Wed, Sep 4, 2019 at 8:13 PM Vasily Tarasov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In board/safety/safety_gm_passive.h
<#266 (comment)>:
> +// The only difference from "no output" model
+// is using GM ignition hook.
+
+static void gm_passive_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
+ int bus_number = GET_BUS(to_push);
+ int addr = GET_ADDR(to_push);
+
+ if ((addr == 0x1F1) && (bus_number == 0)) {
+ bool ign = (GET_BYTE(to_push, 0) & 0x20) != 0;
+ gm_ignition_started = ign;
+ }
+}
+
+const safety_hooks gm_passive_hooks = {
+ .init = gm_init,
+ .rx = gm_passive_rx_hook,
@rbiasini <https://github.com/rbiasini>, actually gm_rx_hook modifies
contorls_allowed, and that goes into both health packet, and controls
green LED of the panda. I thought it would be misleading to have a wrong
value for that, hence copy-pasted code for determining the ignition.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#266?email_source=notifications&email_token=AEHALERPSX2MTHUJL6PRO7LQIB2PJA5CNFSM4ITNNQB2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCDWXV2A#discussion_r321058664>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEHALEU5PJYDKOEXXW5MVY3QIB2PJANCNFSM4ITNNQBQ>
.
|
|
@rbiasini So... can panda change be merged, or more changes are needed? |
|
pushed changes to openpilot as well, so that this safety model is used. Will be in next release. |
* Update to correct GAS_PEDAL in DBC Originally referenced GAS_PEDAL_2 , but that was an error. BO_ 316 GAS_PEDAL matched vehicle * Update honda_hrv_touring_2019_can_generated.dbc * Update honda_hrv_touring_2019_can.dbc
Redo of commaai/openpilot#487: adding a separate, passive version of GM safety model, to allow EONs to be used as dashcams on stock GM cars (with ASCM present), or in chffrplus passive mode.
To be used with https://github.com/vntarasov/openpilot/tree/gm-passive2, which is to be updated with a panda repo sync.