Continuous Motion Recog on Other Boards

Hi @janjongboom, @zdshelby, and Edge Impulse team,

Andri’s here, the one that initially plan to visit your HQ when I was in Bay Area. First of all, thank you so much for this awesome platform.

Straight to the question. I’m able to run the inference engine locally. For now, on my PC, but I think it’s not that hard to do it on actual mbed-enabled boards.

My questions are related to how to do inference if using the real raw data from accelerometer. I read on this guide that I need to copy “raw features” from studio to be used for inferencing locally.

  • What is actually raw features?
  • Is it raw accelerometer x, y, and z?
  • If yes, what is the unit? m/s^2 or g/mili-g?
  • Other accelerometer setting, like output data rate (ODR in Hz), full scale (2g, 4g, etc)?

So that we can read and use data from our own accelerometer sensor (on custom board) and use them for inferencing.

Thanks!

1 Like

Trying to answer some of above questions myself, I tried to dig the firmware source code of your official devboard. That eventually lead to this source code. In it, I can see default accelerometer settings:

    LSM6DSL_InitStructure.AccOutput_DataRate = LSM6DSL_ODR_52Hz;
    LSM6DSL_InitStructure.Axes_Enable = 0;
    LSM6DSL_InitStructure.AccFull_Scale = LSM6DSL_ACC_FULLSCALE_2G;
    LSM6DSL_InitStructure.BlockData_Update = LSM6DSL_BDU_BLOCK_UPDATE;
    LSM6DSL_InitStructure.High_Resolution = 0;
    LSM6DSL_InitStructure.Communication_Mode = 0;

So ODR is 52Hz and Full Scale is 2G. Please confirm if that what you use.

Thanks.

1 Like

Hi @andri, yes, those settings are correct (they shouldn’t be fixed to 52Hz in our firmware, but that’s another story), so you can use them in your own application. Regarding the raw features array, this is a float array with the length EI_CLASSIFIER_DSP_INPUT_FRAME_SIZE (from model_metadata.h) with the x, y, z flattened like this:

If your data stream is: frame 1: x: 3, y: 4, z: 6, frame 2: x: 5, y: 1, z: 8, frame 3: x: 7, y: -2, z: 11, then flatten it to:

3, 4, 6, 5, 1, 8, 7, -2, 11

Hope this helps!

1 Like