Project 2-Highway Assistant-Lane Changing Assistant
Aim :- Model Based Development of Highway Assistant – Lane Changing Assistant
Objective :-
To develop one specific requirement of Highway Assistant – Lane Changing Assistant algorithm. Please note that the whole Highway Assistant – Lane Changing Assistant is a very huge algorithm & only one small part of the logic is implemented here. Idea is to familiarize with concepts of Autosar Software Component Development in MATLAB Environment by following the Model Based Development guidelines. The Project must be done keeping in mind the following processes & steps.
- This model should be developed in MATLAB Simulink environment per MBD guidelines.
- Code Generation Profile must be Autosar Coder.
- Simulink Data Dictionary must be created for the model & must be linked to the model.
- All the input & output signals must be mapped into the Autosar Editor.
- Tagging as per Requirement document.
- Model Advisor Report is mandatory & this will be followed by Code Generation.
Theory of Highway Assistant – Lane Changing Assistant :-

fig. Highway Assistant – Lane Changing Assistant feature
- The Highway Assistant supports the driver and takes over the longitudinal and lateral guidance of the vehicle in monotonous driving situations on highways.
- The partially automated function can automatically start, accelerate, brake as well as steer the vehicle to a certain extent. The driver has to permanently supervise the system and be ready to take over the complete control of the vehicle at any time.
- Drivers are taught to assess surrounding traffic before changing lanes by checking their rearview and side mirrors and looking over each shoulder. However, even for those who follow this sequence of checks, the vehicle's blind spot – the area alongside and just behind the vehicle – is a constant source of danger and often the cause of serious accidents.
- Even vehicles approaching quickly from behind can pose a risk. To make changing lanes safer, this feature has been developed.
Basic Working Principle of Highway Assistant – Lane Changing Assistant logic :
- Highway Assistant is a partially automated driving function for a speed range of up to 180 km/h (112 mph) on highways. It combines the radar-based longitudinal guidance of Adaptive Cruise Control (ACC) with the video-based lateral guidance of lane keeping support in one system.
- Highway Assistant can be supplemented by an automatic lane change initiated and monitored by the driver in a speed range of 60 – 130 km/h (35 – 80 mph).
- The lane Change Assistant works by using two mid-range radar sensors that are concealed in the rear bumper – one on the left, one on the right. These two sensors monitor the area alongside and behind the car. Powerful control software collates the sensor information to create a complete picture of all traffic in the area behind the vehicle.
- Whenever another vehicle approaches at speed from behind or is already present in the blind spot, a signal such as a warning light in the side mirror alerts the driver to the hazard. Should the driver still activate the turn signal with the intention of changing lanes, the system issues an additional acoustic and/or haptic warning.
Development of Highway Assistant – Lane Changing Assistant logic :-
- We aware that the whole Highway Assistant – Lane Changing Assistant is a very huge algorithm & only one small part of the logic is implemented in the below model. Idea is to familiarize with concepts of Autosar Software Component Development in MATLAB Environment. The model is implemented according to the following requirements:
Main Model :-

- The above model is the main model of the Highway Lane Changing Assistant logic. Here, as per given conditon, input signals to this system are Highway_Input_Signal, Enable_Display, Input_Switch and Lane_Input_Signal. Since, four signals are originating/used for first time, hence we have to resolve this signals by right clicking on signal properties and check the first box as under;


Requirement no. 1, Requirement no.2 and Requirement no.3 subsytem :-

