merged master->ros2

This commit is contained in:
matlabbe
2022-01-20 20:26:58 -05:00
9 changed files with 127 additions and 27 deletions
+17
View File
@@ -51,6 +51,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "rtabmap_ros/MsgConversion.h"
#include "rtabmap_ros/srv/set_goal.hpp"
#include "rtabmap_ros/srv/set_label.hpp"
#include "rtabmap_ros/srv/remove_label.hpp"
#include "rtabmap_ros/PreferencesDialogROS.h"
float max3( const float& a, const float& b, const float& c)
@@ -442,6 +443,22 @@ bool GuiWrapper::handleEvent(UEvent * anEvent)
RCLCPP_WARN(this->get_logger(), "Service \"set_label\" not available.");
}
}
else if(cmd == rtabmap::RtabmapEventCmd::kCmdRemoveLabel)
{
UASSERT(cmdEvent->value1().isStr());
auto client = this->create_client<rtabmap_ros::srv::RemoveLabel>("remove_label");
if(client->wait_for_service(std::chrono::seconds(1)))
{
auto request = std::make_shared<rtabmap_ros::srv::RemoveLabel::Request>();
request->label = cmdEvent->value1().toStr();
auto result_future = client->async_send_request(request);
result_future.wait();
}
else
{
RCLCPP_WARN(this->get_logger(), "Service \"remove_label\" not available.");
}
}
else
{
RCLCPP_WARN(this->get_logger(), "Not handled command (%d)...", cmd);