update
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
// gtest
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace gm = grid_map;
|
||||
namespace gm = robot_grid_map;
|
||||
namespace gmt = grid_map_test;
|
||||
|
||||
TEST(CubicConvolutionInterpolation, FlatWorld)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// gtest
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace gm = grid_map;
|
||||
namespace gm = robot_grid_map;
|
||||
namespace gmt = grid_map_test;
|
||||
|
||||
TEST(CubicInterpolation, FlatWorld)
|
||||
|
||||
@@ -106,7 +106,7 @@ TEST(EigenMatrixBaseAddons, clamp)
|
||||
Eigen::Matrix3f matrix;
|
||||
matrix << vector.segment(0, 3), vector.segment(3, 3), vector.segment(6, 3);
|
||||
matrix(1, 1) = NAN;
|
||||
matrix = matrix.unaryExpr(grid_map::Clamp<float>(2.1, 7.0));
|
||||
matrix = matrix.unaryExpr(robot_grid_map::Clamp<float>(2.1, 7.0));
|
||||
EXPECT_NEAR(2.1, matrix(0, 0), 1e-7);
|
||||
EXPECT_NEAR(2.1, matrix(1, 0), 1e-7);
|
||||
EXPECT_NEAR(3.0, matrix(2, 0), 1e-7);
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
// Vector
|
||||
#include <vector>
|
||||
|
||||
using grid_map::GridMap;
|
||||
using grid_map::Length;
|
||||
using grid_map::Position;
|
||||
using grid_map::EllipseIterator;
|
||||
using robot_grid_map::GridMap;
|
||||
using robot_grid_map::Length;
|
||||
using robot_grid_map::Position;
|
||||
using robot_grid_map::EllipseIterator;
|
||||
|
||||
TEST(EllipseIterator, OneCellWideEllipse)
|
||||
{
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
// Vector
|
||||
#include <vector>
|
||||
|
||||
using grid_map::GridMap;
|
||||
using grid_map::Length;
|
||||
using grid_map::Position;
|
||||
using grid_map::GridMapIterator;
|
||||
using robot_grid_map::GridMap;
|
||||
using robot_grid_map::Length;
|
||||
using robot_grid_map::Position;
|
||||
using robot_grid_map::GridMapIterator;
|
||||
|
||||
TEST(GridMapIterator, Simple)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
using std::numeric_limits;
|
||||
|
||||
namespace grid_map{
|
||||
namespace robot_grid_map{
|
||||
|
||||
TEST(PositionFromIndex, Simple)
|
||||
{
|
||||
@@ -1036,4 +1036,4 @@ TEST(getIndexFromLinearIndex, Simple)
|
||||
EXPECT_TRUE((Index(7, 4) == getIndexFromLinearIndex(39, Size(8, 5), false)).all());
|
||||
}
|
||||
|
||||
} // namespace grid_map
|
||||
} // namespace robot_grid_map
|
||||
@@ -11,7 +11,7 @@
|
||||
// gtest
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace grid_map {
|
||||
namespace robot_grid_map {
|
||||
|
||||
TEST(GridMap, CopyConstructor) {
|
||||
GridMap map({"layer_a", "layer_b"});
|
||||
@@ -493,4 +493,4 @@ TEST(ValueAtPosition, LinearInterpolated)
|
||||
EXPECT_NEAR(2.1963200, value, 0.0000001);
|
||||
}
|
||||
|
||||
} // namespace grid_map
|
||||
} // namespace robot_grid_map
|
||||
@@ -12,7 +12,7 @@
|
||||
// gtest
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace grid_map {
|
||||
namespace robot_grid_map {
|
||||
|
||||
TEST(LineIterator, StartOutsideMap) {
|
||||
GridMap map( { "types" });
|
||||
@@ -175,4 +175,4 @@ TEST(LineIterator, StartAndEndOutsideMovedMap)
|
||||
EXPECT_TRUE(iterator.isPastEnd());
|
||||
}
|
||||
|
||||
} // namespace grid_map
|
||||
} // namespace robot_grid_map
|
||||
@@ -16,11 +16,11 @@
|
||||
// Vector
|
||||
#include <vector>
|
||||
|
||||
using grid_map::GridMap;
|
||||
using grid_map::Length;
|
||||
using grid_map::Polygon;
|
||||
using grid_map::PolygonIterator;
|
||||
using grid_map::Position;
|
||||
using robot_grid_map::GridMap;
|
||||
using robot_grid_map::Length;
|
||||
using robot_grid_map::Polygon;
|
||||
using robot_grid_map::PolygonIterator;
|
||||
using robot_grid_map::Position;
|
||||
|
||||
TEST(PolygonIterator, FullCover) {
|
||||
std::vector<std::string> types;
|
||||
|
||||
@@ -18,9 +18,9 @@ using Eigen::MatrixXd;
|
||||
using Eigen::Vector2d;
|
||||
using Eigen::VectorXd;
|
||||
|
||||
using grid_map::Length;
|
||||
using grid_map::Polygon;
|
||||
using grid_map::Position;
|
||||
using robot_grid_map::Length;
|
||||
using robot_grid_map::Polygon;
|
||||
using robot_grid_map::Position;
|
||||
|
||||
TEST(Polygon, getCentroidTriangle)
|
||||
{
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <vector>
|
||||
|
||||
using grid_map::GridMap;
|
||||
using grid_map::Index;
|
||||
using grid_map::Length;
|
||||
using grid_map::Position;
|
||||
using grid_map::SlidingWindowIterator;
|
||||
using robot_grid_map::GridMap;
|
||||
using robot_grid_map::Index;
|
||||
using robot_grid_map::Length;
|
||||
using robot_grid_map::Position;
|
||||
using robot_grid_map::SlidingWindowIterator;
|
||||
|
||||
TEST(SlidingWindowIterator, WindowSize3Cutoff)
|
||||
{
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
// Vector
|
||||
#include <vector>
|
||||
|
||||
using grid_map::GridMap;
|
||||
using grid_map::Length;
|
||||
using grid_map::Position;
|
||||
using grid_map::SpiralIterator;
|
||||
using robot_grid_map::GridMap;
|
||||
using robot_grid_map::Length;
|
||||
using robot_grid_map::Position;
|
||||
using robot_grid_map::SpiralIterator;
|
||||
|
||||
TEST(SpiralIterator, CenterOutOfMap)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
using std::vector;
|
||||
using std::string;
|
||||
|
||||
namespace grid_map{
|
||||
namespace robot_grid_map{
|
||||
|
||||
TEST(SubmapIterator, Simple) {
|
||||
Eigen::Array2i submapTopLeftIndex(3, 1);
|
||||
@@ -191,8 +191,8 @@ TEST(SubmapIterator, CircularBuffer) {
|
||||
* +----------------------------+
|
||||
*/
|
||||
TEST(SubmapIterator, InterleavedExecutionWithMove) {
|
||||
grid_map::Index submapTopLeftIndex(3, 1);
|
||||
grid_map::Size submapSize(2, 2);
|
||||
robot_grid_map::Index submapTopLeftIndex(3, 1);
|
||||
robot_grid_map::Size submapSize(2, 2);
|
||||
|
||||
GridMap map({"layer"});
|
||||
|
||||
@@ -264,4 +264,4 @@ TEST(SubmapIterator, InterleavedExecutionWithMove) {
|
||||
// });
|
||||
}
|
||||
|
||||
} // namespace grid_map
|
||||
} // namespace robot_grid_map
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace grid_map_test {
|
||||
|
||||
std::mt19937 rndGenerator;
|
||||
|
||||
AnalyticalFunctions createFlatWorld(grid_map::GridMap *map)
|
||||
AnalyticalFunctions createFlatWorld(robot_grid_map::GridMap *map)
|
||||
{
|
||||
|
||||
AnalyticalFunctions func;
|
||||
@@ -33,7 +33,7 @@ AnalyticalFunctions createFlatWorld(grid_map::GridMap *map)
|
||||
|
||||
}
|
||||
|
||||
AnalyticalFunctions createRationalFunctionWorld(grid_map::GridMap *map)
|
||||
AnalyticalFunctions createRationalFunctionWorld(robot_grid_map::GridMap *map)
|
||||
{
|
||||
|
||||
AnalyticalFunctions func;
|
||||
@@ -54,7 +54,7 @@ AnalyticalFunctions createRationalFunctionWorld(grid_map::GridMap *map)
|
||||
|
||||
}
|
||||
|
||||
AnalyticalFunctions createSecondOrderPolyWorld(grid_map::GridMap *map)
|
||||
AnalyticalFunctions createSecondOrderPolyWorld(robot_grid_map::GridMap *map)
|
||||
{
|
||||
|
||||
AnalyticalFunctions func;
|
||||
@@ -69,7 +69,7 @@ AnalyticalFunctions createSecondOrderPolyWorld(grid_map::GridMap *map)
|
||||
|
||||
}
|
||||
|
||||
AnalyticalFunctions createSaddleWorld(grid_map::GridMap *map)
|
||||
AnalyticalFunctions createSaddleWorld(robot_grid_map::GridMap *map)
|
||||
{
|
||||
AnalyticalFunctions func;
|
||||
|
||||
@@ -83,7 +83,7 @@ AnalyticalFunctions createSaddleWorld(grid_map::GridMap *map)
|
||||
|
||||
}
|
||||
|
||||
AnalyticalFunctions createSineWorld(grid_map::GridMap *map)
|
||||
AnalyticalFunctions createSineWorld(robot_grid_map::GridMap *map)
|
||||
{
|
||||
|
||||
AnalyticalFunctions func;
|
||||
@@ -104,7 +104,7 @@ AnalyticalFunctions createSineWorld(grid_map::GridMap *map)
|
||||
|
||||
}
|
||||
|
||||
AnalyticalFunctions createTanhWorld(grid_map::GridMap *map)
|
||||
AnalyticalFunctions createTanhWorld(robot_grid_map::GridMap *map)
|
||||
{
|
||||
|
||||
AnalyticalFunctions func;
|
||||
@@ -121,7 +121,7 @@ AnalyticalFunctions createTanhWorld(grid_map::GridMap *map)
|
||||
return func;
|
||||
}
|
||||
|
||||
AnalyticalFunctions createGaussianWorld(grid_map::GridMap *map)
|
||||
AnalyticalFunctions createGaussianWorld(robot_grid_map::GridMap *map)
|
||||
{
|
||||
|
||||
struct Gaussian
|
||||
@@ -166,13 +166,13 @@ AnalyticalFunctions createGaussianWorld(grid_map::GridMap *map)
|
||||
return func;
|
||||
}
|
||||
|
||||
void fillGridMap(grid_map::GridMap *map, const AnalyticalFunctions &functions)
|
||||
void fillGridMap(robot_grid_map::GridMap *map, const AnalyticalFunctions &functions)
|
||||
{
|
||||
using grid_map::DataType;
|
||||
using grid_map::GridMapIterator;
|
||||
using grid_map::Index;
|
||||
using grid_map::Matrix;
|
||||
using grid_map::Position;
|
||||
using robot_grid_map::DataType;
|
||||
using robot_grid_map::GridMapIterator;
|
||||
using robot_grid_map::Index;
|
||||
using robot_grid_map::Matrix;
|
||||
using robot_grid_map::Position;
|
||||
|
||||
Matrix& data = (*map)[testLayer];
|
||||
for (GridMapIterator iterator(*map); !iterator.isPastEnd(); ++iterator) {
|
||||
@@ -183,10 +183,10 @@ void fillGridMap(grid_map::GridMap *map, const AnalyticalFunctions &functions)
|
||||
}
|
||||
}
|
||||
|
||||
grid_map::GridMap createMap(const grid_map::Length &length, double resolution,
|
||||
const grid_map::Position &pos)
|
||||
robot_grid_map::GridMap createMap(const robot_grid_map::Length &length, double resolution,
|
||||
const robot_grid_map::Position &pos)
|
||||
{
|
||||
grid_map::GridMap map;
|
||||
robot_grid_map::GridMap map;
|
||||
|
||||
map.setGeometry(length, resolution, pos);
|
||||
map.add(testLayer, 0.0);
|
||||
@@ -195,7 +195,7 @@ grid_map::GridMap createMap(const grid_map::Length &length, double resolution,
|
||||
return map;
|
||||
}
|
||||
|
||||
std::vector<Point2D> uniformlyDitributedPointsWithinMap(const grid_map::GridMap &map,
|
||||
std::vector<Point2D> uniformlyDitributedPointsWithinMap(const robot_grid_map::GridMap &map,
|
||||
unsigned int numPoints)
|
||||
{
|
||||
|
||||
@@ -215,11 +215,11 @@ std::vector<Point2D> uniformlyDitributedPointsWithinMap(const grid_map::GridMap
|
||||
return points;
|
||||
}
|
||||
|
||||
void verifyValuesAtQueryPointsAreClose(const grid_map::GridMap &map, const AnalyticalFunctions &trueValues,
|
||||
void verifyValuesAtQueryPointsAreClose(const robot_grid_map::GridMap &map, const AnalyticalFunctions &trueValues,
|
||||
const std::vector<Point2D> &queryPoints,
|
||||
grid_map::InterpolationMethods interpolationMethod){
|
||||
robot_grid_map::InterpolationMethods interpolationMethod){
|
||||
for (const auto point : queryPoints) {
|
||||
const grid_map::Position p(point.x_, point.y_);
|
||||
const robot_grid_map::Position p(point.x_, point.y_);
|
||||
const double trueValue = trueValues.f_(p.x(), p.y());
|
||||
const double interpolatedValue = map.atPosition(
|
||||
grid_map_test::testLayer, p, interpolationMethod);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <vector>
|
||||
#include <random>
|
||||
|
||||
namespace grid_map {
|
||||
namespace robot_grid_map {
|
||||
class GridMap;
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ extern std::mt19937 rndGenerator;
|
||||
// Maximal tolerance when comparing doubles in tests.
|
||||
const double maxAbsErrorValue = 1e-3;
|
||||
|
||||
grid_map::GridMap createMap(const grid_map::Length &length, double resolution,
|
||||
const grid_map::Position &pos);
|
||||
robot_grid_map::GridMap createMap(const robot_grid_map::Length &length, double resolution,
|
||||
const robot_grid_map::Position &pos);
|
||||
|
||||
/*
|
||||
* Collections of methods that modify the grid map.
|
||||
@@ -64,24 +64,24 @@ grid_map::GridMap createMap(const grid_map::Length &length, double resolution,
|
||||
* function.
|
||||
* Each method returns a structure containing the analytical function.
|
||||
*/
|
||||
AnalyticalFunctions createFlatWorld(grid_map::GridMap *map);
|
||||
AnalyticalFunctions createRationalFunctionWorld(grid_map::GridMap *map);
|
||||
AnalyticalFunctions createSaddleWorld(grid_map::GridMap *map);
|
||||
AnalyticalFunctions createSecondOrderPolyWorld(grid_map::GridMap *map);
|
||||
AnalyticalFunctions createSineWorld(grid_map::GridMap *map);
|
||||
AnalyticalFunctions createTanhWorld(grid_map::GridMap *map);
|
||||
AnalyticalFunctions createGaussianWorld(grid_map::GridMap *map);
|
||||
AnalyticalFunctions createFlatWorld(robot_grid_map::GridMap *map);
|
||||
AnalyticalFunctions createRationalFunctionWorld(robot_grid_map::GridMap *map);
|
||||
AnalyticalFunctions createSaddleWorld(robot_grid_map::GridMap *map);
|
||||
AnalyticalFunctions createSecondOrderPolyWorld(robot_grid_map::GridMap *map);
|
||||
AnalyticalFunctions createSineWorld(robot_grid_map::GridMap *map);
|
||||
AnalyticalFunctions createTanhWorld(robot_grid_map::GridMap *map);
|
||||
AnalyticalFunctions createGaussianWorld(robot_grid_map::GridMap *map);
|
||||
|
||||
/*
|
||||
* Iterates over the grid map and fill it with values.
|
||||
* values are calculated by evaluating analytical function.
|
||||
*/
|
||||
void fillGridMap(grid_map::GridMap *map, const AnalyticalFunctions &functions);
|
||||
void fillGridMap(robot_grid_map::GridMap *map, const AnalyticalFunctions &functions);
|
||||
|
||||
/*
|
||||
* Create numPoints uniformly distributed random points that lie within the grid map.
|
||||
*/
|
||||
std::vector<Point2D> uniformlyDitributedPointsWithinMap(const grid_map::GridMap &map,
|
||||
std::vector<Point2D> uniformlyDitributedPointsWithinMap(const robot_grid_map::GridMap &map,
|
||||
unsigned int numPoints);
|
||||
|
||||
/*
|
||||
@@ -89,8 +89,8 @@ std::vector<Point2D> uniformlyDitributedPointsWithinMap(const grid_map::GridMap
|
||||
* is close to the ground truth which is contained in Analytical functions structure.
|
||||
* Called inside the tests. Calls macros from gtest.
|
||||
*/
|
||||
void verifyValuesAtQueryPointsAreClose(const grid_map::GridMap &map, const AnalyticalFunctions &trueValues,
|
||||
void verifyValuesAtQueryPointsAreClose(const robot_grid_map::GridMap &map, const AnalyticalFunctions &trueValues,
|
||||
const std::vector<Point2D> &queryPoints,
|
||||
grid_map::InterpolationMethods interpolationMethod);
|
||||
robot_grid_map::InterpolationMethods interpolationMethod);
|
||||
|
||||
} // namespace grid_map_test
|
||||
|
||||
Reference in New Issue
Block a user