As the subsystem ' Highway Lane Changing Assistant logic' is the main subsystem, hence it is further divided into three more subsystems as this subystems needs to follow three given requirements i.e. Requirement no. 1, Requirement no.2 and Requirement no.3 subsytem.
In this, Highway_Input_Signal, Enable_Display, Input_Switch signal are connected as input to Requirement no.1 subsystem i.e. Highway_Display Unit. In this subsytem, we have generated output signals such as Highway_Display_Mode_1, Highway_Display_Mode_2,Highway_Display_Mode_3,Highway_Display_Mode_4 as per the stateflow logic.
Enable_Display, Input_Switch and Lane_Input_Signal signal are connected as input to Requirement no.2 subsystem i.e. Lane_Display Unit. In this subsytem, we have generated output signals such as Lane_Display_Mode_1, Lane_Display_Mode_2,Lane_Display_Mode_3,Lane_Display_Mode_4 as per the stateflow logic.
These 8 nos. of output signals from Requirement no. 1 and Requirement no.2 subsystem, we have connected as an input signals to the Requirement no. 3 subsystem i.e. (Display_Model Unit). Further, we have also connected Highway_Input_Signal as an input signal to the Requirement no. 3 subsystem.
In this requirement no. 3 susbystem, we have created a logic in such a way that Highway_Input_Signal is given as control signal port to the total 4 nos. of switch block. Input signals given to this switch no.1 blocks are Highway_Display_Mode_1 to the first port and Lane_Display_Mode_1 to the third port of the switch block. If the control signal i.e.Highway_Input_Signal is not equal to 0 (~=0) condition gets satisfied, then the switch block will give output value as Highway_Display_Mode_1 and the same is shown as output signal to Display_Mode_1. If the condition (~=0) doesn't gets satisfied, then the output value as Lane_Display_Mode_1 will taken as output signal for Display_Mode_1 signal.
The same logic has been used for getting the output signal as Display_Mode_1, Display_Mode_2, Display_Mode_3, Display_Mode_4. It means that if the control signal i.e.Highway_Input_Signal is not equal to 0 (~=0) condition gets satisfied for switch block no.2, then the switch block will give output value as Highway_Display_Mode_2 and the same is shown as output signal to Display_Mode_2. If the condition (~=0) doesn't gets satisfied, then the output value as Lane_Display_Mode_2 will taken as output signal for Display_Mode_2 signal.
It means that if the control signal i.e.Highway_Input_Signal is not equal to 0 (~=0) condition gets satisfied for switch block no.3, then the switch block will give output value as Highway_Display_Mode_3 and the same is shown as output signal to Display_Mode_3. If the condition (~=0) doesn't gets satisfied, then the output value as Lane_Display_Mode_3 will taken as output signal for Display_Mode_3 signal.
It means that if the control signal i.e.Highway_Input_Signal is not equal to 0 (~=0) condition gets satisfied for switch block no.4, then the switch block will give output value as Highway_Display_Mode_4 and the same is shown as output signal to Display_Mode_4. If the condition (~=0) doesn't gets satisfied, then the output value as Lane_Display_Mode_4 will taken as output signal for Display_Mode_4 signal.
Requirement No.1 Subsystem (Highway_Display Unit) :-



In this requirement no. 1 subsystem, Highway_Input_Signal, Enable_Display, Input_Switch signal are connected as input to Requirement no.1 subsystem i.e. Highway_Display Unit. In this subsytem, we have generated output signals such as Highway_Display_Mode_1, Highway_Display_Mode_2,Highway_Display_Mode_3,Highway_Display_Mode_4 as per the stateflow logic.
Stateflow logic chart is created in such a way that if input signals i.e.Highway_Input_Signal ==1, Enable_Display==0, Input_Switch==1 condition gets satisfied. Then, chart will enter into the state where output signal is Highway_Display_Mode_1=232, Highway_Display_Mode_2=183, Highway_Display_Mode_3=41, Highway_Display_Mode_4=94. The same gets executed.
If input signals i.e.Highway_Input_Signal ==1, Enable_Display==1, Input_Switch==1 condition gets satisfied. Then, chart will enter into the state where output signal is Highway_Display_Mode_1=213, Highway_Display_Mode_2=183, Highway_Display_Mode_3=9, Highway_Display_Mode_4=94. The same gets executed.
At the output of this chart, we will generate output signals such as Highway_Display_Mode_1, Highway_Display_Mode_2,Highway_Display_Mode_3,Highway_Display_Mode_4. Since this output signals are generated for the first time, we have resolved those signals as under;


