Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BHI260AP self-learning algorithm

    BHI260AP self-learning algorithm

    nicogou
    New Poster

    Hi Bosch Sensortec Community,

    I bought an Arduino Nicla Sense ME with the intention to test the self-learning features of BHI260AP.

    I am developing with Zephyr, not the Arduino IDE. I setup SPI communication between the MCU and BHI260AP and used the examples from the Sensor API github repo to check that everything was working okay. The Klio example was working fine, I was able to learn patterns and recognize them.

    My use-case is the following: I start a physical activity wearing the IMU, a command is given to the board to start learning, the pattern is learnt and the activity stops. Next I put the device on someone else who performs the same activity, and I want the device to start recognizing that same pattern.

    From the tests I did, it seems that I can't launch learning and recognizing independently:
    - when I start learning only, I get the following error: [Klio error] Undefined
    That means the IMU returned 
    KLIO_DRIVER_ERROR_UNDEFINED. Do you have any idea regarding what causes this error ?
    - when I start recognition only, I don't get the meta events telling me that the virtual sensor has started until learning is also enabled. -- edit: I had a bug not related to the sensor, I got that working.
    - I can learn patterns when both are enabled, however if I try to turn learning off and have recognition only, I get the same error : [Klio error] Undefined
    - also, it seems that when I use bhy2_klio_set_state, if I don't send a reset to learning/recognizing, I get the same error. From what I gather, doing this removes previously learnt patterns, is that correct ? If so, then I need to re-write the patterns every time I start the IMU ?

    Am i missing something that prevents it from working properly, or is that how it's supposed to work ? What would be the best way to handle my use-case ? Do i need to always turn on both learning and recognition at the same time, and if a new pattern is "learnt" by the learning algorithm I just discard it and not store it ? And then when I want to recognize learnt patterns I always re-write it to the sensor with bhy2_klio_write_pattern ?

    Thanks in advance for your help.

    Best regards,

    Nicolas G.

    2 REPLIES 2

    nicogou
    New Poster

    Also, what bhy2_klio_parameter_t parameters are implemented in the BHI260AP_klio_turbo-flash.fw.h firmware ? It seems I can't access some of them. Can I access them if I develop a custom BHI260 firmware using the SDK ?

    BSTRobin
    Community Moderator
    Community Moderator

    Hi nicogou,

    Thanks for your inquiry.
    Did you refer to github example code https://github.com/boschsensortec/BHY2_SensorAPI/blob/master/examples/klio_selflearning/klio.c? If yes, could we know which line you get returned KLIO_DRIVER_ERROR_UNDEFINED value?
    In the SDK, the interface of klio is not open to the public.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist