-
Notifications
You must be signed in to change notification settings - Fork 0
/
metric_map.h
71 lines (51 loc) · 1.89 KB
/
metric_map.h
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
#ifndef __METRIC_MAP_H__
#define __METRIC_MAP_H__
#include <opencv2/opencv.hpp>
#include "graph.h"
#include "singleton.h"
#include "super_matrix.h"
#include <gslwrap/vector_double.h>
#include <gslwrap/matrix_double.h>
#include <gslwrap/vector_int.h>
#include <libplayerc++/playerc++.h>
#include "orloc.h"
namespace HybNav {
class OccupancyGrid;
enum Direction { North, East, South, West };
class MetricMap : public Singleton<MetricMap> {
public:
/* constructor */
MetricMap(void);
/* methods */
void update_position(const gsl::vector& delta_pos, double delta_rot);
void process_distances(PlayerCc::Position2dProxy& position_proxy/*, PlayerCc::LaserProxy& laser_proxy*/, const HybNav::Scan& scan);
//void update_window(PlayerCc::Position2dProxy& position_proxy, PlayerCc::LaserProxy& laser_proxy);
bool in_grid(const gsl::vector& coord);
gsl::vector_int grid_position(void);
static Direction vector2direction(const gsl::vector_int& v);
static gsl::vector_int direction2vector(Direction dir);
static Direction opposite_direction(Direction dir);
// TODO: coord2index
void save(void);
void draw(cv::Mat& frame, bool draw_gateways = true);
/* constants */
static uint WINDOW_RADIUS_CELLS;
static uint WINDOW_SIZE_CELLS;
static double SENSOR_MODEL_DELTA;
static double frontier_cell_threshold;
OccupancyGrid* current_grid;
gsl::vector position;
gsl::matrix window, debug_window, temporary_matrix;
double rotation;
SuperMatrix<OccupancyGrid> super_matrix;
private:
enum NodeDirections { NorthEast, NorthWest, SouthEast, SouthWest };
double sensor_model(double r, double delta);
};
}
std::ostream& operator<<(std::ostream& out, HybNav::Direction dir);
#ifndef __TOPOMAP_H__
#include "topo_map.h"
#include "occupancy_grid.h"
#endif
#endif