Requirement No.2 Subsystem (Lane_Display Unit) :-



In this requirement no. 2 subsystem, Enable_Display, Input_Switch, Lane_Input_Signal are connected as input to Requirement no.2 subsystem i.e. Lane_Display Unit. In this subsytem, we have generated output signals such as Lane_Display_Mode_1, Lane_Display_Mode_2,Lane_Display_Mode_3,Lane_Display_Mode_4 as per the stateflow logic.
Stateflow logic chart is created in such a way that if input signals i.e.Lane_Input_Signal ==6, Enable_Display==0, Input_Switch==1 condition gets satisfied, then chart will enter into the state where output signal is Lane_Display_Mode_1=132, Lane_Display_Mode_2=185, Lane_Display_Mode_3=54, Lane_Display_Mode_4=67. The same gets executed.
If input signals i.e.Lane_Input_Signal ==6, Enable_Display==1, Input_Switch==1 condition gets satisfied, then chart will enter into the state where output signal is Lane_Display_Mode_1=127, Lane_Display_Mode_2=248, Lane_Display_Mode_3=186, Lane_Display_Mode_4=84. The same gets executed.
At the output of this chart, we will generate output signals such as Lane_Display_Mode_1, Lane_Display_Mode_2,Lane_Display_Mode_3,Lane_Display_Mode_4. Since this output signals are generated for the first time, we have resolved those signals as under;


Requirement No.3 subsystem :-


There are 8 nos. of output signals combinely from Requirement no. 1 and Requirement no.2 subsystem, we have connected as an input signals to the Requirement no. 3 subsystem i.e. (Display_Model Unit). Further, we have also connected Highway_Input_Signal as an input signal to the Requirement no. 3 subsystem.
In this requirement no. 3 susbystem, we have created a logic in such a way that Highway_Input_Signal is given as control signal port to the total 4 nos. of switch block. Input signals given to this switch no.1 blocks are Highway_Display_Mode_1 to the first port and Lane_Display_Mode_1 to the third port of the switch block. If the control signal i.e.Highway_Input_Signal is not equal to 0 (~=0) condition gets satisfied, then the switch block will give output value as Highway_Display_Mode_1 and the same is shown as output signal to Display_Mode_1. If the condition (~=0) doesn't gets satisfied, then the output value as Lane_Display_Mode_1 will taken as output signal for Display_Mode_1 signal.
The same logic has been used for getting the output signal as Display_Mode_1, Display_Mode_2, Display_Mode_3, Display_Mode_4. It means that if the control signal i.e.Highway_Input_Signal is not equal to 0 (~=0) condition gets satisfied for switch block no.2, then the switch block will give output value as Highway_Display_Mode_2 and the same is shown as output signal to Display_Mode_2. If the condition (~=0) doesn't gets satisfied, then the output value as Lane_Display_Mode_2 will taken as output signal for Display_Mode_2 signal.
If the control signal i.e.Highway_Input_Signal is not equal to 0 (~=0) condition gets satisfied for switch block no.3, then the switch block will give output value as Highway_Display_Mode_3 and the same is shown as output signal to Display_Mode_3. If the condition (~=0) doesn't gets satisfied, then the output value as Lane_Display_Mode_3 will taken as output signal for Display_Mode_3 signal.
If the control signal i.e.Highway_Input_Signal is not equal to 0 (~=0) condition gets satisfied for switch block no.4, then the switch block will give output value as Highway_Display_Mode_4 and the same is shown as output signal to Display_Mode_4. If the condition (~=0) doesn't gets satisfied, then the output value as Lane_Display_Mode_4 will taken as output signal for Display_Mode_4 signal.
At the output, we will generate output signals such as Display_Mode_1, Display_Mode_2,Display_Mode_3,Display_Mode_4. Since these output signals are generated for the first time, we have rseolved those signals as under;


Step 1 :- Changing the Configuration Parameters
We have changed the configuration parameters by firstly changing the solver settings by clicking on 'Model Settings'. After opening the 'Model Settings', converting the type as fixed step and solver as discrete (no continous)and changed the sample time as 0.01 sec.

