-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLocalizationManager.h
More file actions
48 lines (39 loc) · 1.12 KB
/
LocalizationManager.h
File metadata and controls
48 lines (39 loc) · 1.12 KB
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
#ifndef LOCALIZATIONMANAGER_H_
#define LOCALIZATIONMANAGER_H_
#include "Particle.h"
#include <vector>
#include <HamsterAPIClientCPP/Hamster.h>
#include <iostream>
#include <cmath>
#define PARTICLES_NUM 500
#define DEL_PARTICLE 200
#define RADIUS 8
#define ROULETTE 5
#define TRASHOLD 0.5
using namespace std;
using namespace HamsterAPI;
class LocalizationManager {
private:
vector<Particle *> particlesVector;
const OccupancyGrid &ogrid;//map
Hamster *hamster;
void getRandomLocation(Particle *particle);
double computeBelief(Particle *particle);
struct myclass //comparator for the sort
{
bool operator()(Particle * par1 , Particle * par2){
return (par1->belief < par2->belief);
}
}lessThanBelief;
public:
void getParticleIfCellNotFree(Particle *particle);
int rouletteWheel();
void getRandomNearGoodParticles();
LocalizationManager(const OccupancyGrid &ogrid, Hamster *hamster);
void initParticles();
void updateParticles(double deltaX, double deltaY, double deltaYaw);
void printParticles() const;
vector<Particle *> getParticles() const;
virtual ~LocalizationManager();
};
#endif /* LOCALIZATIONMANAGER_H_ */