Resources to discover SCANeR

:arrow_left: SAMPLE_ADAS_AEB


This is a description and user manual of the sample included in the Samples Pack.



This sample demonstrates the use of ScanerAPI and other SCANeR features to connect external ADAS algorithms to a SCANeR simulation.
It may be used as the template for your own experiments.

Two simplified algorithms are used:

During the simulation, both functions can be activated independently using the keyboard. Effects can be observed on the main visual. A separate window displays the current status of ADAS the functions.


How to use

  1. Load the SCANeR configuration SAMPLE_2022_ADAS_LKA_ACC (how?).

    The required modules start automatically.


    Notice the custom modules ADAS_ACC and ADAS_LKA.

  2. Open the scenario straight_lka_acc.sce.

  3. Start the simulation.

    Set the default ACC target speed.

    Target Speed

    This is an interactive variable set in the MICE script.

  4. The Ego vehicle can be driven from keyboard arrows .

    The Target vehicle drives at a constant speed (50 km/h).

  5. Toggle LKA with F1 .

    The state of the LKA is in the Controlpad Viewer.
    The steering wheel turns towards the middle of the lane when the car diverges.

    LKA active

    This is the action of module ADAS_LKA.

  6. Toggle ACC with F2.

    ACC states are OFF20m30m40m50mOFF.

    The car reaches the target speed (set at the beginning of the simulation, 70km/h by default)
    or it stays behind the Target vehicle if it is closer than the ACC setting.

    A graph of the distance to collition, as seen by the ACC, is drawn in the Controlpad Viewer.

    The ACC is meant to work close to (20m to 100m), and at similar speed (±20kmph) compared to the TARGET vehicle. Use the keyboard to reach these conditions.

    ACC active

A Simulink model is provided that does the same as the compiled C module ADAS_ACC.

MATLAB r2016b is required.

  1. Stop the simulation.

  2. Stop the ADAS_ACC module.
    (Right Click > Stop process, or simply double-click on it)

    Stop ACC

  3. Open Matlab r2016b

    • Navigate to %STUDIO_PATH%/SCANeRstudio_2022/APIs/
    • Run the MATLAB script setupSCANeR.m
    • Navigate to ./samples/ScanerAPI/ADAS/adas_acc_simulink/
    • Open the Simulink model adas_acc_simulink.mdl
    • Start the Simulink simulation.

    The module SIMULINK_ACC is now tagged as in state “Daemon”, meaning it is ready to participate to the simulation.

    Simulink module

  4. Start the simulation

    From there the behaviour is the same as with the compiled module ADAS_ACC.


General principle

The custom modules ADAS_LKA and ADAS_ACC are developed in C. Using the ScanerAPI, they get access to the simulation data shared on the SCANeR Network.

They both follow the same architecture:


The C sources are in the Visual Studio 2013 solution %STUDIO_PATH%/APIs/samples/evaluation.sln (projects “adas_lka” and “adas_acc”).

In SCANeR’s User Manual: 2.2 SCANeR API.


The Ego vehicle is set to carry two sensors.


In SCANeR’s User Manual: Sensors.

The custom modules ADAS_LKA and ADAS_ACC access the sensor outputs messages available on the SCANeR Network.

In SCANeR’s User Manual: Network.html.

Driver command

The command status (on/off) of the ADAS features are assigned to Custom Inputs.

This is one way to formalize the data exchange between the modules on the SCANeR Network. The other options include the more generic Export Channels or VEN messages, preferred when no application-specific interface exist in SCANeR.

Custom Inputs

Data Flow

In SCANeR’s User Manual: 5.4.2. Custom inputs / outputs.

Vehicle Control

For performance issues, SCANeR uses a Shared Memory (Shm), instead of the Network, to manage the data related to advanced vehicles dynamics (i.e. CALLAS).

In SCANeR’s User Manual: Overload the data from Shared Memory.

In SCANeR’s User Manual: Shm.html.

The Simulink model provided clones the code of ADAS_ACC with standard Simulink Blocks. It reads and write the exact same messages; hence it behaves the same.

In SCANeR’s User Manual: 2.3.5. Co-simulation.