imu — imu sensor

The imu module is used for reading the IMU sensor under the camera sensor.

Note

The IMU sensor (and this module) is not present on all OpenMV Cam models.

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 of the board).

  • Z points in the reverse direction of the camera sensor (into the table).

Functions

imu.acceleration_mg() Tuple[float, float, float]

Returns the acceleration for (x, y, z) as a float tuple in milli-g’s.

imu.angular_rate_mdps() Tuple[float, float, float]

Returns the angular rate for (x, y, z) as a float tuple in milli-degrees-per-second.

imu.temperature_c() float

Returns the IMU sensor temperature in degrees Celsius.

imu.roll() float

Returns the roll angle of the camera module in degrees.

  • 0 -> Camera is standing up.

  • 90 -> Camera is rotated left.

  • 180 -> Camera is upside down.

  • 270 -> Camera is rotated right.

imu.pitch() float

Returns the pitch angle of the camera module in degrees.

  • 0 -> Camera is standing up.

  • 90 -> Camera is pointing down.

  • 180 -> Camera is upside down.

  • 270 -> Camera is pointing up.

imu.sleep(enable: bool) None

enable set to True puts the IMU sensor to sleep. False wakes it back up (the default).

imu.__write_reg(addr: int, val: int) None

Sets the IMU register at addr to val.

imu.__read_reg(addr: int) int

Returns the value of the IMU register at addr.