ADD unconcious threshold to 250

This commit is contained in:
Yunhorn 2024-05-13 23:21:26 +08:00
parent b0840e73be
commit bfb86a6241
4 changed files with 15 additions and 6 deletions

View File

@ -192,7 +192,8 @@ enum sts_presence_fall_detection_type {
STS_PRESENCE_NONE=0, STS_PRESENCE_NONE=0,
STS_PRESENCE_FALL, STS_PRESENCE_FALL,
STS_PRESENCE_RISING, STS_PRESENCE_RISING,
STS_PRESENCE_LAYDOWN STS_PRESENCE_LAYDOWN,
STS_PRESENCE_UNCONCIOUS
}; };
enum sts_sensor_result_t { enum sts_sensor_result_t {

View File

@ -79,7 +79,7 @@
#define DEFAULT_MOTION_DATASET_LEN (128) //MOTION DATASET/PATTERN COLLECTION #define DEFAULT_MOTION_DATASET_LEN (128) //MOTION DATASET/PATTERN COLLECTION
#define DEFAULT_MOTION_FEATURE_LEN (10) //MOTION FEATURE IDENDIFIED #define DEFAULT_MOTION_FEATURE_LEN (10) //MOTION FEATURE IDENDIFIED
#define DEFAULT_UNCONCIOUS_THRESHOLD (250)
extern volatile uint8_t sts_fall_detection_acc_threshold, sts_fall_detection_depth_threshold, sts_occupancy_overtime_threshold; extern volatile uint8_t sts_fall_detection_acc_threshold, sts_fall_detection_depth_threshold, sts_occupancy_overtime_threshold;
volatile uint8_t sts_unconcious_state=0; volatile uint8_t sts_unconcious_state=0;
@ -597,10 +597,10 @@ void STS_YunhornCheckStandardDeviation(void)
#ifdef LOG_RSS #ifdef LOG_RSS
APP_LOG(TS_OFF, VLEVEL_L, "\r\n-------------Distance Average =%6u; Variance = %6u ; Standard =%6u \r\n", APP_LOG(TS_OFF, VLEVEL_L, "\r\n-------------Distance Average =%6u; Variance = %6u ; Standard =%6u \r\n",
(int)(average_presence_distance*1000.0f), (int)(variance_presence_distance*1000.0f), (int)(standard_variance_presence_distance*1000.0f)); (int)(average_presence_distance*1000.0f), (int)(variance_presence_distance*1000.0f), (int)(standard_variance_presence_distance*1000.0f));
#endif
APP_LOG(TS_OFF, VLEVEL_L, "-------------Motion Average =%6u; Variance = %6u ; Standard =%6u \r\n", APP_LOG(TS_OFF, VLEVEL_M, "-------------Motion Average =%6u; Variance = %6u ; Standard =%6u \r\n",
(int)(average_presence_score*1000.0f), (int)(variance_presence_score*1000.0f), (int)(standard_variance_presence_score*1000.0f)); (int)(average_presence_score*1000.0f), (int)(variance_presence_score*1000.0f), (int)(standard_variance_presence_score*1000.0f));
#ifdef LOG_RSS
APP_LOG(TS_OFF, VLEVEL_L, "-------------ROC Dist Average =%6u; Variance = %6u ; Standard =%6u \r\n", APP_LOG(TS_OFF, VLEVEL_L, "-------------ROC Dist Average =%6u; Variance = %6u ; Standard =%6u \r\n",
(int)(average_roc_distance), (int)(variance_roc_distance), (int)(standard_variance_roc_distance)); (int)(average_roc_distance), (int)(variance_roc_distance), (int)(standard_variance_roc_distance));
@ -643,7 +643,9 @@ void STS_YunhornCheckStandardDeviation(void)
sts_motion_feature[motion_feature_count].fall_rising = sts_fall_rising_detected_result; sts_motion_feature[motion_feature_count].fall_rising = sts_fall_rising_detected_result;
sts_roc_acc_standard_variance = (uint8_t) standard_variance_roc_acc; sts_roc_acc_standard_variance = (uint8_t) standard_variance_roc_acc;
if (standard_variance_presence_score <= DEFAULT_UNCONCIOUS_THRESHOLD) {
sts_fall_rising_detected_result = STS_PRESENCE_UNCONCIOUS;
}
if ( sts_fall_rising_detected_result == STS_PRESENCE_FALL ) if ( sts_fall_rising_detected_result == STS_PRESENCE_FALL )
{ {
APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n >>>>>>>>>>>>>>>>> Suspecious Object FALL DOWN detected \r\n"); APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n >>>>>>>>>>>>>>>>> Suspecious Object FALL DOWN detected \r\n");

View File

@ -113,6 +113,7 @@ char sts_presence_fall_detection_message[5][20]={
"State_Fall_Down", "State_Fall_Down",
"State_Rising_Up", "State_Rising_Up",
"State_Laydown", "State_Laydown",
"State_Unconcious"
}; };
#endif #endif
@ -706,6 +707,10 @@ void STS_PRESENCE_SENSOR_Prepare_Send_Data(void)
sts_o7_sensorData.rss_presence_score = (uint16_t)(sts_presence_rss_score)&0xFFFF; sts_o7_sensorData.rss_presence_score = (uint16_t)(sts_presence_rss_score)&0xFFFF;
// uint8_t sts_unconcious_state; // uint8_t sts_unconcious_state;
// uint16_t sts_unconcious_threshold, sts_unconcious_threshold_duration; // uint16_t sts_unconcious_threshold, sts_unconcious_threshold_duration;
sts_o7_sensorData.unconcious_state=(sts_fall_rising_detected_result == STS_PRESENCE_UNCONCIOUS)? 1:0;
#if 0
if (sts_presence_rss_score < sts_unconcious_threshold) if (sts_presence_rss_score < sts_unconcious_threshold)
{ {
sts_o7_sensorData.unconcious_state = sts_presence_rss_score; sts_o7_sensorData.unconcious_state = sts_presence_rss_score;
@ -713,6 +718,7 @@ void STS_PRESENCE_SENSOR_Prepare_Send_Data(void)
{ {
sts_o7_sensorData.unconcious_state = 0; sts_o7_sensorData.unconcious_state = 0;
} }
#endif
} else { } else {
APP_LOG(TS_OFF, VLEVEL_M, "\r\n......STS_NO MOTION............\r\n"); APP_LOG(TS_OFF, VLEVEL_M, "\r\n......STS_NO MOTION............\r\n");
sts_o7_sensorData.rss_presence_distance = 0x0; sts_o7_sensorData.rss_presence_distance = 0x0;

Binary file not shown.