data from sensors

Im tring to learn hand momvemnt using samples from my MMR. Im using code based on the tutorials for python but i have a lot of problems with the sampled data. while the metaware app works fine my code doesnt.

i used this setting for the sensors:

    fn_wrapper = cbindings.FnVoid_VoidP_VoidP(processor_created)

    libmetawear.mbl_mw_gyro_bmi160_set_odr(self.device.board, GyroBmi160Odr._100Hz)
    libmetawear.mbl_mw_gyro_bmi160_set_range(self.device.board, GyroBmi160Range._2000dps)

    libmetawear.mbl_mw_acc_set_odr(self.device.board, 100.0)
    libmetawear.mbl_mw_acc_set_range(self.device.board, 16.0)

    libmetawear.mbl_mw_mag_bmm150_set_preset(self.device.board, MagBmm150Preset.HIGH_ACCURACY)

    acc = libmetawear.mbl_mw_acc_get_acceleration_data_signal(self.device.board)
    gyro = libmetawear.mbl_mw_gyro_bmi160_get_rotation_data_signal(self.device.board)
    mag = libmetawear.mbl_mw_mag_bmm150_get_b_field_data_signal(self.device.board)

also attached a photo of the signals i recive. im not sure how to improve my restults further.



  • You can't stream at 200Hz...that's beyond the capabilities of bluetooth.
    100Hz MAX when streaming with BLE.

  • so how does it possible when i use the metaware app?

  • It is not. There is a max of about 120Hz via bluetooth. That is simply a hard fact (it is the bluetooth hard spec + physics).
    You can log at higher speeds and download later. Is that what you are doing perhaps?

  • i am already downloading later. I lowered my samplings to 50Hz for each sensor and i no longer sampels the magnometer. and yet i still get bad results, nothing that resembles the metabase app. for exemples my acceloration in free fall is lower then 5

  • If you sample at 50Hz for acc+gyro and about 10Hz for magnetometer you should be ok.

  • edited June 2020

    gilhalell is right: the Metabase app allows simultaneous sampling of gyr+acc at 100Hz. I suspect a rate of 50Hz is used, probably packing 2 samples for acc and gyr each. Adding magnetometer data would probably be a stretch, though.

  • edited June 2020

    Obviously you know better than everyone else but you forget the data overhead in the bluetooth packets taking up bandwith. Also we do have a pack mode available which you are welcome to use to get more throughput.

    I will be deleting your useless comment.

  • All I ask for is allowing data from multiple sensors to be packed, rather than just from a single sensor. It really would solve a host of bandwidth and synchronization problems. I don't see why you consider that a 'useless' comment.

  • @renev,
    Read the tutorials, we offer a packed mode.

  • can you please help us understanding how can we pack 2 sensors, or point us to the line of code that implement this action. Im trying to get data from 2 sensors and i need them to working simultaneously and to get as accurate as possible results

  • edited June 2020

    Please read the tutorials on the data fuser, it trains you on how to pack data and we even have coding examples:

  • I read it and i cant understand, please can you tell me how to pack the info of 2 MMR (4 sensors, 2 gyro, 2 acc)?
    im sure a detailed explenation will help many other users. thanks

  • edited June 2020

    Did you try to use the example I linked?

        self.acc = self.libmetawear.mbl_mw_acc_get_acceleration_data_signal(self.board)
        self.gyro = self.libmetawear.mbl_mw_gyro_bmi160_get_rotation_data_signal(self.board)
        signals = (c_void_p * 1)()
        signals[0] = self.gyro
        self.libmetawear.mbl_mw_dataprocessor_fuser_create(self.acc, signals, 1, None, self.processor_handler)
  • If i understand correctly this packing is of 2 signals from the same sensor. I want to pack 4 signals from 2 diffrent sensors

  • **** from 2 diffrent boards i.e 2 diffrent MMRs and 4 sensors

  • You can pack data using the fuser but you can only do it on a "per MMR" basis.
    The fuser is internal to the MMR. You can't fuse two MMRs together.

    Once you fuse one MMR and then the other. Once you get all the data in software, you can write a script to combine it.

  • but in this way i cant sample in 50Hz every sensor.
    how can i switch between sensors by detecting movement while getting at least 50Hz sampling rate?
    i cant disconect and then connect because the connecting takes to much time.
    also i tried ressting the sensors but it still get bed results while if i start all over with one sensor the results are ok

  • Can you tell me more about what exactly you are trying to accomplish?

  • im trying to implement a test that check hand functionality skills. the MMRs are inserted inside pegs and set in a board (i added a picture). the user need to take a peg out of the board flip it and set it back in the board. then immidiatly raise a diffrent peg flip it and set it back in the board this goes over and over for 16 times. For more information on the test

    my problam is when switching between two pegs, meaning switching the sampling between two MMR. i need it to be immediate and happen automaticly (by sensing movement has stoped on one peg and started on a diffrent peg).

    also for accurate hand movement anaysis i need to sample at 50Hz rate at least.

    can you help me think of other way to implement it with the MMR sensor exept data fusing?

  • edited June 2020

    I recommend using the any motion feature of our boards which only streams sensor data when the sensors is moving.
    I would then start streaming acc data at 50Hz (or I would personally stream either quaternions or eulers if you are doing 3d motion). Sensor fusion outputs would have to be downsampled as they stream at 100Hz by default.
    Finally, I would have a linux machine that can connect to all the sensors simultaneously to "absorb" the data and analyze it. A linux machine is more reliable and can support multiple dongles for multiple sensor connections at once.
    I don't think the data fuser is really helpful tbh.

  • thank you for the detailed answer it is extremely helpfull.
    where can i find more information about the any motion feature and how to use it?

  • I think I have examples of this in Python.

  • how can i use the any motion on gyro could find anything on the tutorials

  • edited June 2020

    Combine examples and learn; you got this.

Sign In or Register to comment.