From 5471c92da02e5426ba50ae4f4b5b1428579dcc7e Mon Sep 17 00:00:00 2001 From: Andrey Stepanov Date: Fri, 18 Feb 2022 20:02:23 +0700 Subject: [PATCH] initialize plugin before getting subscriptions --- mavros/src/lib/mavros.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mavros/src/lib/mavros.cpp b/mavros/src/lib/mavros.cpp index aff0987e6..e66b98ecc 100644 --- a/mavros/src/lib/mavros.cpp +++ b/mavros/src/lib/mavros.cpp @@ -325,6 +325,7 @@ void MavRos::add_plugin(std::string &pl_name, ros::V_string &blacklist, ros::V_s ROS_INFO_STREAM("Plugin " << pl_name << " loaded"); + plugin->initialize(mav_uas); for (auto &info : plugin->get_subscriptions()) { auto msgid = std::get<0>(info); auto msgname = std::get<1>(info); @@ -370,7 +371,6 @@ void MavRos::add_plugin(std::string &pl_name, ros::V_string &blacklist, ros::V_s } } - plugin->initialize(mav_uas); loaded_plugins.push_back(plugin); ROS_INFO_STREAM("Plugin " << pl_name << " initialized");