From 4467c3e06d51089fc3f979fa85a6abe8bca38cd7 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Thu, 28 Mar 2024 18:18:14 +0100 Subject: [PATCH] update namespace --- arucoDetector.cpp | 8 ++++---- tcp/MyClient.cpp | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arucoDetector.cpp b/arucoDetector.cpp index 73a7815..e69c789 100644 --- a/arucoDetector.cpp +++ b/arucoDetector.cpp @@ -93,12 +93,12 @@ int main(int argc, char *argv[]) stopRequested = true; } - for (auto [tags, matrix] : r.second) + for (const auto& [tags, matrix] : r.second) { - if (tags.type == FLOWER) - { + if (tags.type == FLOWER) { //ArucoDetector::flowerDetector(tags, matrix.first, matrix.first, robotPose); - } else if (tags.type == SOLAR_PANEL) + } + else if (tags.type == SOLAR_PANEL) { //ArucoDetector::solarPanelDetector(tags, matrix.first, matrix.first, robotPose); } diff --git a/tcp/MyClient.cpp b/tcp/MyClient.cpp index 61d4d83..fe7cca7 100644 --- a/tcp/MyClient.cpp +++ b/tcp/MyClient.cpp @@ -1,18 +1,18 @@ #include "MyClient.h" -MyClient::~MyClient() -{ - this->stop(); -} - MyClient::MyClient(Type::RobotPose* robotPose, const char* ip, const int port) : TCPClient(ip, port), robotPose(robotPose) { } +MyClient::~MyClient() +{ + this->stop(); +} + void MyClient::handleMessage(const std::string& message) { - std::vector messageSplited = split(message, ";"); + std::vector messageSplited = TCPSocket::split(message, ";"); if (messageSplited[1] == "aruco" || messageSplited[1] == "all") { @@ -39,11 +39,11 @@ void MyClient::handleMessage(const std::string& message) this->sendMessage(res.c_str()); } else if (messageSplited[2] == "ping") { - this->sendMessage("aruco;strat;pong;1"); + this->sendMessage("aruco;ihm;pong;1"); } else if (messageSplited[2] == "set robot_pos") { // cut the string with space and take the first, second, third and fourth element - std::vector tokens = split(message, " "); + std::vector tokens = TCPSocket::split(message, " "); robotPose->position.x = std::stof(tokens[1]); robotPose->position.y = std::stof(tokens[2]);