All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
EV BATCH - 17
Aim:
Theory:
>> Vehicle Direction Determination:
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.
Explanation:
>> Requirement - 1:
>> Requirement – 2:
## MIL Test:
>> Actual Output:
>> Differnce graph:
## SIL Test:
>> Actual Output:
>> Differnce graph:
>> The two Test herness will appear like given below figure
Results:
/*
* Academic License - for use in teaching, academic research, and meeting
* course requirements at degree granting institutions only. Not for
* government, commercial, or other organizational use.
* File: Subsystem.c
* Code generated for Simulink model 'Subsystem'.
* Model version : 1.16
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
* C/C++ source code generated on : Wed Jun 29 01:15:43 2022
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "Subsystem.h"
#include "rtwtypes.h"
#include "Subsystem_private.h"
/* Exported data definition */
/* Definition for custom storage class: ExportToFile */
boolean_T Vehicle_Direction_Indicator[3];/* '<S3>/Signal Copy' */
/* Const memory section */
/* Definition for custom storage class: Const */
const int16_T LeftTurn_RoadSign = -120;/* Referenced by: '<S3>/Constant1' */
const int16_T Left_Turn_AngularLimit = -120;/* Referenced by: '<S2>/Constant2' */
const int16_T RightTurn_RoadSign = 30; /* Referenced by: '<S3>/Constant' */
const int16_T Right_Turn_AngularLimit = 30;/* Referenced by: '<S2>/Constant' */
const int16_T Straight_Drive_Steering_Angle = 0;/* Referenced by: '<S2>/Constant1' */
const int16_T Straight_RoadSign = 0; /* Referenced by: '<S3>/Constant2' */
/* Real-time model */
static RT_MODEL_Subsystem_T Subsystem_M_;
RT_MODEL_Subsystem_T *const Subsystem_M = &Subsystem_M_;
/* Model step function */
void Subsystem_step(void)
{
/* local block i/o variables */
int16_T Vehicle_Turn_Status;
/* Outputs for Atomic SubSystem: '<Root>/Subsystem' */
/* Switch: '<S2>/Switch1' incorporates:
* Constant: '<S4>/Constant'
* Constant: '<S5>/Constant'
* Inport: '<Root>/SteeringWheel_YawDegreeInput'
* RelationalOperator: '<S4>/Compare'
* RelationalOperator: '<S5>/Compare'
* Switch: '<S2>/Switch'
*/
if (SteeringWheel_YawDegreeInput > 0) {
/* Switch: '<S2>/Switch1' incorporates:
* Constant: '<S2>/Constant'
*/
Vehicle_Turn_Status = Right_Turn_AngularLimit;
} else if (SteeringWheel_YawDegreeInput == 0) {
/* Switch: '<S2>/Switch' incorporates:
* Constant: '<S2>/Constant1'
* Switch: '<S2>/Switch1'
*/
Vehicle_Turn_Status = Straight_Drive_Steering_Angle;
} else {
/* Switch: '<S2>/Switch1' incorporates:
* Constant: '<S2>/Constant2'
* Switch: '<S2>/Switch'
*/
Vehicle_Turn_Status = Left_Turn_AngularLimit;
}
/* End of Switch: '<S2>/Switch1' */
/* SignalConversion: '<S3>/Signal Copy' incorporates:
* Constant: '<S3>/Constant'
* Constant: '<S3>/Constant1'
* Constant: '<S3>/Constant2'
* Inport: '<Root>/CameraInput_RoadSign'
* Logic: '<S3>/Logical Operator'
* Logic: '<S3>/Logical Operator1'
* Logic: '<S3>/Logical Operator2'
* RelationalOperator: '<S3>/Relational Operator'
* RelationalOperator: '<S3>/Relational Operator1'
* RelationalOperator: '<S3>/Relational Operator2'
*/
Vehicle_Direction_Indicator[0] = ((Vehicle_Turn_Status == RightTurn_RoadSign) &&
CameraInput_RoadSign);
Vehicle_Direction_Indicator[1] = ((Vehicle_Turn_Status == LeftTurn_RoadSign) &&
CameraInput_RoadSign);
Vehicle_Direction_Indicator[2] = ((Vehicle_Turn_Status == Straight_RoadSign) &&
CameraInput_RoadSign);
/* End of Outputs for SubSystem: '<Root>/Subsystem' */
}
/* Model initialize function */
void Subsystem_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void Subsystem_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
* [EOF]
*/
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 (Mini Project on Vehicle Direction Detection
…
18 Aug 2022 07:26 PM IST
Week-3 Challenge: ADVISOR Tool
EV BATCH - 17 Use ADVISOR tool and simulate INTRODUCTION : ADVISOR tool, developed in November 1994 by the National Renewable Energy Laboratory (NREL), allows users to simulate and analyze conventional,…
19 Jul 2022 08:53 AM IST
Project 2 Adaptive Cruise Control
EV BATCH - 17 Aim: To desing and Simulate Adaptive Cruise Control in matlab Simulink To developing Adaptive Cruise Control feature as per the Requirement Document using MATLAB Simulink. To Follow all the…
11 Jul 2022 05:15 PM IST
Week 7 State of charge estimation
…
08 Jul 2022 07:33 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.