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: 1. Put the device (base/lid) on a static plane then press space. 2. 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: .. test_list:: generic_ec_component_accel_examples:AccelerometerIMUTests.GyroscopeAngle Test Arguments -------------- .. list-table:: :widths: 20 10 60 :header-rows: 1 :align: left * - Name - Type - Description * - rotation_threshold - int - (optional; default: ``90``) The expected rotating degree for the dut to reach during rotation. * - stop_threshold - float - The expected value to read when dut stop moving. * - gyro_id - int, None - (optional; default: ``None``) Gyroscope ID. Will read a default ID via ectool if not set. * - freq - int, None - (optional; default: ``None``) Gyroscope sampling frequency in mHz. Will apply the minimal frequency from ectool info if not set. * - timeout_secs - int - (optional; default: ``60``) Timeout in seconds for gyro to return expected value. * - setup_time_secs - int - (optional; default: ``2``) Seconds to wait before starting the test. * - autostart - bool - (optional; default: ``False``) Auto start this test. * - setup_sensor - bool - (optional; default: ``True``) Setup gyro sensor via ectool * - location - ['base', 'lid'] - (optional; default: ``'base'``) Gyro is located in "base" or "lid". * - capture_count - int - (optional; default: ``40``) How many records to read for each time getting data * - sample_rate - int - (optional; default: ``200``) Sample rate in Hz to read data from sensors