/* 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 : Gyroscope = This interface offers functionalities to retrieve the gyroscope data of the vehicle **> interface Gyroscope { version { major 5 minor 0 } <** @description: TGyroscopeData::validityBits provides information which fields in TGyroscopeData contain valid measurement data. It is a or'ed bitmask of the EGyroscopeValidityBits values. Note: - The general availability of the signals is provided per TGyroscopeConfiguration::typeBits. - If a signal is generally provided but temporarily not available then the corresponding typeBit will be set but not the validityBit **> enumeration EGyroscopeValidityBits { <** @description: Validity bit for field TGyroscopeData::yawRate. **> GYROSCOPE_YAWRATE_VALID = 1 //0x00000001 <** @description: Validity bit for field TGyroscopeData::pitchRate. **> GYROSCOPE_PITCHRATE_VALID = 2 //0x00000002 <** @description: Validity bit for field TGyroscopeData::rollRate. **> GYROSCOPE_ROLLRATE_VALID = 4 //0x00000004 <** @description: Validity bit for field TGyroscopeData::temperature. **> GYROSCOPE_TEMPERATURE_VALID = 8 //0x00000008 <** @description: Validity bit for field TGyroscopeData::measurementInterval. **> GYROSCOPE_MEASINT_VALID = 16 //0x00000010 } <** @description: The GyroscopeData delivers the sensor values of the gyroscope. The coordinate system is the axis system of the gyroscope sensor i.e. the yawRate pitchRate rollRate values are raw measurements without any conversion except probably averaging of multiple sensor readings over the measurement interval. see TGyroscopeConfiguration 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 gyroscope is used. You must check the valid bits before usage. **> struct TGyroscopeData { <** @description: Timestamp of the acquisition of the gyroscope signal [ms]. All sensor/GNSS timestamps must be based on the same time source. **> UInt64 timestamp <** @description: Current angular rate measurement around the z/yaw-axis of the gyroscope sensor [degree/s]. Value range -100 / +100 degree/s. Frequency of at least 5Hz. Preferrably 50Hz. A rotation to the left is indicated by a positive sign _if_ gyroscope axes are aligned with vehicle axes i.e. if all euler angles are zero in TGyroscopeConfiguration. **> Float yawRate <** @description: Current angular rate measurement around the y/pitch-axis of the gyroscope sensor [degree/s]. Value range -100 / +100 degree/s. Frequency of at least 5Hz. Preferrably 50Hz. A rotation front down is indicated by a positive sign _if_ gyroscope axes are aligned with vehicle axes i.e. if all euler angles are zero in TGyroscopeConfiguration. **> Float pitchRate <** @description: Current angular rate measurement around the x/roll-axis of the gyroscope sensor [degree/s]. Value range -100 / +100 degree/s. Frequency of at least 5Hz. Preferrably 50Hz. A rotation right down is indicated by a positive sign _if_ gyroscope axes are aligned with vehicle axes i.e. if all euler angles are zero in TGyroscopeConfiguration. **> Float rollRate <** @description: Temperature reading of the gyroscope 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 gyroscope 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 gyroscope 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 EGyroscopeValidityBits values]. Must be checked before usage. **> UInt32 validityBits } <** @description: getGyroscopeData = get the gyroscope data at a specific point in time. Be careful when using this method to read data often enough as gyro data are rotation rates per second. The recommended usage for the gyroscope data is the callback interface. PC: get on notification The get method is provided for consistency reasons of the sensor service API and might be used for determining the rotation rate in certain situations. All valid flags are updated. The data is only guaranteed to be updated when the valid flags are true. **> method getGyroscopeData { out { TGyroscopeData gyroData <** @description: available = Is true if data can be provided and false otherwise, e.g. missing initialization **> Boolean available } } <** @description: getGyroscopeDataList = get a list of gyroscope 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 gyroData pointer to an array of TGyroscopeData with size numElements **> method getGyroscopeDataList { out { TGyroscopeData[] gyroData <** @description: numElements = allowed range: >=1. If numElements >1, buffered data are provided.**> UInt16 numElements } } <** @description: notifyGyroscopeDataChanged The signal will be emitted when new gyroscope data is available. All valid flags are updated. The data is only guaranteed to be updated when the valid flags are true. **> broadcast notifyGyroscopeDataChanged selective { out { TGyroscopeData[] gyroData <** @description: numElements = allowed range: >=1. If numElements >1, buffered data are provided.**> UInt16 numElements } } <** @description: Initialization of the gyroscope sensor service. Must be called before using the gyroscope 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 gyroscope 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 gyroscope 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: getStatus = get the gyroscope 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 gyroscope sensor status data is available. **> broadcast notifyStatusChanged selective { out { TSensorStatus status } } }