summaryrefslogtreecommitdiff
path: root/sensors-service/api/franca/Acceleration.fidl
blob: 84130d8a1d7b23c0f16834b6e667448d485d854a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/*  SPDX-License-Identifier: MPL-2.0
    Component Name: SensorsService
    Compliance Level: Abstract Component
    Copyright (C) 2018, BMW Car IT GmbH, Continental Automotive GmbH, Groupe PSA, XS Embedded GmbH
    License:
    This Source Code Form is subject to the terms of the
    Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
    this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package org.genivi.SensorsService

import org.genivi.SensorsService.SensorsServiceTypes.* from "SensorsServiceTypes.fidl"

<** @description : Acceleration = This interface offers functionalities to retrieve the Acceleration of the vehicle **>
interface Acceleration {
	version {
	    major 5
	    minor 0
	}

	<** @description: 
	Accelerometer type
	TAccelerationConfiguration::typeBits provides information about the type of the accelerometer and the interpretation of the signals.
	It is a or'ed bitmask of the EAccelerationTypeBits values.
	**>
	enumeration EAccelerationTypeBits{
	   	<** @description:  An acceleration measurement for the x-axis is provided.
	  	**>
	    ACCELERATION_X_PROVIDED             = 1 //0x00000001
	   	<** @description:  An acceleration measurement for the y-axis is provided.
	  	**>    
	    ACCELERATION_Y_PROVIDED             = 2 //0x00000002
	   	<** @description:  An acceleration measurement for the z-axis is provided.
	  	**>    
	    ACCELERATION_Z_PROVIDED             = 4 //0x00000004
	   	<** @description:  A measurement for the temperature is provided.
	  	**>
	    ACCELERATION_TEMPERATURE_PROVIDED   = 8 //0x00000008
	}

	<** @description: 
	TAccelerationData::validityBits provides information about the currently valid signals of the acceleration data.
	It is a or'ed bitmask of the EAccelerationValidityBits values.
	Note: 
	- The general availability of the signals is provided per TAccelerationConfiguration::typeBits. 
	- If a signal is generally provided but temporarily not available, then the corresponding typeBit will be set but not the validityBit 
	**>
	enumeration EAccelerationValidityBits{
	    <** @description:  Validity bit for field TAccelerationData::x.
	   	**>    
	    ACCELERATION_X_VALID                = 1 //0x00000001
	    <** @description:  Validity bit for field TAccelerationData::y.
	   	**>
	    ACCELERATION_Y_VALID                = 2 //0x00000002
	    <** @description:  Validity bit for field TAccelerationData::z.
	   	**>
	    ACCELERATION_Z_VALID                = 4 //0x00000004
	    <** @description:  Validity bit for field TAccelerationData::temperature.
	   	**>
	    ACCELERATION_TEMPERATURE_VALID      = 8 //0x00000008
	    <** @description:  Validity bit for field TAccelerationData::measurementInterval.
	   	**>
	    ACCELERATION_MEASINT_VALID          = 16 //0x00000010    
	} 

	<** @description: 
	The AccelerationData delivers the sensor values of the accelerometer.
	The coordinate system is the axis system of the accelerometer sensor, 
	i.e. the x, y, z values are raw measurements 
	without any conversion except probably averaging of multiple 
	sensor readings over the measurement interval.

	see TAccelerationConfiguration for an explanation how to convert these values to the vehicle axis system

	It is possible that not all values are populated, e.g. when only a 1-axis accelerometer is used.
	You must check the valid bits before usage.
	**>
	struct TAccelerationData{
	    <** @description:  Timestamp of the acquisition of the accelerometer signal [ms].
	   	All sensor/GNSS timestamps must be based on the same time source.
	   	**>
	    UInt64 timestamp
	    <** @description:  The acceleration in direction of the X-axis of the accelerometer sensor [m/s^2].
	   	**>
	    Float x
	    <** @description:  The acceleration in direction of the Y-axis of the accelerometer sensor [m/s^2].
	   	**>
	    Float y
	    <** @description:  The acceleration in direction of the Z-axis of the accelerometer sensor [m/s^2].
	   	**>
	    Float z
	    <** @description:  Temperature reading of the accelerometer sensor.
	   	If available it can be used for temperature compensation. 
	   	The measurement unit is unspecified. 
	   	Degrees celsius are preferred but any value linearly dependent on the temperature is fine.
	   	**>
	    Float temperature
	    <** @description:  Measurement interval over which the accelerometer signal has been acquired.
	   	Unit: micro-seconds [us].
	   	This may slightly differ from the timestamp difference,
	   	e.g. in case of transmission jitter before timestamping.
	   	Providing the measurement interval allows thus 
	   	- a more accurate integration of accelerometer measurements.
	   	- correct usage of the first sample
	   	- adding consistency checks
	   	**>
	    UInt32 measurementInterval
	    <** @description:  Bit mask indicating the validity of each corresponding value.
	   	[bitwise or'ed EAccelerationValidityBits values].
	   	Must be checked before usage.
	   	**>
	    UInt32 validityBits
	}

	<** @description: 
	Initialization of the acceleration sensor service.
	Must be called before using the acceleration sensor service to set up the service.
	**>
	method init {
	    out {
			<** @description: initialized = Is true if initialization has been successfull **>
			Boolean initialized
		}
	}

	<** @description: 
	Destroy the acceleration sensor service.
	Must be called after using the acceleration sensor service to shut down the service.
	**>
	method destroy {
	    out {
			<** @description: destroyed = Is true if shutdown has been successfull. **>
			Boolean destroyed
		}
	}

	<** @description: getMetaData = get the meta information about acceleration service.
	The meta data of a sensor service provides information about it's name, version, type, subtype, sampling frequency etc.
	**>
	method getMetaData {
	    out {
	        TSensorMetaData data
			<** @description: available = Is true if meta data is available **>
			Boolean available
		}
	}

	<** @description: getAccelerationData = get the acceleration data at a specific point in time. 
	All valid flags are updated. The data is only guaranteed to be updated when the valid flags are true.
	**>
	method getAccelerationData {
	    out {
	        TAccelerationData accelerationData
			<** @description: available = Is true if data can be provided and false otherwise, e.g. missing initialization **>
			Boolean available
		}
	}

	<** @description: getAccelerationDataList = get a list of acceleration data. 
	may return buffered data (numElements >1) for different reasons
	  for (large) portions of data buffered at startup
	  for data buffered during regular operation e.g. for performance optimization (reduction of callback invocation frequency)
	If the array contains (numElements >1), the elements will be ordered with rising timestamps
	accelerationData pointer to an array of TAccelerationData with size numElements
	**>
	method getAccelerationDataList {
	    out {
	        TAccelerationData[] accelerationData
			<** @description: numElements = allowed range: >=1. If numElements >1, buffered data are provided.**>
			UInt16 numElements
		}
	}

	<** @description: notifyAccelerationDataChanged
	The signal will be emitted when new acceleration data is available.
	All valid flags are updated. The data is only guaranteed to be updated when the valid flags are true.
	**>
	broadcast notifyAccelerationDataChanged selective {   	
	    out {
	        TAccelerationData[] accelerationData
			UInt16              numElements
		}
	}

	<** @description: getStatus = get the acceleration sensor status at a specific point in time. **>
	method getStatus {
	    out {
	        TSensorStatus status
			<** @description: available = Is true if data can be provided and false otherwise, e.g. missing initialization **>
			Boolean available
		}
	}

	<** @description: notifyStatusChanged
	The signal will be emitted when new acceleration sensor status data is available.
	**>
	broadcast notifyStatusChanged selective {   	
	    out {
			TSensorStatus status
	   	}
	}
		
}