All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Mini Project - Vehicle Direction Determination General Overview: Identifying the direction of the vehicle is one of the important &…
Shubham Solanke
updated on 18 Oct 2021
Mini Project - Vehicle Direction Determination
General Overview:
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 identifying the direction the vehicle is taking based on the camera input.
The camera reads the road signs & stores them into its memory with unique values for the 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 objective of the Mini Project:
Requirement - 1:
Requirement – 2:
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 |
- |
- |
1. Designing the MATLAB MODEL
This the main model subsystem that having two inputs SteeringWheel_YawDegreeInput and CameraInput_RoadSign entering into the Vehicle Detection Determination subsystem and one output Vehicle_Direction_Indicator
there are 2 requirements are designed in two subsystem
Requirement:- 1
Requirement:- 2
2. Requirement Tagging
all the requirements are tagged for better understandability, anyone who is reviewing the model or who is trying to update the model can get a clear idea of what logic is used in the system. from the requirement manager, we can see what are all are tagged and the description
General Overview:
Requirement - 1:
Requirement – 2:
3. Developing SLDD
all the inputs, outputs, calibration parameters are saved in SLDD so while simulation the model takes all the values and its parameters from the Simulink Data Dictionary
4. Signal Resolution for inputs and outputs
the inputs and output signals are resolved so the signals will take the values from sldd and pass them to the logical blocks. Otherwise, it may take some junk values if it is unresolved
5. Model Update.
The model update is done by Ctrl-D. this is done to check for any static errors. If no errors are coming the model is working fine without any errors.
6. Simulation
The model is simulated too for checking for errors and warmings
7. Configuration Parameter Update
Various configuration parameters are updated as per the code generation the solver type should be fixed for code generation
8. Model Advisory Report
By running the model advisor tool, we can see commonly made modelling errors.
9 Code generation
build model for generating code
Code
/*
* File: Project_on_Vehicle_Direction_Detection.c
*
* Code generated for Simulink model 'Project_on_Vehicle_Direction_Detection'.
*
* Model version : 1.12
* Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
* C/C++ source code generated on : Wed Oct 13 22:09:11 2021
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "Project_on_Vehicle_Direction_Detection.h"
#include "Project_on_Vehicle_Direction_Detection_private.h"
/* Real-time model */
static RT_MODEL_Project_on_Vehicle_D_T Project_on_Vehicle_Direction_M_;
RT_MODEL_Project_on_Vehicle_D_T *const Project_on_Vehicle_Direction_M =
&Project_on_Vehicle_Direction_M_;
/* Model step function */
void Project_on_Vehicle_Direction_Detection_step(void)
{
int32_T rtb_Vehicle_Turn_Status;
/* Switch: '/Switch' incorporates:
* Constant: '/Left_Turn_AngularLimit'
* Constant: '/Right_Turn_AngularLimit'
* Inport: '/SteeringWheel_YawDegreeInput'
* Switch: '/Switch1'
*/
if (SteeringWheel_YawDegreeInput > 25) {
rtb_Vehicle_Turn_Status = 30;
} else if (SteeringWheel_YawDegreeInput > 0) {
/* Switch: '/Switch1' incorporates:
* Constant: '/Straight_Drive_Steering_Angle'
*/
rtb_Vehicle_Turn_Status = 0;
} else {
rtb_Vehicle_Turn_Status = -120;
}
/* End of Switch: '/Switch' */
/* Logic: '/OR' incorporates:
* Constant: '/LeftTurn_RoadSign'
* Constant: '/RightTurn_RoadSign'
* Constant: '/Straight_RoadSign'
* Inport: '/CameraInput_RoadSign'
* Logic: '/Logical Operator'
* Logic: '/Logical Operator1'
* Logic: '/Logical Operator3'
* RelationalOperator: '/Relational Operator'
* RelationalOperator: '/Relational Operator1'
* RelationalOperator: '/Relational Operator2'
*/
Vehicle_Direction_Indicator = ((CameraInput_RoadSign &&
(rtb_Vehicle_Turn_Status == 30)) || (CameraInput_RoadSign &&
(rtb_Vehicle_Turn_Status == -120)) || (CameraInput_RoadSign &&
(rtb_Vehicle_Turn_Status == 0)));
}
/* Model initialize function */
void Project_on_Vehicle_Direction_Detection_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void Project_on_Vehicle_Direction_Detection_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/
Result
The vehicle direction determination is modelled as per the requirement, all the signals are defined in Simulink data dictionary. All input and output signals are resolved and propagated. Updated the model to check for static errors. Run the model advisor tool to see any errors. since there are no errors in Model Advisor Report. Code has been generated using Embedded Coder.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Project 1 Mechanical design of battery pack
AIM: Prepare a detailed battery pack drawing of [Battery pack capacity: 18 kWh, Cell: ANR26650M1-B] along with its enclosure. State your assumptions. Details of Cell: ANR26650M1-B: ANR26650M1-B specification: Nominal Rating: voltage :3.3 volts…
17 Jun 2023 05:44 PM IST
Week 7 State of charge estimation
Aim:- State of charge estimation https://in.mathworks.com/matlabcentral/fileexchange/72865-design-and-test-lithium-ion-battery-management-algorithms 1. Simulate the 3 test cases from the harness dashboard and write a detailed report on the results 2. What is coulomb counting? Refer to the above model and explain how…
14 Nov 2021 03:20 PM IST
Project 1- Traffic Jam Assistant Feature
Project 1- Traffic Jam Assistant Feature Introduction to the Feature: Traffic Jam Assistant is one of the most common feature in Advanced Driver Assistance System. Traffic Jam Assistant helps the driver arrive more relaxed at their destination, even in dense traffic or in traffic jams. As a partially automated comfort…
28 Oct 2021 06:46 AM IST
Related Courses
8 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.