Then, we have changed the System Target File to 'autosar.tlc' under code generation section as under;


The model now changed to Autosar Compliant model as under;

Step 2 :- Creation of Simulink Data Dictonary
A Simulink Data Dictionary (SLDD) file is created so that it contains input, output signals and caliberation parameters used in the given model instead of using Init file for initilalizing caliberation values everytime.
(i) We have to go under Modelling section and select on 'Link to Data Dictionary' as under;

(ii) Create a new data directory in the given folder and named it by giving .sldd extension. In this case, we have created SLDD file by giving name as highway_lane_changing_assistant_dd.sldd as under;

(iii) We have given the input signal, output signal and local signals and the same are as under;
Input Signals :-
| Name of the Signal | Data Type | Range |
| Highway_Input_Signal | uint8 | 0 - 255 |
| Enable_Display | uint8 | 0 - 255 |
| Input_Switch | uint8 | 0 - 255 |
| Lane_Input_Signal | uint8 | 0 - 255 |
Local Signals :-
| Name of the Signal | Data Type | Range |
| Highway_Display_Mode_1 | uint8 | 0 - 255 |
| Highway_Display_Mode_2 | uint8 | 0 - 255 |
| Highway_Display_Mode_3 | uint8 | 0 - 255 |
| Highway_Display_Mode_4 | uint8 | 0 - 255 |
| Lane_Display_Mode_1 | uint8 | 0 - 255 |
| Lane_Display_Mode_2 | uint8 | 0 - 255 |
| Lane_Display_Mode_3 | uint8 | 0 - 255 |
| Lane_Display_Mode_4 | uint8 | 0 - 255 |
Output Signals :-
| Name of the Signal | Data Type | Range |
| Display_Mode_1 | uint8 | 0 - 255 |
| Display_Mode_2 | uint8 | 0 - 255 |
| Display_Mode_3 | uint8 | 0 - 255 |
| Display_Mode_4 | uint8 | 0 - 255 |
Accordingly, we have created the Simulink Data Dictionary (SLDD) by clicking on file name i.e highway_lane_changing_assistant_dd.sldd and select Design data. Then, we have to select add signal and add simulink signals as of input signals, local signals, local signals. While defining these signals, we have given storage class as 'Auto'.
Because in Autosar Compilant model, if we give the Storage class for Input signals as ImportedExtern; Storage class for Output signal as Export to File; Storage class for local signals as localizable, then it is throwing an error stating to change the storage type of Signal as Auto.

As per the given condition, we have defined the data type as unit8 for all signals and giving the range from 0-255. Sample time for all signals are taken as 0.01 sec.
We have used the same steps for creating and storing all those signals. The screenshot of Highway_Input_Signal is as under;

Step 3 :- Creation of Autosar Dictionary
First, we have to go into App section and in this, we have to select "Autosar Component" under code generation as under;

The model now changed to Autosar Compliant model as under;

Click on AUTOSAR SW Component option, then we have to select AUTOSAR dictionary option.

After opening AUTOSAR dictionary, below window opened;

In the AUTOSAR Dictonary, we will update the XML options as under;

Creation of S-R Interface :-
Then, we have updated the sender receiver interfaces of first input signal i.e. Highway_Input_Signal by giving the name with prefix SRIf_ as under;

The same method is used to update S-R interface of all input & output signals.
Total eight Sender-Receiver interfaces have been created as there are four inputs and four outputs for the main subsystem ‘Highway Lane Changing Assistant Logic’ and the same has been created by giving prefix SRIf_ as under;

Creation of Data Elements :-
Then, we have updated the data elements for these above S-R interface by giving prefix as DE_ . Also, we selected SwCaliberationAccess as ReadOnly and SwAddrMethod as None.
Some of the data elements is as under;


Updation of Receiver ports in the Autosar Dictionary :-
Click on Receiver Ports option and click on '+' to add the ports.
Then, we try to add the first receiver port for input signal Highway_Input_Signal by using prefix as Rp_ as under;

