Electronic device with a motion sensor
In a head-mounted device, position and motion sensors may be included to determine the orientation of the head-mounted device. A motion sensor may experience error that accumulates over time, sometimes referred to as drift. To mitigate the effect of drift in a motion sensor, a reference orientation for the motion sensor may be reset when a qualifying motion is detected. The qualifying motion may be detected using one or more criteria such as a total change in angular orientation or rate of change in angular orientation. The reference orientation for the motion sensor may also be reset when a duration of time elapses without a qualifying motion being detected.
1 . An electronic device comprising:
one or more motion sensors;
one or more processors; and
memory storing instructions configured to be executed by the one or more processors, the instructions for:
setting a reference orientation to a first baseline;
obtaining, from the one or more motion sensors, motion data representative of a motion of the electronic device;
in accordance with detecting a rotational motion gesture based on the motion defined relative to the reference orientation, resetting the reference orientation to a second baseline;
while the reference orientation is set to the second baseline, obtaining, from the one or more motion sensors, motion data representative of an additional motion of the electronic device; and in accordance with detecting an additional rotational motion gesture based on the additional motion defined relative to the reference orientation, resetting the reference orientation to a third baseline.
2 . The electronic device defined in claim 1 , wherein detecting the rotational motion gesture comprises detecting a total magnitude of rotational motion exceeding a threshold magnitude.
3 . The electronic device defined in claim 1 , wherein detecting the rotational motion gesture comprises detecting a magnitude of a rate of rotation exceeding a threshold magnitude.
4 . The electronic device defined in claim 1 , wherein the instructions further comprise instructions for:
in accordance with a duration of time passing without detecting a rotational motion gesture, resetting the reference orientation to a fourth baseline, wherein the duration of time is greater than 5 seconds.
5 . The electronic device defined in claim 1 , wherein the one or more motion sensors comprises an inertial measurement unit, a gyroscope, an accelerometer, or a magnetometer.
6 . The electronic device defined in claim 1 , further comprising:
one or more output devices, wherein the instructions further comprise instructions for:
in accordance with detecting the rotational motion gesture based on the motion defined relative to the reference orientation, presenting content using the one or more output devices, wherein the one or more output devices comprises a speaker, a haptic output device, or a display.
7 . The electronic device defined in claim 1 , wherein the instructions further comprise instructions for:
filtering the motion data representative of the motion of the electronic device, wherein filtering the motion data comprises applying a high-pass filter to the motion data.
8 . A method of operating an electronic device that comprises one or more motion sensors, the method comprising:
setting a reference orientation to a first baseline;
obtaining, from the one or more motion sensors, motion data representative of a motion of the electronic device;
in accordance with detecting a rotational motion gesture based on the motion defined relative to the reference orientation, resetting the reference orientation to a second baseline;
while the reference orientation is set to the second baseline, obtaining, from the one or more motion sensors, motion data representative of an additional motion of the electronic device; and
in accordance with detecting an additional rotational motion gesture based on the additional motion defined relative to the reference orientation, resetting the reference orientation to a third baseline.
9 . The method defined in claim 8 , wherein detecting the rotational motion gesture comprises detecting a total magnitude of rotational motion exceeding a threshold magnitude.
10 . The method defined in claim 8 , wherein detecting the rotational motion gesture comprises detecting a magnitude of a rate of rotation exceeding a threshold magnitude.
11 . The method defined in claim 8 , further comprising:
in accordance with a duration of time passing without detecting a rotational motion gesture, resetting the reference orientation to a fourth baseline, wherein the duration of time is greater than 5 seconds.
12 . The method defined in claim 8 , wherein the one or more motion sensors comprises an inertial measurement unit, a gyroscope, an accelerometer, or a magnetometer.
13 . The method defined in claim 8 , wherein the electronic device comprises one or more output devices and wherein the method further comprises:
in accordance with detecting the rotational motion gesture based on the motion defined relative to the reference orientation, presenting content using the one or more output devices, wherein the one or more output devices comprises a speaker, a haptic output device, or a display.
14 . The method defined in claim 8 , further comprising:
filtering the motion data representative of the motion of the electronic device, wherein filtering the motion data comprises applying a high-pass filter to the motion data.
15 . A non-transitory computer-readable storage medium storing one or more programs configured to be executed by one or more processors of an electronic device that comprises one or more motion sensors, wherein the one or more programs include instructions for:
setting a reference orientation to a first baseline;
obtaining, from the one or more motion sensors, motion data representative of a motion of the electronic device;
in accordance with detecting a rotational motion gesture based on the motion defined relative to the reference orientation, resetting the reference orientation to a second baseline;
while the reference orientation is set to the second baseline, obtaining, from the one or more motion sensors, motion data representative of an additional motion of the electronic device; and
in accordance with detecting an additional rotational motion gesture based on the additional motion defined relative to the reference orientation, resetting the reference orientation to a third baseline.
16 . The non-transitory computer-readable storage medium defined in claim 15 , wherein detecting the rotational motion gesture comprises detecting a total magnitude of rotational motion exceeding a threshold magnitude.
17 . The non-transitory computer-readable storage medium defined in claim 15 , wherein detecting the rotational motion gesture comprises detecting a magnitude of a rate of rotation exceeding a threshold magnitude.
18 . The non-transitory computer-readable storage medium defined in claim 15 , wherein the instructions further comprise instructions for:
in accordance with a duration of time passing without detecting a rotational motion gesture, resetting the reference orientation to a fourth baseline, wherein the duration of time is greater than 5 seconds.
19 . The non-transitory computer-readable storage medium defined in claim 15 , wherein the one or more motion sensors comprises an inertial measurement unit, a gyroscope, an accelerometer, or a magnetometer.
20 . The non-transitory computer-readable storage medium defined in claim 15 , wherein the electronic device comprises one or more output devices and wherein the instructions further comprise instructions for:
in accordance with detecting the rotational motion gesture based on the motion defined relative to the reference orientation, presenting content using the one or more output devices, wherein the one or more output devices comprises a speaker, a haptic output device, or a display.
21 . The non-transitory computer-readable storage medium defined in claim 15 , wherein the instructions further comprise instructions for:
filtering the motion data representative of the motion of the electronic device, wherein filtering the motion data comprises applying a high-pass filter to the motion data.