Project 1 (Mini Project on Vehicle Direction Detection
AIM: Identifying the direction of the vehicle based on the camera input.
OBJECTIVE:
1. Development of Matlab Simulink model as per the requirement.
2. Tag the requirements to the Simulink mode; tagging requirement 1 and requirement 2 to the corresponding subsystem.
3. MBD-compliant changes, Data Dictionary creation, and code generation is added advantage.
4. If choosing code generation, the Storage class for input signals: ImportedExtern; the Storage class for output signal: Is export to file; the Storage class for local signals: is localizable; the Storage class for calibration signals: is Const.
5. Choose the sample time for all signals as 0.01s.
THEORY:
-Identifying the direction of the vehicle is one of the important & diverse features in Autonomous driving & Advanced Driver Assistance Features. This particular sub-feature of identifying the direction of the vehicle is basically identifying the direction the vehicle is taking based on the camera input.
-The camera reads the road signs & stores them in its memory with unique values for a left turn, right turn & straight drive. Depending on the direction it is taking, the final indication is given to the driver – as an indication if he is driving in the recommended direction or not.
-Vehicle Direction Determination can also be coupled alongside features like GPS systems to identify whether the vehicle is reaching its destination in an optimized manner. This sub-feature can also be used along with Lane Detection, Highway Warning, Ramp Entry / Exit in Wrong Way Detection, etc
The model of the Vehicle detection is shown below:

The subsystem of the main block is shown below:

As per requirement 1, the following subsystem is shown:
As per Requirement 2 the corresponding subsystem is shown below:
The second step is now to build the subsystem according to the requirement 2 objectives. The output of subsystem 1 along with the Camerainput_roadsign is given as input to subsystem 2. Firstly the Vehicle_turn_status will be compared with the calibration values Right_tyrn_roadsign, Leftturn_roadsign, and Straight_roadsign using the compare to constant blocks. The output of each of these comparison values will go through logical operators AND which gives the final output called Vehicle_directionIndicator. The output can be displayed using a scope.

procedure:
1.Requirement 1 in the Word file is tagged to subsystem 1.

Select the text from word or any other data document by highlighting the text. Then, by right-clicking, select the requirement and tag the subsystem to the data file.
Similar steps are followed to tag the information related to the subsystem 2.

2.Creation of SLDD and linking it with the model:
Given signals and calibration data list;
Signals & Calibration Data List:
|
Signal / Calibration Name |
Signal Type |
Data Type |
Dimension |
Min |
Max |
Initial Value |
Units |
|
SteeringWheel_YawDegreeInput |
Input |
Int16 |
1 |
-180 |
180 |
- |
Deg |
|
CameraInput_RoadSign |
Input |
Boolean |
1 |
0 |
1 |
- |
- |
|
Vehicle_Turn_Status |
Local |
Int16 |
1 |
-180 |
180 |
- |
Deg |
|
Right_Turn_AngularLimit |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
30 |
Deg |
|
Left_Turn_AngularLimit |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
-120 |
Deg |
|
Straight_Drive_Steering_Angle |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
0 |
Deg |
|
RightTurn_RoadSign |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
30 |
|
|
LeftTurn_RoadSign |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
-120 |
|
|
Straight_RoadSign |
Calibration |
Int16 |
[1 1] |
-180 |
180 |
0 |
|
|
Vehicle_Direction_Indicator |
Output |
Boolean |
1 |
0 |
1 |
- |
- |

Add all the signals and constants with units, initial value, minimum and maximum values, datatype of the signals as shown below.

3.The further step involves resolving all the signals and propagated:
Signal resolving:

Signal propagation:

4. Now, the solver configuration parameters are changed for Simulation and code generation.

For the code generation, embedded coder is selected as the target file:

Code Generation:
After selecting the target model as an Embedded coder, the building and generation of the code of the respective model has been done, the.C file of tVehicle_directionindicator model is shown below.