Similarly, we have added all input signals as receiver ports and the same is as under;

Updation of Sender ports in the Autosar Dictionary :-
Click on Sender Ports option and click on '+' to add the ports. Then, we try to add the first sender port for output signal Display_Mode_1 by using prefix as Pp_ as under;

Similarly, we have added all output signals as sender ports and the same is as under;

Creating of Runnables :-
After configuring the XML options and S-R Interfaces, Sender Ports, Receiver Ports, we have configured Runnables.
In the runnables, we have created two events. The one event is InitEvent i.e. initializing event and second event is TimingEvent i.e. timing event.
InitEvent :-

TimingEvent :-

After configuring the XML options, S-R Interfaces, Runnables and Sender-Receiver Ports to the AUTOSAR Dictionary, the inports and outports of the developed model are mapped to their corresponding receiver / sender ports and data element.
Code Mapping is done for runnable events as under;

Then, we have done Port mapping for Inports as under;

Further, we have done port mapping for Outports and the same is as under;

Then, we try to validate the port mapping and the validation is successfully done and same is as under;

Requirement Tagging of Simulink Model:-
- The requirements ‘Requirement-1’ , ‘Requirement-2’ and 'Requirement-3' as provided in the Requirements Word document are tagged to their corresponding subsystem in the Simulink Model.
Steps for tagging a requirement in Simulink model :-
- First, we have highlight/ select the requirement statement in the Word document file. This word document file needs to be same MATLAB path.
- Then, we have to go in Simulink Model and right click on particular subsystem, we need to tag. After right clicking, we have to select 'Requirements' and then click on 'link to Selection in word'. Then, the particular subsytem will get tagged for the highlighted text on word documents file.
- After doing sucessful tagging, MATLAB traceability file is generated in the same MATLAB path.
We have considered above steps while tagging the Requirement1, Requirement2 and Requirement3 and the same are as under;
Tagging for Requirement1 :-


Tagging for Requirement2 :-


Tagging for Requirement3:-


Steps for Checking MAB Guidelines in Model Advisor :-
Step 1:-
We have to go into 'Modelling option' and then select 'Model Advisor'

Step 2:-
We have to choose the system for checking Mathworks Automotive Advisory Board (MAB or MAAB) guidelines. In this case, we are checking full system check as under as per MAB guidelines;

Step 3 :-
Model Advisor Check as per MAB guidelines has been done before AUTOSAR code generation to make sure that model is error free.
Therafter, we have to select as per Modelling standards for MAB guidelines. Then, we have to click on 'Run Selected Check' option.
After running the model as per MAB Guidelines, we observed that it is sucessfully passed with value of 122 and total 22 nos. of warnings. However, there is no fail condition. Hence, we can conclude that above model is technically/logically correct.
The same is as under;

After successful running of model as per MAB guidelines, we observed that guideline report is generated in the same Matlab folder path. (The same is attached)
The screenshot for Model Advisor Report as per MAB guidelines/rules are as under;

Steps for Generation of Autosar Code from model:-
Step 1 :-
Go to Apps section and under Code Generation section, select Autosar Component Designer option.

Step 2 :-
Then, under AUTOSAR section, Click on Quick start option to see if there is any error in the model also it will automatically manage model configuration settings to generate code that is AUTOSAR compilant. If there is no error found, then AUTOSAR code is generated.


We have choose the entire model and click on Next option as under;

Then, select the output as C code compliant with AUTOSAR as under;

Then, selected Execution efficiency as important code generation objective as under;

Code Generation is completed for the particular model and the code generation file is store in the MATLAB folder;

After AUTOSAR code generation, highway_lane_changing_assistant_autosar_rtw folder is automatically created in the MATLAB folder as under;
The autogenerated code generation folder contains .c, .h and .arxml file.



Code Generation Report :-

Screenshot for Generated Autosar Code is as under;

