mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Merge pull request #606 from nobleo/fix/galactic
rclcpp::executor is deprecated
This commit is contained in:
@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <rtabmap_ros/visibility.h>
|
#include <rtabmap_ros/visibility.h>
|
||||||
#include <rclcpp/rclcpp.hpp>
|
#include <rclcpp/rclcpp.hpp>
|
||||||
|
#include <rclcpp/executor.hpp>
|
||||||
#include "rtabmap_ros/msg/info.hpp"
|
#include "rtabmap_ros/msg/info.hpp"
|
||||||
#include "rtabmap_ros/msg/map_data.hpp"
|
#include "rtabmap_ros/msg/map_data.hpp"
|
||||||
#include "rtabmap_ros/msg/odom_info.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_
|
#define PREFERENCESDIALOGROS_H_
|
||||||
|
|
||||||
#include <rclcpp/rclcpp.hpp>
|
#include <rclcpp/rclcpp.hpp>
|
||||||
|
#include <rclcpp/executor.hpp>
|
||||||
#include <rtabmap/gui/PreferencesDialog.h>
|
#include <rtabmap/gui/PreferencesDialog.h>
|
||||||
|
|
||||||
using namespace rtabmap;
|
using namespace rtabmap;
|
||||||
|
|||||||
+5
-5
@@ -238,7 +238,7 @@ bool GuiWrapper::callEmptyService(const std::string & name)
|
|||||||
auto result_future = client->async_send_request(request);
|
auto result_future = client->async_send_request(request);
|
||||||
auto node = rclcpp::Node::make_shared("rtabmapviz");
|
auto node = rclcpp::Node::make_shared("rtabmapviz");
|
||||||
if (rclcpp::spin_until_future_complete(node, result_future) !=
|
if (rclcpp::spin_until_future_complete(node, result_future) !=
|
||||||
rclcpp::executor::FutureReturnCode::SUCCESS)
|
rclcpp::FutureReturnCode::SUCCESS)
|
||||||
{
|
{
|
||||||
RCLCPP_ERROR(this->get_logger(),
|
RCLCPP_ERROR(this->get_logger(),
|
||||||
"Can't call \"%s\" service.", name.c_str());
|
"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;
|
request->graph_only = graphOnly;
|
||||||
auto result_future = client->async_send_request(request);
|
auto result_future = client->async_send_request(request);
|
||||||
auto node = rclcpp::Node::make_shared("rtabmapviz");
|
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());
|
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);
|
auto results = client->set_parameters(rosParameters);
|
||||||
// Wait for the results.
|
// Wait for the results.
|
||||||
if (rclcpp::spin_until_future_complete(node, results, std::chrono::seconds(5)) !=
|
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!");
|
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 result_future = client->async_send_request(request);
|
||||||
auto node = rclcpp::Node::make_shared("rtabmapviz");
|
auto node = rclcpp::Node::make_shared("rtabmapviz");
|
||||||
if (rclcpp::spin_until_future_complete(node, result_future) !=
|
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.");
|
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 result_future = client->async_send_request(request);
|
||||||
auto node = rclcpp::Node::make_shared("rtabmapviz");
|
auto node = rclcpp::Node::make_shared("rtabmapviz");
|
||||||
if (rclcpp::spin_until_future_complete(node, result_future) !=
|
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.");
|
RCLCPP_ERROR(this->get_logger(), "Can't call \"set_label\" service.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ bool PreferencesDialogROS::readCoreSettings(const QString & filePath)
|
|||||||
{
|
{
|
||||||
auto parameters = client->get_parameters(rosParameters);
|
auto parameters = client->get_parameters(rosParameters);
|
||||||
if (rclcpp::spin_until_future_complete(node, parameters, std::chrono::seconds(5)) ==
|
if (rclcpp::spin_until_future_complete(node, parameters, std::chrono::seconds(5)) ==
|
||||||
rclcpp::executor::FutureReturnCode::SUCCESS)
|
rclcpp::FutureReturnCode::SUCCESS)
|
||||||
{
|
{
|
||||||
for (auto & parameter : parameters.get()) {
|
for (auto & parameter : parameters.get()) {
|
||||||
const std::string & key = parameter.get_name();
|
const std::string & key = parameter.get_name();
|
||||||
@@ -191,4 +191,3 @@ void PreferencesDialogROS::writeCoreSettings(const QString & filePath) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ void MapCloudDisplay::downloadMap()
|
|||||||
request->optimized = true;
|
request->optimized = true;
|
||||||
request->graph_only = false;
|
request->graph_only = false;
|
||||||
auto result_future = client->async_send_request(request);
|
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.");
|
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->optimized = true;
|
||||||
request->graph_only = true;
|
request->graph_only = true;
|
||||||
auto result_future = client->async_send_request(request);
|
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.");
|
RCLCPP_ERROR(node->get_logger(), "Service \"get_map_data\" failed to get the data.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user