@@ -186,37 +186,38 @@ def _reset(self):
186
186
@property
187
187
def mode (self ):
188
188
"""
189
- legend: x=on, -=off
190
-
191
- +------------------+-------+---------+------+----------+
192
- | Mode | Accel | Compass | Gyro | Absolute |
193
- +==================+=======+=========+======+==========+
194
- | CONFIG_MODE | - | - | - | - |
195
- +------------------+-------+---------+------+----------+
196
- | ACCONLY_MODE | X | - | - | - |
197
- +------------------+-------+---------+------+----------+
198
- | MAGONLY_MODE | - | X | - | - |
199
- +------------------+-------+---------+------+----------+
200
- | GYRONLY_MODE | - | - | X | - |
201
- +------------------+-------+---------+------+----------+
202
- | ACCMAG_MODE | X | X | - | - |
203
- +------------------+-------+---------+------+----------+
204
- | ACCGYRO_MODE | X | - | X | - |
205
- +------------------+-------+---------+------+----------+
206
- | MAGGYRO_MODE | - | X | X | - |
207
- +------------------+-------+---------+------+----------+
208
- | AMG_MODE | X | X | X | - |
209
- +------------------+-------+---------+------+----------+
210
- | IMUPLUS_MODE | X | - | X | - |
211
- +------------------+-------+---------+------+----------+
212
- | COMPASS_MODE | X | X | - | X |
213
- +------------------+-------+---------+------+----------+
214
- | M4G_MODE | X | X | - | - |
215
- +------------------+-------+---------+------+----------+
216
- | NDOF_FMC_OFF_MODE| X | X | X | X |
217
- +------------------+-------+---------+------+----------+
218
- | NDOF_MODE | X | X | X | X |
219
- +------------------+-------+---------+------+----------+
189
+ legend: x=on, -=off (see Table 3-3 in datasheet)
190
+
191
+ +------------------+-------+---------+------+----------+----------+
192
+ | Mode | Accel | Compass | Gyro | Fusion | Fusion |
193
+ | | | (Mag) | | Absolute | Relative |
194
+ +==================+=======+=========+======+==========+==========+
195
+ | CONFIG_MODE | - | - | - | - | - |
196
+ +------------------+-------+---------+------+----------+----------+
197
+ | ACCONLY_MODE | X | - | - | - | - |
198
+ +------------------+-------+---------+------+----------+----------+
199
+ | MAGONLY_MODE | - | X | - | - | - |
200
+ +------------------+-------+---------+------+----------+----------+
201
+ | GYRONLY_MODE | - | - | X | - | - |
202
+ +------------------+-------+---------+------+----------+----------+
203
+ | ACCMAG_MODE | X | X | - | - | - |
204
+ +------------------+-------+---------+------+----------+----------+
205
+ | ACCGYRO_MODE | X | - | X | - | - |
206
+ +------------------+-------+---------+------+----------+----------+
207
+ | MAGGYRO_MODE | - | X | X | - | - |
208
+ +------------------+-------+---------+------+----------+----------+
209
+ | AMG_MODE | X | X | X | - | - |
210
+ +------------------+-------+---------+------+----------+----------+
211
+ | IMUPLUS_MODE | X | - | X | - | X |
212
+ +------------------+-------+---------+------+----------+----------+
213
+ | COMPASS_MODE | X | X | - | X | - |
214
+ +------------------+-------+---------+------+----------+----------+
215
+ | M4G_MODE | X | X | - | - | X |
216
+ +------------------+-------+---------+------+----------+----------+
217
+ | NDOF_FMC_OFF_MODE| X | X | X | X | - |
218
+ +------------------+-------+---------+------+----------+----------+
219
+ | NDOF_MODE | X | X | X | X | - |
220
+ +------------------+-------+---------+------+----------+----------+
220
221
221
222
The default mode is ``NDOF_MODE``.
222
223
@@ -388,7 +389,7 @@ def euler(self):
388
389
"""Gives the calculated orientation angles, in degrees.
389
390
Returns an empty tuple of length 3 when this property has been disabled by the current mode.
390
391
"""
391
- if self .mode in [0x09 , 0x0B , 0x0C , 0x08 , 0x0A ]:
392
+ if self .mode in [0x08 , 0x09 , 0x0A , 0x0B , 0x0C ]:
392
393
return self ._euler
393
394
return (None , None , None )
394
395
@@ -401,7 +402,7 @@ def quaternion(self):
401
402
"""Gives the calculated orientation as a quaternion.
402
403
Returns an empty tuple of length 3 when this property has been disabled by the current mode.
403
404
"""
404
- if self .mode in [0x09 , 0x0B , 0x0C , 0x08 , 0x0A ]:
405
+ if self .mode in [0x08 , 0x09 , 0x0A , 0x0B , 0x0C ]:
405
406
return self ._quaternion
406
407
return (None , None , None , None )
407
408
@@ -414,7 +415,7 @@ def linear_acceleration(self):
414
415
"""Returns the linear acceleration, without gravity, in m/s.
415
416
Returns an empty tuple of length 3 when this property has been disabled by the current mode.
416
417
"""
417
- if self .mode in [0x09 , 0x0B , 0x0C ]:
418
+ if self .mode in [0x08 , 0x09 , 0x0A , 0x0B , 0x0C ]:
418
419
return self ._linear_acceleration
419
420
return (None , None , None )
420
421
@@ -427,7 +428,7 @@ def gravity(self):
427
428
"""Returns the gravity vector, without acceleration in m/s.
428
429
Returns an empty tuple of length 3 when this property has been disabled by the current mode.
429
430
"""
430
- if self .mode in [0x09 , 0x0B , 0x0C ]:
431
+ if self .mode in [0x08 , 0x09 , 0x0A , 0x0B , 0x0C ]:
431
432
return self ._gravity
432
433
return (None , None , None )
433
434
0 commit comments