Bratmobile
measurement.h
1 #ifndef MEASUREMENT_H
2 #define MEASUREMENT_H
3 #include "graphTools.h"
4 
5 
6 class Measurement{
7 protected:
8  bool valid =0;
9  float value=0;
10 public:
11  Measurement(){}
12 
13  bool isValid(){
14  return valid;
15  }
16 
17  float get_signed(){
18  return value;
19  }
20 
21  //returns unsigned value
22  float get(){
23  return fabs(value);
24  }
25 
26  void set(float f){
27  value =f;
28  }
29 
30  void setValid(bool b){
31  valid = b;
32  }
33 
34  bool operator<(Measurement &);
35 
36  bool operator<=(Measurement &);
37 
38  bool operator>=(Measurement &);
39 
40  float getStandardError(Measurement, float); //relative standard error
41 
42 };
43 
44 class Angle: public Measurement{
45  public:
46  Angle(){}
47  Angle(float f)
48  { value =round(f*1000)/1000;
49  valid =1;}
50 };
51 
52 class Distance: public Measurement{
53  public:
54  Distance(){}
55  Distance(float f)
56  {value = round(f*1000)/1000;
57  valid =1;}
58 };
59 
60 struct EndCriteria{
61  Angle angle;
62  Distance distance; //max distance, ideal
63  bool outOfSight=true;
64  bool valid_d=false;
65  float getStandardError(Angle, Distance);
66  float getStandardError(Angle, Distance, State);
67  bool hasEnd();
68 
69  void adjust(const b2Transform&);
70 
71 };
72 
73 
74 struct EndedResult{
75  bool ended=0;
76  float estimatedCost=0; //dot product of end criteria
77  float cost=0;
78 
79  EndedResult() = default;
80 
81 };
82 
83 float SignedVectorLength(b2Vec2);
84 
85 
86 #endif
Definition: measurement.h:44
Definition: measurement.h:52
Definition: measurement.h:6
Definition: measurement.h:60
Definition: measurement.h:74
Hybrid states in the transition system.
Definition: graphTools.h:69