Project 1 (Mini Project on Vehicle Direction Detection
The main Aim to Develop a Model for Vehicle Direction Detection is developed as per requirement given.
Seperrate model have been made for both requirements.
1.Firstly made model for the Requirement.
2.SLDD file have been made as per the parameter given and used, Reuirement tagging has been done.
3. Model Advisory report have been generated and attached
4. C code have been generated and attached
5. photos of all steps have been taken and attached with MODEL,SLDD,MODEL ADVISORYREPORT AND C CODE
NOTE:- All Files Attached with photos please attach once again if not able to open. All files are made with same name .
C CODE IS:-
/*
* File: Mini_Project1.c
*
* Code generated for Simulink model 'Mini_Project1'.
*
* Model version : 1.12
* Simulink Coder version : 9.9 (R2023a) 19-Nov-2022
* C/C++ source code generated on : Tue Jun 6 19:21:40 2023
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "Mini_Project1.h"
#include "rtwtypes.h"
#include "Mini_Project1_private.h"
/* Exported data definition */
/* Definition for custom storage class: ExportToFile */
boolean_T Vehicle_direction_indicator[3];/* '<S3>/Signal Conversion' */
/* 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>/Left_turn_AngularLimit' */
const int16_T RightTurn_RoadSign = 30; /* Referenced by: '<S3>/Constant' */
const int16_T Right_Turn_AngularLimit = 30;/* Referenced by:
* '<S2>/Right_turn_AngularLimit'
* '<S2>/Right_turn_AngularLimit1'
*/
const int16_T Straight_Drive_Steering_Angle = 0;/* Referenced by:
* '<S2>/Straight_Drive_Steering_Angle'
* '<S2>/Straight_Drive_Steering_Angle1'
*/
const int16_T Straight_RoadSign = 0; /* Referenced by: '<S3>/Constant2' */
/* Real-time model */
static RT_MODEL_Mini_Project1_T Mini_Project1_M_;
RT_MODEL_Mini_Project1_T *const Mini_Project1_M = &Mini_Project1_M_;
/* Model step function */
void Mini_Project1_step(void)
{
/* local block i/o variables */
int16_T Vehicle_Turn_Status;
/* Outputs for Atomic SubSystem: '<Root>/Vehicle_Direction_Indicator_model' */
/* Switch: '<S2>/Switch3' incorporates:
* Constant: '<S2>/Right_turn_AngularLimit'
* Constant: '<S2>/Straight_Drive_Steering_Angle'
* Inport: '<Root>/SteeringWheel_YawDegreeInput'
* RelationalOperator: '<S2>/Relational Operator'
* RelationalOperator: '<S2>/Relational Operator1'
* Switch: '<S2>/Switch1'
*/
if (SteeringWheel_YawDegreeInput >= Right_Turn_AngularLimit) {
/* Switch: '<S2>/Switch3' incorporates:
* Constant: '<S2>/Right_turn_AngularLimit1'
*/
Vehicle_Turn_Status = Right_Turn_AngularLimit;
} else if (SteeringWheel_YawDegreeInput == Straight_Drive_Steering_Angle) {
/* Switch: '<S2>/Switch1' incorporates:
* Constant: '<S2>/Straight_Drive_Steering_Angle1'
* Switch: '<S2>/Switch3'
*/
Vehicle_Turn_Status = Straight_Drive_Steering_Angle;
} else {
/* Switch: '<S2>/Switch3' incorporates:
* Constant: '<S2>/Left_turn_AngularLimit'
* Switch: '<S2>/Switch1'
*/
Vehicle_Turn_Status = Left_Turn_AngularLimit;
}
/* End of Switch: '<S2>/Switch3' */
/* SignalConversion: '<S3>/Signal Conversion' 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 != 0));
Vehicle_direction_indicator[1] = ((Vehicle_Turn_Status == LeftTurn_RoadSign) &&
(CameraInput_RoadSign != 0));
Vehicle_direction_indicator[2] = ((Vehicle_Turn_Status == Straight_RoadSign) &&
(CameraInput_RoadSign != 0));
/* End of Outputs for SubSystem: '<Root>/Vehicle_Direction_Indicator_model' */
}
/* Model initialize function */
void Mini_Project1_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void Mini_Project1_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/