diff --git a/CMakeLists.txt b/CMakeLists.txt index 478a607..139af40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ set(msg_files msg/Feature.msg msg/DetectMask.msg msg/DetectMaskArray.msg + msg/SoundDetection.msg ) set(srv_files srv/GetHandToTargetCoord.srv @@ -39,6 +40,7 @@ set(action_files action/MoveWheelRotate.action action/VlaRecordState.action action/DisplayControl.action + action/ListenForSound.action ) rosidl_generate_interfaces(${PROJECT_NAME} diff --git a/action/ListenForSound.action b/action/ListenForSound.action new file mode 100644 index 0000000..c06fd2b --- /dev/null +++ b/action/ListenForSound.action @@ -0,0 +1,14 @@ +# Goal — start listening for a bell/doorbell sound +float64 timeout_sec # max seconds to listen; 0 = no timeout +float32 threshold 0.15 # YAMNet score threshold to trigger; 0 = use node default +--- +# Result +bool detected # true if sound was detected before timeout +string label # class name that triggered (e.g. "Doorbell") +float32 score # score of the detected class +float32 elapsed_time # seconds from goal start to result +--- +# Feedback — sent every hop (~0.5 s) while listening +string current_top_label # overall top class right now +float32 current_top_score # its score +bool candidate_detected # any doorbell-like class above threshold this frame diff --git a/msg/SoundDetection.msg b/msg/SoundDetection.msg new file mode 100644 index 0000000..5c1ce95 --- /dev/null +++ b/msg/SoundDetection.msg @@ -0,0 +1,5 @@ +std_msgs/Header header +string label # best doorbell-like class detected (e.g. "Doorbell", "Bell") +float32 score # YAMNet score for that class [0-1] +string top_label # overall top class regardless of category (for diagnostics) +float32 top_score # overall top score (for diagnostics)