Generated AUTOSAR code is as under;
/*
* Trial License - for use to evaluate programs for possible purchase as
* an end-user only.
*
* File: highway_lane_changing_assistant.c
*
* Code generated for Simulink model 'highway_lane_changing_assistant'.
*
* Model version : 1.27
* Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
* C/C++ source code generated on : Mon Feb 14 12:47:23 2022
*
* Target selection: autosar.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives:
* 1. Execution efficiency
* 2. RAM efficiency
* Validation result: Not run
*/
#include "highway_lane_changing_assistant.h"
/* Named constants for Chart: '/Chart' */
#define IN_Condition_1 ((uint8)1U)
#define IN_Condition_2 ((uint8)2U)
/* Block signals and states (default storage) */
DW rtDW;
/* Model step function */
void New1(void)
{
sint32 tmp;
uint8 rtb_Highway_Display_Mode_1;
uint8 rtb_Highway_Display_Mode_3;
uint8 rtb_Lane_Display_Mode_1;
uint8 rtb_Lane_Display_Mode_2;
uint8 rtb_Lane_Display_Mode_3;
uint8 rtb_Lane_Display_Mode_4;
/* Chart: '/Chart' incorporates:
* Inport: '/Enable_Display'
* Inport: '/Highway_Input_Signal'
* Inport: '/Input_Switch'
*/
if (rtDW.is_active_c3_highway_lane_chang == 0U) {
rtDW.is_active_c3_highway_lane_chang = 1U;
rtDW.is_c3_highway_lane_changing_ass = IN_Condition_1;
rtb_Highway_Display_Mode_1 = 232U;
rtb_Highway_Display_Mode_3 = 41U;
} else if (rtDW.is_c3_highway_lane_changing_ass == IN_Condition_1) {
rtb_Highway_Display_Mode_1 = 232U;
rtb_Highway_Display_Mode_3 = 41U;
if ((Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Highway_Input_Signal_DE_Highway_Input_Signal
() == 1) &&
(Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Enable_Display_DE_Enable_Display
() == 1) &&
(Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Input_Switch_DE_Input_Switch
() == 1)) {
rtDW.is_c3_highway_lane_changing_ass = IN_Condition_2;
rtb_Highway_Display_Mode_1 = 213U;
rtb_Highway_Display_Mode_3 = 9U;
}
} else {
/* case IN_Condition_2: */
rtb_Highway_Display_Mode_1 = 213U;
rtb_Highway_Display_Mode_3 = 9U;
if ((Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Highway_Input_Signal_DE_Highway_Input_Signal
() == 1) &&
(Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Enable_Display_DE_Enable_Display
() == 0) &&
(Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Input_Switch_DE_Input_Switch
() == 1)) {
rtDW.is_c3_highway_lane_changing_ass = IN_Condition_1;
rtb_Highway_Display_Mode_1 = 232U;
rtb_Highway_Display_Mode_3 = 41U;
}
}
/* End of Chart: '/Chart' */
/* Chart: '/Chart' incorporates:
* Inport: '/Enable_Display'
* Inport: '/Input_Switch'
* Inport: '/Lane_Input_Signal'
*/
if (rtDW.is_active_c1_highway_lane_chang == 0U) {
rtDW.is_active_c1_highway_lane_chang = 1U;
rtDW.is_c1_highway_lane_changing_ass = IN_Condition_1;
rtb_Lane_Display_Mode_1 = 132U;
rtb_Lane_Display_Mode_2 = 185U;
rtb_Lane_Display_Mode_3 = 54U;
rtb_Lane_Display_Mode_4 = 67U;
} else if (rtDW.is_c1_highway_lane_changing_ass == IN_Condition_1) {
rtb_Lane_Display_Mode_1 = 132U;
rtb_Lane_Display_Mode_2 = 185U;
rtb_Lane_Display_Mode_3 = 54U;
rtb_Lane_Display_Mode_4 = 67U;
if ((Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Lane_Input_Signal_DE_Lane_Input_Signal
() == 6) &&
(Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Enable_Display_DE_Enable_Display
() == 1) &&
(Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Input_Switch_DE_Input_Switch
() == 1)) {
rtDW.is_c1_highway_lane_changing_ass = IN_Condition_2;
rtb_Lane_Display_Mode_1 = 127U;
rtb_Lane_Display_Mode_2 = 248U;
rtb_Lane_Display_Mode_3 = 186U;
rtb_Lane_Display_Mode_4 = 84U;
}
} else {
/* case IN_Condition_2: */
rtb_Lane_Display_Mode_1 = 127U;
rtb_Lane_Display_Mode_2 = 248U;
rtb_Lane_Display_Mode_3 = 186U;
rtb_Lane_Display_Mode_4 = 84U;
if ((Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Lane_Input_Signal_DE_Lane_Input_Signal
() == 6) &&
(Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Enable_Display_DE_Enable_Display
() == 0) &&
(Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Input_Switch_DE_Input_Switch
() == 1)) {
rtDW.is_c1_highway_lane_changing_ass = IN_Condition_1;
rtb_Lane_Display_Mode_1 = 132U;
rtb_Lane_Display_Mode_2 = 185U;
rtb_Lane_Display_Mode_3 = 54U;
rtb_Lane_Display_Mode_4 = 67U;
}
}
/* End of Chart: '/Chart' */
/* Switch: '/Switch' incorporates:
* Inport: '/Highway_Input_Signal'
* Switch: '/Switch1'
* Switch: '/Switch2'
*/
tmp =
Rte_IRead_HighwayLaneChanging_Assistant_10ms_Rp_Highway_Input_Signal_DE_Highway_Input_Signal
();
if (tmp != 0) {
/* Outport: '/Display_Mode_1' */
Rte_IWrite_HighwayLaneChanging_Assistant_10ms_Pp_Display_Mode_1_DE_Display_Mode_1
(rtb_Highway_Display_Mode_1);
rtb_Lane_Display_Mode_2 = 183U;
} else {
/* Outport: '/Display_Mode_1' */
Rte_IWrite_HighwayLaneChanging_Assistant_10ms_Pp_Display_Mode_1_DE_Display_Mode_1
(rtb_Lane_Display_Mode_1);
}
/* End of Switch: '/Switch' */
/* Outport: '/Display_Mode_2' */
Rte_IWrite_HighwayLaneChanging_Assistant_10ms_Pp_Display_Mode_2_DE_Display_Mode_2
(rtb_Lane_Display_Mode_2);
/* Switch: '/Switch2' incorporates:
* Switch: '/Switch3'
*/
if (tmp != 0) {
/* Outport: '/Display_Mode_3' */
Rte_IWrite_HighwayLaneChanging_Assistant_10ms_Pp_Display_Mode_3_DE_Display_Mode_3
(rtb_Highway_Display_Mode_3);
rtb_Lane_Display_Mode_4 = 94U;
} else {
/* Outport: '/Display_Mode_3' */
Rte_IWrite_HighwayLaneChanging_Assistant_10ms_Pp_Display_Mode_3_DE_Display_Mode_3
(rtb_Lane_Display_Mode_3);
}
/* Outport: '/Display_Mode_4' */
Rte_IWrite_HighwayLaneChanging_Assistant_10ms_Pp_Display_Mode_4_DE_Display_Mode_4
(rtb_Lane_Display_Mode_4);
}
/* Model initialize function */
void New(void)
{
/* (no initialization code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/
Conclusion :-
- A model is developed in MATLAB Simulink Environment for implementing the logic of Highway Lane Changing Assistant Feature as per Model Based Development Guidelines.
- Creation of Simulink Data Dictionary (SLDD) file and linked that SLDD file to the Simulink Model.
- Creating AUTOSAR dictionary for all input and output signals by creating Sender ports, Receiver ports, S-R interfaces & Data Elements, Runnable events and mapped those to the AUTOSAR compilant model.
- Successful Tagging has been done for Requirement no. 1, Requirement no.2 and Requirement no. 3.
- Model Advisor check as per MAB guideline has been conducted for the developed model.
- AUTOSAR Code Generation for the developed model.