| 299 | } |
| 300 | |
| 301 | InterpolationDemo::ErrorAndDuration InterpolationDemo::interpolateAndComputeError( |
| 302 | const std::string world, const std::string &method) const |
| 303 | { |
| 304 | grid_map::GridMap highResMap, dataMap; |
| 305 | auto groundTruth = createWorld(worlds.at(world), groundTruthResolution_, dataResolution_, |
| 306 | worldLength_, worldWidth_, &highResMap, &dataMap); |
| 307 | |
| 308 | auto interpolatedMap = createInterpolatedMapFromDataMap(dataMap, interpolatedResolution_); |
| 309 | const auto start = clk::now(); |
| 310 | interpolateInputMap(dataMap, interpolationMethods.at(method), &interpolatedMap); |
| 311 | const auto end = clk::now(); |
| 312 | const auto count = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count(); |
| 313 | const unsigned int numElements = interpolatedMap_.getSize().x() * interpolatedMap_.getSize().y(); |
| 314 | |
| 315 | ErrorAndDuration errorAndDuration; |
| 316 | errorAndDuration.first = computeInterpolationError(groundTruth, interpolatedMap); |
| 317 | errorAndDuration.second = static_cast<double>(count) / numElements; |
| 318 | return errorAndDuration; |
| 319 | } |
| 320 | |
| 321 | void InterpolationDemo::printStatistics(const Statistics &stats) const |
| 322 | { |
nothing calls this directly
no test coverage detected