Skip to content

Commit d4185a5

Browse files
authored
docs: car porting (#36590)
* checkpoint * door states, notes * updates * not worth it yet * wordsmith * more * more reverse engineering script content * Revise stationary ignition-only test steps Updated the steps for stationary ignition-only tests to include closing the driver's door and fastening the seatbelt before pressing the accelerator and brake pedals. * fix numbering
1 parent 1262fca commit d4185a5

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# CarState signals
2+
3+
## Required for basic lateral control
4+
5+
* `brakePressed`
6+
* `cruiseState`
7+
* `doorOpen`
8+
* `espDisabled`
9+
* `gasPressed`
10+
* `gearShifter`
11+
* `leftBlinker` / `rightBlinker`
12+
* `seatbeltUnlatched`
13+
* `standstill`
14+
* `steeringAngleDeg`
15+
* `steeringPressed`
16+
* `steeringTorque`
17+
* `steerFaultPermanent`
18+
* `steerFaultTemporary`
19+
* `vCruise`
20+
* `wheelSpeeds.[fl|fr|rl|rr]`: Speed of each of the car's four wheels, in m/s. The car's CAN bus often broadcasts the
21+
speed in kph, so the helper function `parse_wheel_speeds` performs this conversion by default.
22+
23+
## Recommended / Required for openpilot longitudinal control
24+
25+
* `accFaulted`
26+
* `espActive`
27+
* `parkingBrake`
28+
29+
## Application Dependent
30+
31+
* `blockPcmEnable`
32+
* `buttonEnable`
33+
* `brakeHoldActive`
34+
* `carFaultedNonCritical`
35+
* `invalidLkasSetting`
36+
* `lowSpeedAlert`
37+
* `regenBraking`
38+
* `steeringAngleOffsetDeg`
39+
* `steeringDisengage`
40+
* `steeringTorqueEps`
41+
* `stockLkas`
42+
* `vCruiseCluster`
43+
* `vEgoCluster`
44+
* `vehicleSensorsInvalid`
45+
46+
## Automatically populated
47+
48+
* `buttonEvents`
49+
50+
These values are populated automatically by `parse_wheel_speeds`:
51+
52+
* `aEgo`: Acceleration of the ego vehicle, Kalman filtered derivative of `vEgo`.
53+
* `vEgo`: Speed of the ego vehicle, Kalman filtered from `vEgoRaw`.
54+
* `vEgoRaw`: Speed of the ego vehicle, based on the average of all four wheel speeds, unfiltered.
55+
56+
## Optional
57+
58+
* `brake`
59+
* `charging`
60+
* `fuelGauge`
61+
* `leftBlindspot` / `rightBlindspot`
62+
* `steeringRateDeg`
63+
* `stockAeb`
64+
* `stockFcw`
65+
* `yawRate`
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Stimulus-Response Tests
2+
3+
These are example test drives that can help identify the CAN bus messaging necessary for ADAS control. Each scripted
4+
test should be done in a separate route (ignition cycle). These tests are a guide, not necessarily exhaustive.
5+
6+
While testing, constant power to the comma device is highly recommended, using [comma power](https://comma.ai/shop/comma-power) if
7+
necessary to make sure all test activity is fully captured and for ease of uploading. If constant power isn't
8+
available, keep the ignition on for at least one minute after your test to make sure power loss doesn't result
9+
in loss of the last minute of testing data.
10+
11+
## Stationary ignition-only tests, part 1
12+
13+
1. Ignition on, but don't start engine, remain in Park
14+
2. Open and close each door in a defined order: driver, passenger, rear left, rear right
15+
3. Re-enter the vehicle, close the driver's door, and fasten the driver's seatbelt
16+
4. Slowly press and release the accelerator pedal 3 times
17+
5. Slowly press and release the brake pedal 3 times
18+
6. Hold the brake and move the gearshift to reverse, then neutral, then drive, then sport/eco/etc if applicable
19+
7. Return to Park, ignition off
20+
21+
Brake-pressed information may show up in several messages and signals, both as on/off states and as a percentage or
22+
pressure. It may reflect a switch on the driver's brake pedal, or a pressure-threshold state, or signals to turn on
23+
the rear brake lights. Start by identifying all the potential signals, and confirm while driving with ACC later.
24+
25+
Locate signals for all four door states if possible, but some cars only expose the driver's door state on the ADAS bus.
26+
Driver/passenger door signals may or may not change positions for LHD vs RHD cars. For cars where only the driver's
27+
door signal is available, the same signal may follow the driver.
28+
29+
## Stationary ignition-only tests, part 2
30+
31+
1. Ignition on, but don't start engine, remain in Park
32+
2. Press each ACC button in a defined order: main switch on/off, set, resume, cancel, accel, decel, gap adjust
33+
3. Set the left turn signal for about five seconds
34+
4. Operate the left turn signal one time in its touch-to-pass mode
35+
5. Set the right turn signal for about five seconds
36+
6. Operate the right turn signal one time in its touch-to-pass mode
37+
7. Set the hazard / emergency indicator switch for about five seconds
38+
8. Ignition off
39+
40+
Your vehicle may have a momentary-press main ACC switch or a physical toggle that remains set. Actual ACC engagement
41+
isn't necessary for purposes of detecting the ACC button presses.
42+
43+
## Steering angle and steering torque tests
44+
45+
Power steering should be available. On ICE cars, engine RPM may be present.
46+
47+
1. Ignition on, start engine if applicable, remain in Park
48+
2. Rotate the steering wheel as follows, with a few seconds pause between each step
49+
* Start as close to exact center as possible
50+
* Turn to 45 degrees right and hold
51+
* Turn to 90 degrees right and hold
52+
* Turn to 180 degrees right and hold
53+
* Turn to full lock right and hold, with firm pressure against lock
54+
* Release the wheel and allow it to bounce back slightly from lock
55+
* Turn to 180 degrees left and hold
56+
* Return to center and release
57+
3. Ignition off
58+
59+
Performing the full test to the right, followed by an abbreviated test to the left, helps give additional confirmation
60+
of signal scale, and sign/direction for both the steering wheel angle and driver input torque signals.
61+
62+
## Low speed / parking lot driving tests
63+
64+
Before this test, drive to a place like an empty parking lot where you are free to drive in a series of curves.
65+
66+
1. Ignition on, start engine if applicable, prepare to drive
67+
2. Slowly (10-20mph at most) drive a figure-8 if possible, or at least one sharp left and one sharp right.
68+
3. Come to a complete stop
69+
4. When and where safe, drive in reverse for a short distance (10-15 feet)
70+
5. Park the car in a safe place, ignition off
71+
72+
## High speed / highway driving tests
73+
74+
Select a place and time where you can safely set cruise control at normal travel speeds with little interference from
75+
traffic ahead, and safely test the response of your factory lane guidance system.
76+
77+
1. Ignition on, start engine if applicable, prepare to drive
78+
2. When safely able, engage adaptive cruise control below 50 mph
79+
3. When safely able, use the ACC buttons to accelerate to 50mph, then 55mph, then 60mph
80+
4. Disengage adaptive cruise
81+
5. When safely able, allow your factory lane guidance to prevent lane departures, 2-3 times on both the left and right
82+
83+
The series of setpoints can be adjusted to local traffic regulations, and of course metric units. The specific cruise
84+
setpoints are useful for locating the ACC HUD signals later, and confirming their precise scaling. When the car reaches
85+
and holds the setpoint, that can also provide additional confirmation of wheel speed scaling.

0 commit comments

Comments
 (0)