03-31-2021 02:11 PM
Hi, I have successfully interface BMI270 using I2C protocol. Also I am able to load configuration file.
https://github.com/BoschSensortec/BMI270-Sensor-API
I am referring examples code from above link. I have received various activities like running, walking etc. from this example "\examples\bmi270\step_activity".
I want these two activities "ON_BICYCLE", "IN_VEHICLE". This activity recognition is provided in "bmi270_context" folder.
But I am getting this warning "Warning [1] : FIFO empty". I am referring this example file "activity_recognition".
Please help me to achieve these functionalities.
Thanks in advanced.
03-31-2021 04:39 PM
Hello sos,
For "Warning [1] : FIFO empty", you mean your code couldn't enter this loop?
while (rslt != BMI2_W_FIFO_EMPTY)
{
/* Provide the number of frames to be read */
act_frames = 5;
printf("Requested FIFO data frames : %d\n", act_frames);
/* Get the activity output */
rslt = bmi270_context_get_act_recog_output(act_recog_data, &act_frames, &fifoframe, &bmi2_dev);
bmi2_error_codes_print_result(rslt);
printf("Parsed FIFO data frames : %d\r\n", act_frames);
for (count = 0; count < act_frames; count++)
{
printf(
"Activity Recognition output[%d]:Sensor time: %lu\t Previous activity: %s\t current: %s\n",
count,
act_recog_data[count].time_stamp,
activity_reg_output[act_recog_data[count].prev_act],
activity_reg_output[act_recog_data[count].curr_act]);
}
}
04-01-2021 12:17 PM
Thanks for the reply!!!
Move the board for activity recognition for 30 sec :
Fifo length = 0
Requested FIFO data frames : 5
Warning [1] : FIFO empty
Parsed FIFO data frames : 0
I received this output on serial terminal.
Code is entering in to while loop but not entering in below for loop because value of act_frames received is 0.
if (rslt == BMI2_OK)
{
/* Update FIFO structure */
fifoframe.data = fifo_data;
fifoframe.length = 516;
rslt = bmi2_get_fifo_length(&fifo_length, &bmi2_dev);
printf("Fifo length = %d \n", fifo_length);
/* Read FIFO data */
rslt = bmi2_read_fifo_data(&fifoframe, &bmi2_dev);
bmi2_error_codes_print_result(rslt);
while (rslt != BMI2_W_FIFO_EMPTY)
{
/* Provide the number of frames to be read */
act_frames = 5;
printf("Requested FIFO data frames : %d\n", act_frames);
/* Get the activity output */
rslt = bmi270_context_get_act_recog_output(act_recog_data, &act_frames, &fifoframe, &bmi2_dev);
bmi2_error_codes_print_result(rslt);
printf("Parsed FIFO data frames : %d\r\n", act_frames);
for (count = 0; count < act_frames; count++)
{
printf(
"Activity Recognition output[%d]:Sensor time: %d\t Previous activity: %s\t current: %s\n",
count,
act_recog_data[count].time_stamp,
activity_reg_output[act_recog_data[count].prev_act],
activity_reg_output[act_recog_data[count].curr_act]);
}
}
}
Please help me to resolve the issue.
Thanks in advanced.
05-14-2021 09:22 AM
Hello sos,
Is your actual activity like "ON_BICYCLE", "IN_VEHICLE"? Output data will match with actual activity status.
06-22-2021 07:46 AM
Hello Sir,
I want these activities to detect "ON_BICYCLE", "IN_VEHICLE". In sample code these activities are given,
* Various Activity recognitions are listed in array. */
const char *activity_reg_output[6] = { "OTHERS", "STILL", "WALKING", "RUNNING", "ON_BICYCLE", "IN_VEHICLE" };
I can perform still, walking, running activity. So I was trying to get other activities like still, waking or other.
But the code is not able to detect these activities also like still, walkin or other. Code gives warning as I posted above.
Please suggest other solution.
Thanks in advanced.