Sensor Fusion module

The PyMetaWear implementation of the libmetawear sensor fusion module.

It is initialized at the creation of the MetaWearClient client and can then be accessed in the sensorfusion attribute of the client.

Example usage:

from pymetawear.client import MetaWearClient
from mbientlab.metawear.cbindings import SensorFusionData, SensorFusionMode

c = MetaWearClient('DD:3A:7D:4D:56:F0')

c.sensorfusion.set_mode(SensorFusionMode.NDOF)
c.sensorfusion.set_sample_delay(SensorFusionData.QUATERION, 20)

def sensor_fusion_callback(data):
    """Handle sensor fusion notification data."""
    epoch = data[0]
    sf_data = data[1]
    print("[{0}] {1}".format(epoch, sf_data))

c.sensorfusion.notifications(
    corrected_acc_callback=sensor_fusion_callback,
    quaternion_callback=sensor_fusion_callback,
    corrected_gyro_callback=sensor_fusion_callback)

API

Sensor Fusion module

Created by mgeorgi <marcus.georgi@kinemic.de> on 2017-02-01

class pymetawear.modules.sensorfusion.SensorFusionModule(board, module_id)[source]

MetaWear accelerometer module implementation.

Parameters:
  • board (ctypes.c_long) – The MetaWear board pointer value.
  • module_id (int) – The module id of the sensorfusion component, obtained from libmetawear.
  • debug (bool) – If True, module prints out debug information.
data_signal

Returns the data signal pointer value for the switch module.

Returns:The pointer value. (Long if on x64 architecture.)
Return type:ctypes.c_long or ctypes.c_int
module_name

Get module name.

Returns:The name of this module.
Return type:str