\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 */
| 34 | * \return root mean square error between GT and estimate |
| 35 | */ |
| 36 | double ATE(const DataType TypeGT, |
| 37 | const SensorDataSet >, |
| 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) |
no test coverage detected