From 399abbc51e9cbca3533f4edaa2dfac7e6ca7df5f Mon Sep 17 00:00:00 2001 From: ackimixs Date: Thu, 21 Mar 2024 18:35:43 +0100 Subject: [PATCH] send warning message if no tags --- tcp/MyClient.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tcp/MyClient.cpp b/tcp/MyClient.cpp index c938778..c36691a 100644 --- a/tcp/MyClient.cpp +++ b/tcp/MyClient.cpp @@ -18,9 +18,14 @@ void MyClient::handleMessage(const std::string& message) { std::string res; - for (auto& [tag, pos] : arucoTags) + if (arucoTags.empty()) { - res += std::to_string(tag.id) + " "; + res = "No Aruco Tags Found"; + } else { + for (auto& [tag, pos] : arucoTags) + { + res += std::to_string(tag.id) + " "; + } } this->sendMessage(res.c_str());