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
#ifndef MaskingManager_H
#define MaskingManager_H
#include <ros/ros.h>
#include "nav_msgs/OccupancyGrid.h"
#include "homer_mapnav_msgs/ModifyMap.h"
/**
* @class MaskingManager
* @brief Manages a map that can overwrite values in the SLAM map or store it in a separate layer
* @author Malte Knauf, David Gossow
*/
class MaskingManager
{
public:
/** @brief The constructor. */
MaskingManager(int mapSize, float resolution);
/** @brief The destructor. */
virtual ~MaskingManager();
/** modifies either the masking layer or the slam layer (accordingly to the given map layer in the msg */
nav_msgs::OccupancyGrid::ConstPtr modifyMap(homer_mapnav_msgs::ModifyMap::ConstPtr msg);
/** resets the masking map layer */
nav_msgs::OccupancyGrid::ConstPtr resetMap();
/** replaces the masking map layer */
void replaceMap(nav_msgs::OccupancyGrid map);
private:
/** stores the masking values in the dedicated masking map */
nav_msgs::OccupancyGrid m_MaskingMap;
/** stores the masking values that are afterwards sent to the slam map */
nav_msgs::OccupancyGrid m_SlamMap;
/** sizes of the masking map layer */
int m_Width, m_Height;
float m_CellSize;
/** tools to draw masking polygons */
void drawPolygon ( std::vector< geometry_msgs::Point > vertices, int value, int mapLayer );
void drawLine ( std::vector<int> &data, int startX, int startY, int endX, int endY, int value );
void fillPolygon ( std::vector<int> &data, int x, int y, int value );
};
#endif