volkswagen: fix brake pressure normalization and add EPB parking brak…#3167
volkswagen: fix brake pressure normalization and add EPB parking brak…#3167Dragoadri wants to merge 1 commit intocommaai:masterfrom
Conversation
…e check
The brake pressure signal ESP_Bremsdruck has a DBC offset of -30, which
can produce negative values before the first CAN message is received.
Clamp to zero to ensure ret.brake stays in the expected 0.0-1.0 range.
For parking brake, include EPB_01.EPB_Status in addition to the existing
KBI_Handbremse check, so cars with electronic parking brake (common on
MQB platform) correctly report parking brake state. On cars without EPB,
the signal defaults to 0 ("offen") and has no effect.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Thanks for contributing to opendbc! 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
- include a route or your device' dongle ID if relevant
Car behavior reportReplays driving segments through this PR and compares the behavior to master. Testing 130 segments for: VOLKSWAGEN_ARTEON_MK1, VOLKSWAGEN_ATLAS_MK1, VOLKSWAGEN_CRAFTER_MK2, VOLKSWAGEN_GOLF_MK7, VOLKSWAGEN_JETTA_MK7, VOLKSWAGEN_PASSAT_MK8, VOLKSWAGEN_PASSAT_NMS, VOLKSWAGEN_POLO_MK6, VOLKSWAGEN_TAOS_MK1, VOLKSWAGEN_TIGUAN_MK2, VOLKSWAGEN_TOURAN_MK2, VOLKSWAGEN_TRANSPORTER_T61, VOLKSWAGEN_TROC_MK1 Show changes |
|
I don't see how this functionally fixes anything beside the EPB check, that is useful, and keep in mind that PRs for two separate unrelated fixes should be made separately. |
Description
Two FIXMEs in the VW MQB carstate:
ret.brake (MQB): ESP_Bremsdruck has offset=-30 in the DBC, which can produce negative values before the first CAN message. Added max(0, ...) clamp. The /250.0 normalization was already correct (maps Bar pressure to 0.0–1.0 as expected by CarState).
ret.parkingBrake (MQB): Added EPB check via EPB_01.EPB_Status == 1 (brake closed). EPB_01 is defined in both MQB and MQBEvo DBCs. On cars without EPB the signal defaults to 0 ("offen"), so no regression.
ret.brake (PQ): The /250.0 was already correct (BR5_Bremsdruck has offset=0, range [0, 250] Bar). Removed the FIXME comment.
Verification
Verified against DBC signal definitions in vw_mqb_2010.dbc and vw_pq35.dbc.
Validation
Dongle ID: N/A — no hardware available
Route: N/A — changes verified against DBC signal definitions (ESP_Bremsdruck offset=-30, EPB_01.EPB_Status values 0=offen, 1=closed, 2=actuating, 3=error)