gyroscope_angle¶
Source code: gyroscope_angle.py
A factory test for gyroscopes.
Description¶
- There are steps required to run a complete gyroscope test::
Motion sensor setup via ectool motionsense odr ${gyro_id} ${freq}
(optional) Calibration for tri-axis (x, y, and z) gyroscopes.
The main gyroscope test.
This pytest executes the motion sensor setup and main gyro test in sequence.
Test Procedure¶
This test supports and enables auto start by default. In this case:
Put the device (base/lid) on a static plane then press space.
Wait for completion.
Otherwise operators will be asked to place DUT on a horizontal plane and press space.
Dependency¶
Device API (
cros.factory.device.gyroscope
).
Examples¶
To run the test on base gyroscope:
{
"pytest_name": "gyroscope_angle",
"label": "Gyroscope Angle",
"run_if": "not constants.has_device_data or device.component.has_base_gyroscope",
"related_components": [
"test_tags.TestCategory.ACCELEROMETER"
],
"args": {
"rotation_threshold": 90,
"stop_threshold": 0.1
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
rotation_threshold |
int |
(optional; default: |
stop_threshold |
float |
The expected value to read when dut stop moving. |
gyro_id |
int, None |
(optional; default: |
freq |
int, None |
(optional; default: |
timeout_secs |
int |
(optional; default: |
setup_time_secs |
int |
(optional; default: |
autostart |
bool |
(optional; default: |
setup_sensor |
bool |
(optional; default: |
location |
[‘base’, ‘lid’] |
(optional; default: |
capture_count |
int |
(optional; default: |
sample_rate |
int |
(optional; default: |