6#ifndef YARP_DEV_MAP2D_NWS_ROS2_H
7#define YARP_DEV_MAP2D_NWS_ROS2_H
39#include <rclcpp/rclcpp.hpp>
41#include <nav_msgs/msg/occupancy_grid.hpp>
42#include <nav_msgs/srv/get_map.hpp>
43#include <test_msgs/srv/basic_types.hpp>
44#include <visualization_msgs/msg/marker_array.hpp>
45#include <visualization_msgs/msg/marker.hpp>
48#include <map2d_nws_ros2_msgs/srv/get_map_by_name.hpp>
82 bool close()
override;
86 void getMapCallback(
const std::shared_ptr<rmw_request_id_t> request_header,
87 const std::shared_ptr<nav_msgs::srv::GetMap::Request> request,
88 std::shared_ptr<nav_msgs::srv::GetMap::Response> response);
90 const std::shared_ptr<map2d_nws_ros2_msgs::srv::GetMapByName::Request> request,
91 std::shared_ptr<map2d_nws_ros2_msgs::srv::GetMapByName::Response> response);
93 const std::shared_ptr<test_msgs::srv::BasicTypes::Request> request,
94 std::shared_ptr<test_msgs::srv::BasicTypes::Response> response);
105 std::string m_rpcPortName;
106 std::string m_currentMapName{
"none"};
107 bool m_spinned{
false};
110 rclcpp::Node::SharedPtr m_node;
111 rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr m_ros2Publisher_markers{
nullptr};
112 rclcpp::Publisher<nav_msgs::msg::OccupancyGrid>::SharedPtr m_ros2Publisher_map{
nullptr};
113 rclcpp::Service<nav_msgs::srv::GetMap>::SharedPtr m_ros2Service_getMap{
nullptr};
114 rclcpp::Service<map2d_nws_ros2_msgs::srv::GetMapByName>::SharedPtr m_ros2Service_getMapByName{
nullptr};
115 rclcpp::Service<test_msgs::srv::BasicTypes>::SharedPtr m_ros2Service_rosCmdParser{
nullptr};
contains the definition of a Map2DArea type
contains the definition of a Map2DLocation type
contains the definition of a Map2DPath type
contains the definition of a map type
contains the definition of a Vector type
This class is the parameters parser for class Map2D_nws_ros2.
Map2D_nws_ros2: A device capable of read/save collections of maps from disk, and make them accessible...
~Map2D_nws_ros2() override=default
void getMapCallback(const std::shared_ptr< rmw_request_id_t > request_header, const std::shared_ptr< nav_msgs::srv::GetMap::Request > request, std::shared_ptr< nav_msgs::srv::GetMap::Response > response)
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
void getMapByNameCallback(const std::shared_ptr< rmw_request_id_t > request_header, const std::shared_ptr< map2d_nws_ros2_msgs::srv::GetMapByName::Request > request, std::shared_ptr< map2d_nws_ros2_msgs::srv::GetMapByName::Response > response)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool close() override
Close the DeviceDriver.
bool attach(yarp::dev::PolyDriver *driver) override
Attach to another object.
void rosCmdParserCallback(const std::shared_ptr< rmw_request_id_t > request_header, const std::shared_ptr< test_msgs::srv::BasicTypes::Request > request, std::shared_ptr< test_msgs::srv::BasicTypes::Response > response)
void run() override
Main body of the new thread.
bool detach() override
Detach the object (you must have first called attach).
Interface implemented by all device drivers.
A container for a device driver.
Helper interface for an object that can wrap/or "attach" to a single other device.
An interface for reading from a network connection.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
A port that is specialized as an RPC server.
A base class for nested structures that can be searched.
An abstraction for a thread of execution.