-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRelativeMultiFlock.h
94 lines (75 loc) · 1.59 KB
/
RelativeMultiFlock.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* RelativeMultiFlock.h
*
* Created on: Oct 31, 2014
* Author: chenxiaoyu
*/
#ifndef RELATIVEMULTIFLOCK_H_
#define RELATIVEMULTIFLOCK_H_
#define NUM_ROBOT 4
#define FLT_EPSILON 2.2204460492503131e-16
#define MAX_TIME 1000
#define M 100
#define deltat 0.3
#define dead 0.1
typedef struct{
float x;
float y;
float heading;
}Guess;
typedef struct{
int RCCTimeStamp;
int neighbor;
float nBearing;
float nOrientation;
float nRange;
float nTV;
float nRV;
float x;
float y;
float heading;
int ATTimeStamp;
}inputdata;
//
//typedef struct{
// int t;
// int numOfNeighbors;
// int hostID;
// double deltat;
// double rv[MAX_TIME];
// double tv[MAX_TIME];
// double range[MAX_TIME];
// double orientation[MAX_TIME];
// double bearing[MAX_TIME];
// int Id[MAX_TIME];
// double p[][][];
// double pHost[][];
//}inputData;
typedef struct{
float partX[M];
float partY[M];
float partHeading[M];
float weight[M];
float nextWeight[M];
int counter;
}particleCloud;
typedef struct{
particleCloud particleClouds[NUM_ROBOT];
}particleClouds;
typedef struct{
float theta[M];
float rho[M];
}polarCoordinates;
typedef struct{
float x[M];
float y[M];
}cartCoordinates;
typedef struct{
float partX[M];
float partY[M];
float partHeading[M];
}reinject;
void particleFilter(particleCloud* original, float bearing, float orientation, float range, float tv, float rv);
void simulationInit(particleCloud* E);
void updateGuess(Guess* guess, particleCloud* X);
#endif /* RELATIVEMULTIFLOCK_H_ */