-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMap.cpp
More file actions
33 lines (27 loc) · 708 Bytes
/
Map.cpp
File metadata and controls
33 lines (27 loc) · 708 Bytes
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
#include "BMap.h"
#include <iostream>
void BMap::AddBelief(int x, int y, float temp, int obs) {
if(_size < MAX_POINTS) {
Hn* point = new Hn();
point->x=x;
point->y=y;
#if ARDUINO == 1
point->t=101;
#else
point->t= time(NULL);
#endif
point->temp_1=temp;
point->is_obstacle=obs;
int s=_size;
_points[s] = point;
_maxdimx = x > _maxdimx ? x : _maxdimx;
_maxdimy = y > _maxdimy ? y : _maxdimy;
_size++;
} else {
// we cannot add anymore points due to memory pressure (perhaps!)
// need to either offload distant points to wifi
// or
// reduce using KNN
std::cout << "WARNING - need to reduce the map using KNN\n";
}
}