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

Function createRationalFunctionWorld

grid_map_core/test/test_helpers.cpp:36–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36AnalyticalFunctions createRationalFunctionWorld(grid_map::GridMap *map)
37{
38
39 AnalyticalFunctions func;
40
41 std::uniform_real_distribution<double> shift(-3.0, 3.0);
42 std::uniform_real_distribution<double> scale(1.0, 20.0);
43 const double x0 = shift(rndGenerator);
44 const double y0 = shift(rndGenerator);
45 const double s = scale(rndGenerator);
46
47 func.f_ = [x0, y0,s](double x, double y) {
48 return s / (1 + std::pow(x-x0, 2.0) + std::pow(y-y0, 2.0));
49 };
50
51 fillGridMap(map, func);
52
53 return func;
54
55}
56
57AnalyticalFunctions createSecondOrderPolyWorld(grid_map::GridMap *map)
58{

Callers 2

TESTFunction · 0.85
TESTFunction · 0.85

Calls 1

fillGridMapFunction · 0.70

Tested by

no test coverage detected