From f1d326075809b66d5ef97fa3933db6efac0e23f9 Mon Sep 17 00:00:00 2001 From: Tomas Baca Date: Sat, 20 Apr 2024 15:13:24 +0200 Subject: [PATCH] updated array & matrix access to the range-checked version --- src/automatic_start.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/automatic_start.cpp b/src/automatic_start.cpp index 78c8b19..7392304 100644 --- a/src/automatic_start.cpp +++ b/src/automatic_start.cpp @@ -303,7 +303,7 @@ void AutomaticStart::onInit() { for (int i = 0; i < int(_topic_check_topic_names_.size()); i++) { - std::string topic_name = _topic_check_topic_names_[i]; + std::string topic_name = _topic_check_topic_names_.at(i); if (topic_name.at(0) != '/') { topic_name = "/" + _uav_name_ + "/" + topic_name; @@ -342,7 +342,7 @@ void AutomaticStart::onInit() { void AutomaticStart::genericCallback([[maybe_unused]] const topic_tools::ShapeShifter::ConstPtr& msg, [[maybe_unused]] const std::string& topic_name, const int id) { - topic_check_topics_[id].updateTime(); + topic_check_topics_.at(id).updateTime(); } //} @@ -832,10 +832,10 @@ bool AutomaticStart::topicCheck(void) { for (int i = 0; i < int(topic_check_topics_.size()); i++) { - if (topic_check_topics_[i].getTime() == ros::Time::UNINITIALIZED || - (ros::Time::now() - topic_check_topics_[i].getTime()) > ros::Duration(_topic_check_timeout_)) { + if (topic_check_topics_.at(i).getTime() == ros::Time::UNINITIALIZED || + (ros::Time::now() - topic_check_topics_.at(i).getTime()) > ros::Duration(_topic_check_timeout_)) { - missing_topics << std::endl << "\t" << topic_check_topics_[i].getTopicName(); + missing_topics << std::endl << "\t" << topic_check_topics_.at(i).getTopicName(); got_topics = false; } }