MCPcopy Create free account
hub / github.com/TUC-ProAut/libRSF / ATE

Function ATE

test/TestUtils.cpp:36–76  ·  view source on GitHub ↗

\brief RMSE between two datasets (mean) * * \param TypeGT the type of the GT data * \param GT a data set that holds the GT * \param TypeEstimate type of the estimate * \param Estimate data set that holds the estimation * \return root mean square error between GT and estimate */

Source from the content-addressed store, hash-verified

34 * \return root mean square error between GT and estimate
35 */
36 double ATE(const DataType TypeGT,
37 const SensorDataSet &GT,
38 const std::string &TypeEstimate,
39 const StateDataSet &Estimate)
40 {
41 /** check length */
42 const int LengthGT = GT.countElements(TypeGT);
43 const int LengthEstimate = Estimate.countElements(TypeEstimate);
44
45 /** return error if not equal */
46 if (LengthGT != LengthEstimate)
47 {
48 PRINT_ERROR("Length of GT and estimate is not identical!");
49 return std::numeric_limits<double>::quiet_NaN();
50 }
51
52 /** vector to store errors */
53 Vector Error(LengthEstimate);
54
55 /** get first timestamp */
56 double Time = 0.0;
57 GT.getTimeFirst(TypeGT, Time);
58
59 /** fill error vector */
60 int n = 0;
61 do
62 {
63 /** get data at this timestamp */
64 Data DataGT, DataEstimate;
65 Estimate.getElement(TypeEstimate, Time, 0, DataEstimate);
66 GT.getElement(TypeGT, Time, 0, DataGT);
67
68 /** euclidean distance*/
69 Error(n) = (DataEstimate.getMean() - DataGT.getMean()).norm();
70 n++;
71 }
72 while(GT.getTimeNext(TypeGT, Time, Time));
73
74 /** apply RMSE */
75 return RMSE(Error);
76 }
77
78
79 /** \brief maximum componentwise absolute difference between two datasets (mean and covariance)

Callers 2

TESTFunction · 0.85
TESTFunction · 0.85

Calls 6

RMSEFunction · 0.85
countElementsMethod · 0.80
getElementMethod · 0.80
getTimeNextMethod · 0.80
getTimeFirstMethod · 0.45
getMeanMethod · 0.45

Tested by

no test coverage detected