Vehicle Abstraction Example#
Attention
To demonstrate the independence of the vehicle-function implementation from the underlying vehicle platform.
Note
<output-folder>/examples/bin:Hint
The Vehicle Function will show the speed value on different levels of the component stack:
The user can select between 2 different asc files. The first contains the CAN messages for the speed in km/h, the other in m/S unit.
The data shown via dispatch service is either in km/h or m/s.
The second component is the platform abstraction. There are 2 components in the example. Both have the same interface as output: speed in km/h. Therefore one component needs to convert the data, the other component can pass the data directly.
There is only one sensor component necessary as both platform abstraction components offer the speed in km/h.
Vehicle 1 would have the platform abstraction in km/m, vehicle 2 would need the component which converts from m/s to km/h.
A vehicle function requiring the speed in km/h would run on both vehicles and would not need to have any logic for the input data.
sdv::EObjectType |
ID |
Main category |
Sub category |
Note |
::undefined |
0 |
Not defined |
||
::system_object |
1 |
System object |
||
::device ::platform_abstraction ::vehicle_bus |
10 11 12 |
Device category 10..19 |
Platform abstraction Vehicle bus abstraction |
|
::basic_service ::sensor ::actuator |
20 21 22 |
Basic service category 20 - 29 |
Sensor object Actuator object |
|
::complex_service ::vehicle_function |
30 31 |
Complex service category 30 - 39 |
Vehicle function |
Runs in isolated mode Runs in isolated mode |
::application |
50 |
Application |
||
::proxy ::stub |
100 101 |
Proxy object Stub object |
||
::utility |
1000 |
Utility object |
See also
The different component types: Enum EObjectType
See the auto generated code in ..examples/vehicle_abstraction_example/generated
You will find 2 components: the platform abstraction component in folder vd_vehiclespeedkmh and the sensor device in folder bs_vehiclespeed.
The auto generated code in ..examples/vehicle_abstraction_example/generated2 contains only the second platform abstraction component vd_vehiclespeedms. This component has to convert the input data from m/s to km/h. The output interface is identical to the first component.
Hint
Compare the content of vehicle_abstraction_example.csv and vehicle_abstraction_example_ms.csv