Home Learning Paths ECU Lab Assessments Interview Preparation Arena Pricing Log In Sign Up

ADAS Calibration Scope

ADAS Calibration TypeParametersValidation Criterion
Camera intrinsicFocal length, principal point, lens distortion coefficientsRMS reprojection error < 0.5 px
Camera extrinsicRotation matrix (3×3) + translation vector (3×1) relative to vehicle reference3D point projection error < 0.5 px RMS
Radar bore-sightAzimuth offset, elevation offsetCorner reflector centroid = 0° ± 0.1°
AEB thresholdTTC_threshold (time-to-collision), deceleration ramp parametersISO 22737 intervention timing across 20/30/40 km/h scenarios
Sensor fusion weightsCamera confidence vs. radar confidence weighting in object associationObject track stability and false-positive rate on test track

Camera Extrinsic Calibration Procedure

Pythoncamera_extrinsic_cal.py
import cv2, numpy as np, canape_com as canape

# Camera extrinsic calibration using checkerboard target
# Board: 9x6 inner corners, 100mm squares

BOARD_SIZE = (9, 6)
SQUARE_SIZE_MM = 100.0

# 3D coordinates of checkerboard corners in world frame
obj_pts = np.zeros((BOARD_SIZE[0]*BOARD_SIZE[1], 3), np.float32)
obj_pts[:, :2] = np.mgrid[0:BOARD_SIZE[0], 0:BOARD_SIZE[1]].T.reshape(-1, 2)
obj_pts *= SQUARE_SIZE_MM

# Capture images at 5 board positions (known distances: 5m, 10m, 15m, 20m, 25m)
all_obj_pts, all_img_pts = [], []
for i, distance_m in enumerate([5.0, 10.0, 15.0, 20.0, 25.0]):
    # Retrieve image from ADAS ECU via XCP (MEASUREMENT: camera_raw_image_ptr)
    img = capture_image_from_adas_ecu()
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    ret, corners = cv2.findChessboardCorners(gray, BOARD_SIZE)
    if ret:
        all_obj_pts.append(obj_pts)
        all_img_pts.append(corners)

# Load camera intrinsic matrix (factory-calibrated)
K = np.load("camera_intrinsic_K.npy")
dist_coeffs = np.load("camera_dist_coeffs.npy")

# Solve for extrinsic rotation + translation
_, rvec, tvec = cv2.solvePnP(
    np.vstack(all_obj_pts), np.vstack(all_img_pts), K, dist_coeffs)

R, _ = cv2.Rodrigues(rvec)
print(f"Rotation matrix R:\n{R}")
print(f"Translation vector t: {tvec.T} mm")

# Validate: compute RMS reprojection error
projected, _ = cv2.projectPoints(np.vstack(all_obj_pts), rvec, tvec, K, dist_coeffs)
rms_error = np.sqrt(np.mean((np.vstack(all_img_pts) - projected)**2))
print(f"RMS reprojection error: {rms_error:.3f} px", "PASS" if rms_error < 0.5 else "FAIL")

# Write extrinsic parameters to ADAS ECU via XCP
device = canape.OpenDevice("ECU_ADAS")
for i in range(3):
    for j in range(3):
        device.SetValue(f"camera_R_{i}{j}", float(R[i,j]))
for i in range(3):
    device.SetValue(f"camera_t_{i}", float(tvec[i,0]))
device.CopyCalPage(src=0, dst=1)

AEB Threshold Calibration

Test ScenarioClosing SpeedISO 22737 RequirementCalibration Parameter
Vehicle target, crossing20 km/hWarning at 1.4s TTC, brake at 0.9s TTCTTC_warning_threshold, TTC_brake_threshold
Vehicle target, following30 km/hSame TTC thresholdsSame parameters
Vehicle target, cut-in40 km/hMax 1.0s TTC toleranceTTC_brake_threshold + urgency_gain
Pedestrian, crossing20 km/hWarning at 1.6s TTCpedestrian_TTC_threshold
False positive: parked vehicleN/AZero false activationsstatic_object_reject_threshold
Pythonaeb_threshold_cal.py
# AEB threshold calibration with ISO 22737 validation
import canape_com as canape, time

