Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#ifndef MAP_MANAGER_NODE_H
#define MAP_MANAGER_NODE_H
#include <ros/ros.h>
#include <tf/transform_listener.h>
#include "Managers/MapManager.h"
#include "Managers/PoiManager.h"
#include "Managers/RoiManager.h"
#include "Managers/MaskingManager.h"
#include "std_msgs/String.h"
#include "std_msgs/Int32.h"
#include "nav_msgs/OccupancyGrid.h"
#include "homer_mapnav_msgs/MapLayers.h"
#include "homer_mapnav_msgs/ModifyMap.h"
#include "std_msgs/Empty.h"
#include "homer_mapnav_msgs/GetPointsOfInterest.h"
#include "homer_mapnav_msgs/GetRegionsOfInterest.h"
#include "homer_mapnav_msgs/ModifyPOI.h"
#include "homer_mapnav_msgs/DeletePointOfInterest.h"
#include "sensor_msgs/LaserScan.h"
#include "homer_mapnav_msgs/SaveMap.h"
#include "homer_mapnav_msgs/LoadMap.h"
#include "std_srvs/Empty.h"
/** @class MapManagerNode
* @author Malte Knauf, Viktor Seib
* @brief This class handles incoming and outgoing messages and redirects them to the according modules
*/
class MapManagerNode
{
public:
MapManagerNode(ros::NodeHandle* nh);
~MapManagerNode();
private:
/** callback functions */
/** callbacks of MapManagerModule */
void callbackSLAMMap( const nav_msgs::OccupancyGrid::ConstPtr& msg );
void callbackSaveMap( const std_msgs::String::ConstPtr& msg );
void callbackLoadMap( const std_msgs::String::ConstPtr& msg );
void callbackMapVisibility( const homer_mapnav_msgs::MapLayers::ConstPtr& msg );
void callbackResetMaps( const std_msgs::Empty::ConstPtr& msg );
/** laser scan callback */
void callbackLaserScan( const sensor_msgs::LaserScan::ConstPtr& msg );
/** callbacks of PointOfInterestManagerModule */
void callbackAddPOI( const homer_mapnav_msgs::PointOfInterest::ConstPtr& msg );
void callbackModifyPOI( const homer_mapnav_msgs::ModifyPOI::ConstPtr& msg );
void callbackDeletePOI( const homer_mapnav_msgs::DeletePointOfInterest::ConstPtr& msg );
/** callbacks of RegionOfInterestManagerModule */
void callbackAddROI( const homer_mapnav_msgs::RegionOfInterest::ConstPtr& msg );
void callbackModifyROI( const homer_mapnav_msgs::RegionOfInterest::ConstPtr& msg );
void callbackDeleteROIbyName( const std_msgs::String::ConstPtr& msg );
void callbackDeleteROIbyID( const std_msgs::Int32::ConstPtr& msg );
void callbackOctomapMap( const nav_msgs::OccupancyGrid::ConstPtr& msg);
/** callback of MaskingMapModule */
void callbackModifyMap( const homer_mapnav_msgs::ModifyMap::ConstPtr& msg );
/** service of PointOfInterestModule to get a list with all Points Of Interest */
bool getPOIsService(homer_mapnav_msgs::GetPointsOfInterest::Request& req,
homer_mapnav_msgs::GetPointsOfInterest::Response& res);
/** service of RegionOfInterestModule to get a list with all Regions Of Interest */
bool getROIsService(homer_mapnav_msgs::GetRegionsOfInterest::Request& req,
homer_mapnav_msgs::GetRegionsOfInterest::Response& res);
/** Service for saving a map**/
bool saveMapService(homer_mapnav_msgs::SaveMap::Request& req,
homer_mapnav_msgs::SaveMap::Response& res);
/** Service for loading a map**/
bool loadMapService(homer_mapnav_msgs::LoadMap::Request& req,
homer_mapnav_msgs::LoadMap::Response& res);
/** Service resetting the current map**/
bool resetMapService(std_srvs::Empty::Request& req,
std_srvs::Empty::Response& res);
/** modules that are included in this node */
MapManager* m_MapManager;
PoiManager* m_POIManager;
RoiManager* m_ROIManager;
MaskingManager* m_MaskingManager;
//ros specific members
ros::NodeHandle* m_Nodehandle;
//subscriptions of MapManagerModule here
ros::Subscriber m_SLAMMapSubscriber;
ros::Subscriber m_SaveMapSubscriber;
ros::Subscriber m_LoadMapSubscriber;
ros::Subscriber m_MapVisibilitySubscriber;
ros::Subscriber m_LaserScanSubscriber;
//subscriptions of PointOfInterestManagerModule
ros::Subscriber m_AddPOISubscriber;
ros::Subscriber m_ModifyPOISubscriber;
ros::Subscriber m_DeletePOISubscriber;
//subscriptions of RegionOfInterestManagerModule
ros::Subscriber m_AddROISubscriber;
ros::Subscriber m_ModifyROISubscriber;
ros::Subscriber m_DeleteROIByIDSubscriber;
ros::Subscriber m_DeleteROIByNameSubscriber;
//subscriptions of MaskingMapModule
ros::Subscriber m_ModifyMapSubscriber;
ros::Subscriber m_ResetMapsSubscriber;
/** publisher for loaded maps */
ros::Publisher m_LoadedMapPublisher;
/** publisher to mask slam map */
ros::Publisher m_MaskSlamMapPublisher;
/** service of PointOfInterstModule */
ros::ServiceServer m_GetPOIsService;
/** service of RegionOfInterstModule */
ros::ServiceServer m_GetROIsService;
/** Service for saving the current Map to a file **/
ros::ServiceServer m_SaveMapService;
/** Resetting the current map**/
ros::ServiceServer m_ResetMapService;
/** Service for loading a previously saved map **/
ros::ServiceServer m_LoadMapService;
tf::TransformListener m_TransformListener;
/** timestamp of last incoming laser scan message */
ros::Time m_LastLaserTime;
ros::Subscriber m_OctomapSubscriber;
nav_msgs::OccupancyGrid::ConstPtr m_highSensitiveMap;
};
#endif // MAP_MANAGER_NODE_H