Merge pull request #606 from nobleo/fix/galactic

rclcpp::executor is deprecated
This commit is contained in:
matlabbe
2021-07-09 09:12:49 -04:00
committed by GitHub
5 changed files with 10 additions and 9 deletions
+1
View File
@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap_ros/visibility.h>
#include <rclcpp/rclcpp.hpp>
#include <rclcpp/executor.hpp>
#include "rtabmap_ros/msg/info.hpp"
#include "rtabmap_ros/msg/map_data.hpp"
#include "rtabmap_ros/msg/odom_info.hpp"
@@ -29,6 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define PREFERENCESDIALOGROS_H_
#include <rclcpp/rclcpp.hpp>
#include <rclcpp/executor.hpp>
#include <rtabmap/gui/PreferencesDialog.h>
using namespace rtabmap;
+5 -5
View File
@@ -238,7 +238,7 @@ bool GuiWrapper::callEmptyService(const std::string & name)
auto result_future = client->async_send_request(request);
auto node = rclcpp::Node::make_shared("rtabmapviz");
if (rclcpp::spin_until_future_complete(node, result_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(this->get_logger(),
"Can't call \"%s\" service.", name.c_str());
@@ -267,7 +267,7 @@ bool GuiWrapper::callMapDataService(const std::string & name, bool global, bool
request->graph_only = graphOnly;
auto result_future = client->async_send_request(request);
auto node = rclcpp::Node::make_shared("rtabmapviz");
if (rclcpp::spin_until_future_complete(node, result_future) != rclcpp::executor::FutureReturnCode::SUCCESS)
if (rclcpp::spin_until_future_complete(node, result_future) != rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(this->get_logger(), "Service \"%s\" failed to get the data.", name.c_str());
}
@@ -317,7 +317,7 @@ bool GuiWrapper::handleEvent(UEvent * anEvent)
auto results = client->set_parameters(rosParameters);
// Wait for the results.
if (rclcpp::spin_until_future_complete(node, results, std::chrono::seconds(5)) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(this->get_logger(), "Failed to set rtabmap parameters!");
}
@@ -410,7 +410,7 @@ bool GuiWrapper::handleEvent(UEvent * anEvent)
auto result_future = client->async_send_request(request);
auto node = rclcpp::Node::make_shared("rtabmapviz");
if (rclcpp::spin_until_future_complete(node, result_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(this->get_logger(), "Can't call \"set_goal\" service.");
}
@@ -453,7 +453,7 @@ bool GuiWrapper::handleEvent(UEvent * anEvent)
auto result_future = client->async_send_request(request);
auto node = rclcpp::Node::make_shared("rtabmapviz");
if (rclcpp::spin_until_future_complete(node, result_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(this->get_logger(), "Can't call \"set_label\" service.");
}
+1 -2
View File
@@ -136,7 +136,7 @@ bool PreferencesDialogROS::readCoreSettings(const QString & filePath)
{
auto parameters = client->get_parameters(rosParameters);
if (rclcpp::spin_until_future_complete(node, parameters, std::chrono::seconds(5)) ==
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
for (auto & parameter : parameters.get()) {
const std::string & key = parameter.get_name();
@@ -191,4 +191,3 @@ void PreferencesDialogROS::writeCoreSettings(const QString & filePath) const
}
}
}
+2 -2
View File
@@ -506,7 +506,7 @@ void MapCloudDisplay::downloadMap()
request->optimized = true;
request->graph_only = false;
auto result_future = client->async_send_request(request);
if (rclcpp::spin_until_future_complete(node, result_future) != rclcpp::executor::FutureReturnCode::SUCCESS)
if (rclcpp::spin_until_future_complete(node, result_future) != rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(node->get_logger(), "Service \"get_map_data\" failed to get the data.");
}
@@ -573,7 +573,7 @@ void MapCloudDisplay::downloadGraph()
request->optimized = true;
request->graph_only = true;
auto result_future = client->async_send_request(request);
if (rclcpp::spin_until_future_complete(node, result_future) != rclcpp::executor::FutureReturnCode::SUCCESS)
if (rclcpp::spin_until_future_complete(node, result_future) != rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(node->get_logger(), "Service \"get_map_data\" failed to get the data.");
}