Hi, I am trying to create a low pass filter using the api.
I am getting the following error
libmetawear.mbl_mw_dataprocessor_lowpass_create(quaternion,8, None, self.fuse_callback) ctypes.ArgumentError: argument 4:: expected CFunctionType instance instead of CFunctionType
any idea on how to fix this?
``fuse_callback = FnVoid_VoidP_DataP(self.processor_created)
quaternion = libmetawear.mbl_mw_sensor_fusion_get_data_signal(self.device.board, SensorFusionData.QUATERNION)
libmetawear.mbl_mw_dataprocessor_lowpass_create(quaternion,8, None, fuse_callback)
libmetawear.mbl_mw_datasignal_subscribe(quaternion, None , self.callback)
Your stuff looks fine to me but you might have some syntax issue. Again it's hard to tell because you didn't give me a proper code snippet.
Hey Laura, thanks
Not sure what was the issue. Based on the examples i found in the git, i manged to make it work.
I was doing as an experiment to test how these filters work and I noticed the following outputs.
I plotted the values and this was the result.
low pass filter
Any reasons why this might happen?
Probably just not using the filter correctly. I am not 100% sure I understand your graphs though.
print("Configuring Device %s" %(self.device_name))
libmetawear.mbl_mw_settings_set_connection_parameters(self.device.board, 7.5, 7.5, 0, 6000)
e = Event()
I have a MMR placed on a table and streaming quaternions. I have plotted the quaternion values [x,y,z,w].
For the above code snippet, the (size Number of previous data samples to compare against) is set to one. and the output is alright.
And when the size is changed to 8
libmetawear.mbl_mw_dataprocessor_lowpass_create(quaternion,8, None, fn_wrapper)
the output of the quaternions while on the table is very noisy
Can you tell what could be causing this?
Some noise is ok btw (you can look at the bosch datasheet for expected noise levels).
I removed the lines. Yes, some noise is fine..but the filtered data produces random values. for instance if you notice the quaternion z values are very noisy(second graph) even when the sensor is placed on the table. shouldn't be similar to the first graph? Or does this filter work only with the accelerometer data?
I apologize but I finally heard back from the firmware engineer. The data processor does not support quaternion inputs.
Exactly! Nice job noticing.