Challenge

Project 1 (Mini Project on Vehicle Direction Detection

Aim Of the Project:-

To identify the direction of the vehicle based on the camera input.

Objective Of The Project:-

  1. Development of MATLAB Simulink model as per requirement.
  2. Tag the requirements to the Simulink model; tagging requirements 1 & requirement 2 to their corresponding subsystems is acceptable.
  3. MBD-compliant changes, Data Dictionary creation & code generation is added advantage, and that is not the scope of this project.
  4. If choosing code generation, the Storage class for Input signals: ImportedExtern; the Storage class for Output signal: Is exported to File; the Storage class for local signals: is localizable; the Storage class for calibration signals: is Const.
  5. Choose sample time for all signals as 0.01s

Overview Of Using The System:-

Automatic vehicle direction detection using the vehicle camera system is an important feature of driver assistance systems. This system uses the camera installed in the vehicle to determine the direction in which the vehicle is traveling. The camera captures images of the road ahead and processes them to determine the direction of the vehicle.

  • One of the main benefits of automatic vehicle direction detection is that it can assist drivers in navigating unfamiliar roads. The system can detect the vehicle's direction even if the driver is unfamiliar with the area. This can help drivers avoid getting lost or taking a wrong turn, which can be especially helpful in urban areas with complex road networks.
  • Another benefit of this system is that it can assist drivers in navigating complex intersections. The system can detect the direction of the vehicle as it approaches an intersection and provide guidance to the driver on which lane to use or which direction to turn. This can help drivers navigate intersections safely and efficiently, reducing the risk of accidents. Automatic vehicle direction detection can also be used to improve the performance of other driver assistance systems, such as lane departure warning and forward collision warning. By accurately detecting the direction of the vehicle, these systems can provide more accurate and timely alerts to the driver, helping to prevent accidents and improve overall safety.
  • There are a few different approaches to implementing automatic vehicle direction detection using the vehicle camera system. One common approach is to use computer vision algorithms to analyze the images captured by the camera and determine the direction of the vehicle based on visual cues such as lane markings and road signs. Another approach is to use GPS and map data to determine the direction of the vehicle based on its location and trajectory.

For this Project, there were several steps taken which are as follows

  • Development of the Desired model
  • Configuration Parameter Setting
  • Linking of the Simulink Data Dictionary
  • Requirement Tagging
  • Signal resolving and Signal Propagation
  • Model Advisor Report Generation
  • C-code generation

Blocks Being Used:-

Sl.No. Name Of the Blocks Quantity
1. Import 7
2. Outport 4
3. Compare To Constant 6
4. Constant 3
5. Goto 2
6. Switch 3
7. Unit Delay 1
8. Logical Operator (AND) 3
9. From 4
10. Signal Conversion 1
11. Mux 1

Requirements And The required data:-

  1. Requirement - 1:
    • Steering wheel input as yaw rate (Signal name: SteeringWheel_YawDegreeInput) is the input for this system.
    • This is compared against 3 angular values, one each for a left turn, right turn & straight drive (Calibration Values: Right_Turn_AngularLimit, Left_Turn_AngularLimit, Straight_Drive_Steering_Angle) to say which specific direction the steering wheel is turning towards.
    • Use switch blocks to compare & develop this requirement. Keep this requirement in a subsystem & the output of this requirement is a local signal (Signal Name: Vehicle_Turn_Status).
  2. Requirement – 2:
    • Keep this requirement as a separate subsystem. Inputs to this requirement are a local signal from requirement 1 (Signal Name: Vehicle_Turn_Status) & an input signal from the camera (Signal Name: CameraInput_RoadSign), which confirms the occurrence of a road sign.
    • Signal Vehicle_Turn_Status is compared against calibration values (Calibration Values: RightTurn_RoadSign, LeftTurn_RoadSign, Straight_RoadSign), if each of them is found equal, then each of the three corresponding outputs is compared against the camera input signal,
    • Using a logical operator block, only one among them is finally given as the output signal (Signal Name: Vehicle_Direction_Indicator).
  3. 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

      -

      -

Steps For Modeling:-

  • Making of the Simulink data dictionary file (.sldd):-
    • Go to the modeling tab and over there.
    • Go to the Model Explorer section.
    • Over there we will find the project name click on the veihicle_Drection_Dection
    • On opening the dropdown click on the MOdel Workspace
    • From the top menu click on the Simulink Parameter
    • Then create all the parameters as per the requirement one by one as per the above table
    • Similarly, make the Signals as per the requirements
    • after creating the signals and all the Parameters
    • On the left-hand side, we will see the model hierarchy then right-click on the model saved file name and click on the save.
    • Once created the file will be saved in the same path which you have given in the picture
  • Making of the First requirements:-
    • In this requirement, there is a steering wheel yaw movement which is being compared to the actual degree of the rotation, and based on that
    • So to satisfy that condition we first need to compare the inputs to the pre-defined value of the degree.
    • Hear the Compare To Constant Block are been used.
      • in the operator's place "==" is been selected and
      • in the place of Constant value name of the parameter is been given like "Right_Turn_AngularLimit"
      • keep the output data type as default i.e., Bool.
    • Similarly, we need to compare the input signal to 3 signals, as per the First Requirments.
    • once all the 3 blocks are placed we need to pass the actual value or we can say the constant values.
    • To do so we need to use the Switch case block from the Simulink library.
      • In the main menu, we need "~=0" to be used in the passing criteria.
      • and ion the signal Attributes keep all the parameters as default.
      • in the integer rounding model search for the "simplest".
      • and click on the "Saturate on integer overflow".
      • this is used to avoid some errors which might occur during code generation.
      • we need to give a constant value as the passing input.
    • Similarly need to create 3 switch cases in a loop
    • and in the last else condition we need to give the unit delay block as feedback from the output
    • At least we need to give that input as Vehicle_Turn_Status, this will be used as input in the next requirements.
    • after creating the model just make it a subsystem and name that Requirement 1, the inside of the complete block will look like this in the given picture
  • Making of the Second Requirments:-
    • in this there are 2 inputs required one is the camera input which is also a physical input and the second one is the output from the First requirement.
    • Similarly, there is a use of the Compare to constant block
      • in the operator's place "==" is been selected and
      • in the place of the Constant value name of the parameter has been given like "Right_Turn_AngularLimit"
      • keep the output data type as default i.e., Bool.
    • Similarly, we need to compare the input signal to 3 signals, as per the First Requirments.
    • once all the 3 blocks are placed we need to pass the actual value or we can say the constant values.
    • there is a need for a logical operator which has taken from the camera as a comparison
    • when both the inputs are true then only the logical operator will be sending one as an output
    • Similarly sending these as input and comparing them to an output with the MUX having 3 inputs.
    • passing the final output from the signal conversion block and giving it as a final output.
    • make them as a requirement 2, the final block will be looking like this from the inside.

  • Method for MAAB
    • Once the model is completed we need to perform MAAB so for that for the guidelines
    • Om the top menu in Matlab we need to go to the MOdeling section.
    • Search for Evaluate and manage click for the Model Advisor.
    • Click on the top level and click ok.
    • after a moment choose the By Task and click on the Run
    • Once the guidelines are run completely.
    • It will create an HTML file,
    • Copy the link from the link and paste it into Chrome and generate a PDF from this
    • after generating the PDF save it n the same folder structure.
    • for reference, there is an attached Screen Shot that can be useful for referencing Purpose.

Observation:-

Conclusion:-.

We have perform the simple project for theAutomatic direction detection for an Vehicle, all the files including the code files are been presented in the file.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.