From b18ef27a1c4a96de66fd6b67562a0560cd463853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= <55236157+agonzc34@users.noreply.github.com> Date: Thu, 23 Apr 2026 10:37:00 +0200 Subject: [PATCH] Improve color, gesture, and pose filtering checks for empty strings IsDetected --- bt_nodes/perception/src/perception/IsDetected.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bt_nodes/perception/src/perception/IsDetected.cpp b/bt_nodes/perception/src/perception/IsDetected.cpp index 098f574..960c79d 100644 --- a/bt_nodes/perception/src/perception/IsDetected.cpp +++ b/bt_nodes/perception/src/perception/IsDetected.cpp @@ -198,7 +198,7 @@ BT::NodeStatus IsDetected::tick() if (detection.score > threshold_ && detection.center3d.position.z < max_depth_) { // Color filtering - if (color_ != "unknown") { + if (color_ != "unknown" && !color_.empty()) { auto const detection_id_colors = perception_system::getHSVFromUniqueID( detection.color_person); std::string lower_color = "lower_" + color_; @@ -237,7 +237,7 @@ BT::NodeStatus IsDetected::tick() } // gesture filtering - if (gesture_ != "unknown" && !removed) { + if (gesture_ != "unknown" && !gesture_.empty() && !removed) { if (std::find( gestures_[gesture_].begin(), gestures_[gesture_].end(), detection.pointing_direction) != gestures_[gesture_].end()) @@ -255,7 +255,7 @@ BT::NodeStatus IsDetected::tick() } // pose filtering - if (pose_ != "unknown" && !removed) { + if (pose_ != "unknown" && !pose_.empty() && !removed) { if (pose_names_[detection.body_pose] == pose_) { RCLCPP_DEBUG( node_->get_logger(), "[IsDetected] Detection %s is %s",