device = canape.OpenDevice("ECU_ADAS")
device.Connect()

results = []
for closing_speed_kmh in [20.0, 30.0, 40.0]:
    # Set scenario parameters in dyno controller
    setup_aeb_scenario(closing_speed_kmh)

    # Sweep TTC_brake_threshold
    for ttc in [0.7, 0.8, 0.9, 1.0, 1.1]:
        device.SetValue("TTC_brake_threshold", ttc)
        time.sleep(1.0)

        # Run scenario, measure actual intervention TTC
        run_aeb_scenario()
        actual_ttc = device.GetMeasurement("aeb_intervention_TTC_s")
        print(f"Speed={closing_speed_kmh} km/h, "
              f"threshold={ttc:.1f}s → actual TTC={actual_ttc:.2f}s")
        results.append((closing_speed_kmh, ttc, actual_ttc))

# Select threshold meeting ISO 22737 at all speeds
optimal_ttc = max(ttc for speed, ttc, actual in results
                  if actual >= 0.9 and actual <= 1.4)
device.SetValue("TTC_brake_threshold", optimal_ttc)
device.CopyCalPage(src=0, dst=1)
print(f"Final TTC_brake_threshold = {optimal_ttc:.1f}s")

Radar Antenna Bore-Sight Calibration

Pythonradar_boresight_cal.py
# Radar bore-sight calibration: align antenna to vehicle longitudinal axis
import canape_com as canape, time

device = canape.OpenDevice("ECU_ADAS")
device.Connect()

# Position corner reflector at 10m, 0° azimuth (directly ahead)
print("Place corner reflector at 10m straight ahead, on flat surface")
input("Press Enter when ready...")

# Read raw azimuth offset from radar ECU
# azimuth_raw = measured angle to reflector before calibration correction
time.sleep(2.0)  # stabilise
readings = [device.GetMeasurement("radar_azimuth_raw_deg") for _ in range(10)]
raw_azimuth = sum(readings) / len(readings)  # average 10 samples
print(f"Raw azimuth to straight-ahead target: {raw_azimuth:.3f} deg")

# The raw offset IS the bore-sight correction to apply
# Write negated value as calibration offset
cal_offset = -raw_azimuth
device.SetValue("radar_azimuth_cal_offset_deg", cal_offset)
device.CopyCalPage(src=0, dst=1)

# Validate: corrected azimuth should be 0 ± 0.1°
time.sleep(1.0)
readings_after = [device.GetMeasurement("radar_azimuth_corrected_deg") for _ in range(10)]
corrected = sum(readings_after) / len(readings_after)
print(f"Corrected azimuth: {corrected:.3f} deg", "PASS" if abs(corrected) < 0.1 else "FAIL")

Summary

ADAS calibration differs from powertrain calibration in that targets are geometric rather than thermodynamic. Camera extrinsic calibration uses RMS reprojection error as the pass/fail criterion; radar bore-sight uses reflector centroid angle. AEB threshold calibration requires scenario-based testing across multiple closing speeds with ISO 22737 compliance verification. All three calibration types write results as CHARACTERISTICs via XCP — the toolchain is identical to powertrain calibration.

🔬 Deep Dive — Core Concepts Expanded

This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.

Key principles to reinforce:

  • Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
  • Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
  • Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.

🏭 How This Topic Appears in Production Projects

  • Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
  • Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
  • Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.

⚠️ Common Mistakes and How to Avoid Them

  1. Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
  2. Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
  3. Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
  4. Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.

📊 Industry Note

Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.

← PreviousAutomated Calibration & OptimizationNext →Hands-On: End-to-End Calibration Campaign