docs/car-porting/reverse-engineering.md
These are example test drives that can help identify the CAN bus messaging necessary for ADAS control. Each scripted test should be done in a separate route (ignition cycle). These tests are a guide, not necessarily exhaustive.
While testing, constant power to the comma device is highly recommended, using comma power if necessary to make sure all test activity is fully captured and for ease of uploading. If constant power isn't available, keep the ignition on for at least one minute after your test to make sure power loss doesn't result in loss of the last minute of testing data.
Brake-pressed information may show up in several messages and signals, both as on/off states and as a percentage or pressure. It may reflect a switch on the driver's brake pedal, or a pressure-threshold state, or signals to turn on the rear brake lights. Start by identifying all the potential signals, and confirm while driving with ACC later.
Locate signals for all four door states if possible, but some cars only expose the driver's door state on the ADAS bus. Driver/passenger door signals may or may not change positions for LHD vs RHD cars. For cars where only the driver's door signal is available, the same signal may follow the driver.
Your vehicle may have a momentary-press main ACC switch or a physical toggle that remains set. Actual ACC engagement isn't necessary for purposes of detecting the ACC button presses.
Power steering should be available. On ICE cars, engine RPM may be present.
Performing the full test to the right, followed by an abbreviated test to the left, helps give additional confirmation of signal scale, and sign/direction for both the steering wheel angle and driver input torque signals.
Before this test, drive to a place like an empty parking lot where you are free to drive in a series of curves.
Select a place and time where you can safely set cruise control at normal travel speeds with little interference from traffic ahead, and safely test the response of your factory lane guidance system.
The series of setpoints can be adjusted to local traffic regulations, and of course metric units. The specific cruise setpoints are useful for locating the ACC HUD signals later, and confirming their precise scaling. When the car reaches and holds the setpoint, that can also provide additional confirmation of wheel speed scaling.