imu sensor
imu — imu sensor
The imu module is used for reading the 6-DOF LSM6DS3
IMU sensor under the camera sensor.
Note
The IMU sensor (and this module) is not present on all OpenMV Cam models.
Functions
imu.acceleration_mg
imu.acceleration_mg() -> Tuple[float, float, float]Returns the acceleration for (x, y, z) in a float tuple in milli-g’s.
For when the camera board is lying on a table face up:
X points to the right of the camera sensor Y points down below the camera sensor (towards the bottom on the board) Z points in the reverse direction of the camera sensor (into the table)
imu.angular_rate_mdps
imu.angular_rate_mdps() -> Tuple[float, float, float]Returns the angular rate for (x, y, z) in a float tuple in milli-degrees-per-second.
For when the camera board is lying on a table face up:
X points to the right of the camera sensor Y points down below the camera sensor (towards the bottom on the board) Z points in the reverse direction of the camera sensor (into the table)
imu.temperature_c
imu.temperature_c() -> floatReturns the temperature in celsius (float).
imu.roll
imu.roll() -> floatReturns the rotation angle in degrees (float) of the camera module.
- 0 -> Camera is standing up.
- 90 -> Camera is rotated left.
- 180 -> Camera is upside down.
- 270 -> Camera is rotated right.
imu.pitch
imu.pitch() -> floatReturns the rotation angle in degrees (float) of the camera module.
- 0 -> Camera is standing up.
- 90 -> Camera is pointing down.
- 180 -> Camera is upside down.
- 270 -> Camera is pointing up.
imu.sleep
imu.sleep(enable: bool) -> NonePass True to put the IMU sensor to sleep. False to wake it back up (the default).
imu.__write_reg
imu.__write_reg(addr: int, val: int) -> NoneSet 8-bit LSM6DS3 register addr to 8-bit val.
imu.__read_reg
imu.__read_reg(addr: int) -> intGet 8-bit LSM6DS3 register addr.
