BUG modifying an existing data processor

When I create a data processor chain using raw gyroscope data as the source, modification of some data processor parameters (e.g. the threshold value of a pulse data processor, or the boundary value of a comparator data processor) is buggy.
MetaMotionR sensor (Firmware 1.5.0, MetaWear iOS SDK 3.4.0).

The data processor chain:
1. Raw gyroscope data, signal retrieved by mbl_mw_gyro_bmi160_get_rotation_data_signal
2. RSS, created by mbl_mw_dataprocessor_rss_create
3. Passthrough, created by mbl_mw_dataprocessor_passthrough_create(rssProcessor, MBL_MW_PASSTHROUGH_MODE_CONDITIONAL, 1), needed for the app to disable this chain when certain conditions are met. (I believe this data processor is irrelevant for the bug. Noted here for completeness, and just in case.)
4. Pulse, created by mbl_mw_dataprocessor_pulse_create(MBL_MW_PULSE_OUTPUT_ON_DETECTION, 250, 15)

This works as expected: it doesn't detect tiny movements of the sensor, but it detects a greater rotation and produces output.

However, as soon as I call mbl_mw_dataprocessor_pulse_modify(pulseProcessor, 250, 15) - notice that I'm using the same threshold and width parameters as when creating the data processor - it detects any minuscule movement of the sensor.

I've debugged into mbl_mw_dataprocessor_pulse_create and mbl_mw_dataprocessor_pulse_modify to see if there's any visible difference. Here's the relevant line of code in mbl_mw_dataprocessor_pulse_create: https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/master/src/metawear/processor/cpp/dataprocessor_config.cpp#L593
The value of source->converter is FirmwareConverter::BMI160_ROTATION, and scaled_rotation is 4100 for threshold=250. (And it works as expected in this case.)

In mbl_mw_dataprocessor_pulse_modify (https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/master/src/metawear/processor/cpp/dataprocessor_config.cpp#L609) however, pulse->converter is FirmwareConverter::DEFAULT and scaled_threshold is 250, for threshold=250.

Probably not correct.
Please advise how to proceed with getting this functionality of the MetaWear SDK working.

Comments

Sign In or Register to comment.