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 AIM OF THE PROJECT: To determine the Direction of vehicle…
Praveen Kumar E S
updated on 12 Dec 2021
Mini Project - Vehicle Direction Determination
AIM OF THE PROJECT:
To determine the Direction of vehicle based on the Camera Input .
OBJECTIVE OF MINI PROJECT:
Design the vehicle direction Determination
1. Development of MATLAB Simulink model as per requirement.
2.Tag the requirements to the simulink model; tagging requirement 1 & requirement 2 to their corresponding subsystems is fine.
3.MBD compliant changes, Data Dictionary creation & code generation is added advantage, and that is not scope of this project.
INTRODUCTION:
Advanced driver assistance systems (ADAS) have received considerable attention in recent decades, because many car accidents are caused mainly by drivers’ lack of awareness or fatigue. Warning the driver of any dangers that may lie ahead on the road is important for improving traffic safety and accident prevention. So a major function of ADAS is the detection of vehicles in front of one’s own by using computer vision technologies, since the cost of an optical sensor is much lower than that of an active sensor (such as laser or radar ones). Furthermore, optical sensors can be used in a wider range of applications, such as in lane departure warning systems and event video recorders. 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 vehicle is basically identifying the direction the vehicle is taking based on the camera input.
DEVELOPMENT OF MODEL:
Camera reads the road signs & stores into its memory with unique values for left turn, right turn & straight drive. Depending on the direction it is taking, 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 along - side 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.
STEP1:
As per the requirement , we develop the Vehicle direction determination
Requirement - 1:
Requirement – 2:
Requirement 1 and Requirement 2 both the block is created into two separate subsystem
The overall model for the VEHICLE DIRECTION DETERMINATION subsystem
STEP2:
Tagging requirement 1 & requirement 2
STEP3:
Linking the Model with SLDD file
Step4:
Resolving and propagating the signal
Step5:
Change the configuration parameter for Simulation
Change the system target file into ert.tlc and also change the configuration parameter as per requirements
STEP 6:
SIMULATION ANALYSIS AND DISCUSSION
This can be obtained by changing the steering wheel yaw degree input we can obtain
Right turn:
Left Turn:
Straight drive:
MODEL ADVISOR REPORT:
The model advisor report is shown below
CODE GENERATION:
Code generation report for
1 | /* |
2 | * File: Vehicle_direction_detection.c |
3 | * |
4 | * Code generated for Simulink model 'Vehicle_direction_detection'. |
5 | * |
6 | * Model version : 1.4 |
7 | * Simulink Coder version : 9.5 (R2021a) 14-Nov-2020 |
8 | * C/C++ source code generated on : Fri Dec 10 19:35:35 2021 |
9 | * |
10 | * Target selection: ert.tlc |
11 | * Embedded hardware selection: Intel->x86-64 (Windows64) |
12 | * Code generation objectives: Unspecified |
13 | * Validation result: Not run |
14 | */ |
15 | |
16 | #include "Vehicle_direction_detection.h" |
17 | #include "Vehicle_direction_detection_private.h" |
18 | |
19 | /* Exported data definition */ |
20 | |
21 | /* Const memory section */ |
22 | /* Definition for custom storage class: Const */ |
23 | const int16_T LeftTurn_RoadSign = -120;/* Referenced by: '/Constant1' */ |
24 | const int16_T Left_Turn_AngularLimit = -120;/* Referenced by: '/Left Turn' */ |
25 | const int16_T RightTurn_RoadSign = 30; /* Referenced by: '/Constant' */ |
26 | const int16_T Right_Turn_AngularLimit = 30;/* Referenced by: '/Right turn' */ |
27 | const int16_T Straight_Drive_Steering_Angle = 0;/* Referenced by: '/Right Turn' */ |
28 | const int16_T Straight_RoadSign = 0; /* Referenced by: '/Constant2' */ |
29 | |
30 | /* External outputs (root outports fed by signals with default storage) */ |
31 | ExtY_Vehicle_direction_detect_T Vehicle_direction_detection_Y; |
32 | |
33 | /* Real-time model */ |
34 | static RT_MODEL_Vehicle_direction_de_T Vehicle_direction_detection_M_; |
35 | RT_MODEL_Vehicle_direction_de_T *const Vehicle_direction_detection_M = |
36 | &Vehicle_direction_detection_M_; |
37 | |
38 | /* Model step function */ |
39 | void Vehicle_direction_detection_step(void) |
40 | { |
41 | int16_T rtb_Switch; |
42 | |
43 | /* Switch: '/Switch' incorporates: |
44 | * Constant: '/Right Turn' |
45 | * Constant: '/Right turn' |
46 | * Inport: '/SteeringWheel_YawDegreeInput' |
47 | * Switch: '/Switch1' |
48 | */ |
49 | if (SteeringWheel_YawDegreeInput > 30) { |
50 | rtb_Switch = Right_Turn_AngularLimit; |
51 | } else if (SteeringWheel_YawDegreeInput != 0) { |
52 | /* Switch: '/Switch1' incorporates: |
53 | * Constant: '/Left Turn' |
54 | */ |
55 | rtb_Switch = Left_Turn_AngularLimit; |
56 | } else { |
57 | rtb_Switch = Straight_Drive_Steering_Angle; |
58 | } |
59 | |
60 | /* End of Switch: '/Switch' */ |
61 | |
62 | /* Outport: '/Vehicle_Turn_Status' incorporates: |
63 | * Constant: '/Constant' |
64 | * Constant: '/Constant1' |
65 | * Constant: '/Constant2' |
66 | * Inport: '/CameraInput_RoadSign' |
67 | * Logic: '/Logical Operator' |
68 | * Logic: '/Logical Operator1' |
69 | * Logic: '/Logical Operator2' |
70 | * RelationalOperator: '/Relational Operator' |
71 | * RelationalOperator: '/Relational Operator1' |
72 | * RelationalOperator: '/Relational Operator2' |
73 | */ |
74 | Vehicle_direction_detection_Y.Vehicle_Turn_Status[0] = ((rtb_Switch == |
75 | RightTurn_RoadSign) || CameraInput_RoadSign); |
76 | Vehicle_direction_detection_Y.Vehicle_Turn_Status[1] = ((rtb_Switch == |
77 | LeftTurn_RoadSign) || CameraInput_RoadSign); |
78 | Vehicle_direction_detection_Y.Vehicle_Turn_Status[2] = ((rtb_Switch == |
79 | Straight_RoadSign) || CameraInput_RoadSign); |
80 | } |
81 | |
82 | /* Model initialize function */ |
83 | void Vehicle_direction_detection_initialize(void) |
84 | { |
85 | /* (no initialization code required) */ |
86 | } |
87 | |
88 | /* Model terminate function */ |
89 | void Vehicle_direction_detection_terminate(void) |
90 | { |
91 | /* (no terminate code required) */ |
92 | } |
93 | |
94 | /* |
95 | * File trailer for generated code. |
96 | * |
97 | * [EOF] |
98 | */ |
99 |
CONCLUSION:
The model corresponding to vehicle direction detection is Successfully implemented . And also all complaint changes pertaining to the Tagging, MBD compliant changes, Data Dictionary creation ,code generation and also Model Advisor report .
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...
Control Logic of Washing Machine and Gear Shift .
Aim: To Implement control logic of a 'Washing Machine' Using Stateflow as per given Sequence. Make a Simulink chart for the 'Gear Shift' logic as per given conditions. Objective: In Simulink, Implement the Control logic of a Washing Machine using StateFlow as per given input conditions.…
10 Feb 2022 11:26 AM IST
Week 2 Challenge
Question 1:Compare four different types of fuel cells and state their applications. An electrical current is produced via redox reactions occurring on the electrodes of the fuel cell. The most common fuel cell is the hydrogen fuel cell. On the anode, hydrogen molecules, which are fed to the anode from an external supply,…
06 Feb 2022 04:59 PM IST
Project-1: Modelling an electric Car with Li-ion battery
Aim: To Create a MATLAB model of an electric car in which we uses which uses lithium ion battery and suitable motor choosing a suitable blocks from the Powertrain block set and Implement the Vehicle Speed by using PI Controller and generate the accelerator and brake commands. Objectives: …
27 Jan 2022 06:44 AM IST
Final Project: Electric Rickshaw modelling
1.Create a detailed MATLAB model of an electric rickshaw (three wheel passenger vehicle) as per details below: Rear wheels driven by PM brushed type motor Assume efficiency points of motor controller and motor Make an excel sheet of all input and assumed data Results: For any three standard driving cycles show…
27 Jan 2022 05:01 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.