Sensors
Overview
The SDK handles the glasses sensors via the IEvsSensorsService
interface (received from the Evs.instance().sensors()
method).
The following glasses sensors exists, and are handled by the SDK:
Sensor | Description |
---|---|
Touch | Touch pad on the right glasses temple arm. The SDK sends touch gestures when occurred |
Proximity | Used for detecting if the glasses are off\on the face. The SDK sends on\off trigger when relevant |
Ambient | Used for measuring daylight. The SDK sends the measured information for the application to act. Also it is used by the auto brightness mechanism |
Gyroscope | For measuring or maintaining orientation and angular velocity |
Magnetometer | Measures changes in the Earth's magnetic field |
Accelerometer | Measures acceleration |
The SDK enables to disable\enable each sensor (except the proximity) and to consume the sensor data.
All sensors, except proximity, are disabled by default when the glasses are turned on.
Touch
The touch sensor is located on the right glasses temple.
Enabling the touch is done via IEvsSensorsService.enableTouch
The touch events can be received using the IEvsGlassesStateService.registerGlassesEvents
or by overriding the Screen.onTouch
.
When enabled following discrete touch events are available:
Touch Gesture | Description |
---|---|
backward | backward swipe |
forward | forward swipe |
tap | tapping the touch pad |
longTap | long pressing the touch pad |
Proximity
The proximity sensor enable to detect if the glasses are on of off the face.
The proximity events can be received using the IEvsSensorsService.registerSensorsEvents
.
The following proximity events are available:
Touch Gesture | Description |
---|---|
offFace | Indicates the glasses are off face |
onFace | Indicates the glasses are on face (proximity sensor is triggered) |
Ambient
The ambient sensor is used for measuring daylight.
Enabling the ambient is done via IEvsSensorsService.enableAmbient
The ambient events can be received using the IEvsSensorsService.registerSensorsEvents
.
When enabled the IEvsSensorsEvents.onAmbient
will be triggered, with the ambient sensor reading in lux.
Inertial Sensors
The glasses inertial sensors includes Gyroscope, Magnetometer and Accelerometer.
Using the SDK, the sensors can be enabled and consumed in the following ways:
Type | Description |
---|---|
Base Sensors | the sensor x,y,z values are corrected according the the glasses calibration parameters |
Fused (Composite) | all sensors are fused and the SDK supplies the calibrated Quaternion or YPR information |
Coordinate System
The sensors axes are as follows:
Sensors Rate and Rendering Rate
When the inertial sensors are active, they are capturing data at the requested SensorRate
.
To optimize the usage of the Bluetooth channel, the collected sensor information is sent from the glasses to the SDK in batches at the requested Screen.ScreenRenderRate
interval.
As a result, when you register for one of the sensor event interfaces, the event will be triggered before the rendering cycle, and it may be called multiple times to report each of the collected sensor data within the batch.
The Gyroscope and the Accelerometer using the same underling physical device, hence must be enabled with the same rate.
The Magnetometer rate must be lower then the Gyroscope\Accelerometer rate.
About Sensor Rates
Currently only SensorRate.rate0 and SensorRate.rate1 are operational (the rest are experimental)
See the Sensor Service API Reference for more information
Base Sensors
The calibrated sensors can be received using the IEvsSensorsService.registerInertialSensorsEvents
.
In order to receive a calibrated sensors you should:
- Register to the required sensor(s) via
IEvsSensorsService.registerInertialSensorsEvents
- Enable the required sensor(s) via
IEvsSensorsService.enableGyro
,IEvsSensorsService.enableMagnetometer
,IEvsSensorsService.enableAccelerometer
Measurement units
Sensors | Units | Description |
---|---|---|
Accelerometer | m/s^2 | meter/(second^2) |
Magnetometer | mGauss | milli-Gauss |
Gyroscope | rad/s | radians/seconds |
Don't forget to disable the sensor and to unregister the events when they are not required.
Fused (Composite)
The fused sensors can be received as Quaternion or YPR.
In order to receive the fused sensors information you should:
- Register to the required interface via
IEvsSensorsService.registerYprSensorsEvents
,IEvsSensorsService.registerQuaternionSensorsEvents
- Enable the sensors fusion via
IEvsSensorsService.enableSensorsFusion
Enabling the sensors fusion will enable the glasses Gyroscope, Magnetometer, Accelerometer and will start the fusion algorithm process.
Don't forget to disable the sensor fusion and to unregister the events when they are not required.
Sensor Calibration
To ensure optimal performance, the sensors should be calibrated under the following conditions:
- First-time use
- Every two weeks
- As required
Calibration Process
Everysight Calibration
It's highly recommended to use our stock UI which handles all the calibration flow:
Manual Calibration
For advanced users who prefer to manually handle the calibration process, you can register the sensor events and monitor the calibration status.
Evs.instance().sensors().registerYprSensorsEvents(object : IEvsYprSensorsEvents {
override fun onYpr(timestampMs: Long, yprData: YprData, calibrationStatus: CalibrationStatus) {
when (calibrationStatus) {
CalibrationStatus.Calibrated -> TODO()
CalibrationStatus.InProgress -> TODO()
CalibrationStatus.Required -> TODO()
}
}
})
class YprSensorEventHandler: IEvsYprSensorsEvents {
func onYpr(timestampMs: Int64, yprData: YprData, calibrationStatus: CalibrationStatus) {
switch calibrationStatus {
case .calibrated:
// TODO
break
case .inprogress:
// TODO
break
case .required:
// TODO
break
default:
break
}
}
}
Evs.instance().sensors().registerYprSensorsEvents(listener: YprSensorEventHandler())
Read Next
Learn about the Simulator