Skip to content

Commit

Permalink
updated array & matrix access to the range-checked version
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Apr 20, 2024
1 parent 47eb10e commit f1d3260
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/automatic_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

//}
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit f1d3260

Please sign in to comment.