-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTerrainTypes.hpp
101 lines (88 loc) · 2.81 KB
/
TerrainTypes.hpp
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
95
96
97
98
99
100
101
#ifndef __TERRAIN_TYPES__
#define __TERRAIN_TYPES__
#include <vector>
#include <base/eigen.h>
#include <base/time.h>
#include "terrain_estimator/TerrainConfiguration.hpp"
namespace terrain_estimator
{
/**
* @param terrain_types - the list of terrains types in the classification
* @param min_number_of_votes - minimal number of votes needed for a terrain to be detected (each svm function counts as one vote) -
* @param svm_classifier - a vector os svm configurations for classifying terrain types
* @param number_of_histogram - the number of histograms needed for a terrain classification
*/
struct SVMClassifiers{
int number_of_histogram_combine;
std::vector< TerrainType > terrain_types;
int min_number_votes;
std::vector< SVMConfiguration > svm_classifier[4];
};
/**
* The configuration for the histogram for terrain configuration
* @param number_bins - the number of bins in the histogram
* @param histogram_max - the histogram upper limit
* @param histogram_min - the histogram lower limit
*/
struct HistogramConfiguration{
int number_bins;
double histogram_max;
double histogram_min;
};
/**
* outputs a detected slip
* @param time - the time the slip was detected (not the time it happened)
* @param wheel_idx - the wheel index where the slip was detected
* @param max_traction - the peak value within a wheel step, where a slip was detected
* @param min_traction - the minimal value within a wheel step, where a slip was detected
*/
struct SlipDetected{
base::Time time;
int wheel_idx;
double max_traction;
double min_traction;
};
/** This are Debug Only Structures*/
/**
* @param angular_velocity - the body angular velocity
* @param linar_velocity - the body linear velocity
*/
struct DebugBodyDynamics{
double angular_velocity;
double linear_velocity;
};
struct Wheelslip{
bool slip;
double traction_force;
double normal_force;
double total_slip;
double numb_slip_votes;
double encoder;
};
struct DebugSlipDetection{
bool global_slip;
base::Time time;
TerrainType terrain;
Wheelslip slip[4];
};
struct PhysicalFilter{
std::vector<double> tractions;
std::vector<double> angular_velocities;
std::vector<double> linear_velocities;
int wheel_idx;
};
/**
* @param time - the time the slip was detected (not the time it happened)
* @param wheel_idx - the wheel index where the terrain was classified
* @param terrain - the terrain type
* @param histogram - the histogram used for the classification
*/
struct TerrainClassificationHistogram{
base::Time time;
int wheel_idx;
double svm;
TerrainType terrain;
std::vector<double> histogram;
};
}
#endif