MCPcopy Create free account
hub / github.com/ANYbotics/grid_map / interpolateAndComputeError

Method interpolateAndComputeError

grid_map_demos/src/InterpolationDemo.cpp:301–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301InterpolationDemo::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
321void InterpolationDemo::printStatistics(const Statistics &stats) const
322{

Callers

nothing calls this directly

Calls 5

createWorldFunction · 0.85
interpolateInputMapFunction · 0.85
atMethod · 0.80

Tested by

no test coverage detected