1 #ifndef OCCUPANCYMAPPARAMS_H
2 #define OCCUPANCYMAPPARAMS_H
5 #include <almath/api.h>
19 explicit Point2Di(
int _x=0,
int _y=0): x(_x), y(_y) {}
23 return (x == other.
x && y == other.
y);
36 explicit Pose2Di(
int _x=0,
int _y=0,
float _angle=0.0f)
37 : x(_x), y(_y), theta(_angle) {}
39 : x(pt.x), y(pt.y), theta(_angle) {}
45 return (x == other.
x && y == other.
y && std::abs(theta - other.
theta) < 1e-6f);
52 static inline int roundToInt(
float x) {
54 return static_cast<int>(x + 0.5f);
56 return static_cast<int>(x - 0.5f);
69 const Position2D &mapCenter,
float obstacleThreshold = 0.25f);
76 void initOriginOffset(
const Position2D &mapCenter);
82 const float kPixelPerMeter = 1.0f / metersPerPixel;
84 const float xx = (pose.
x - originOffset.
x) * kPixelPerMeter;
85 const int x = roundToInt(xx);
87 const float yy = -(pose.
y - originOffset.
y) * kPixelPerMeter;
88 const int y = roundToInt(yy);
130 float getObstacleProbabilityThreshold()
const;
144 #endif // OCCUPANCYMAPPARAMS_H
std::vector< Pose2Di > Pose2DiVect
Create and play with a Position2D.
Create a OccupancyMapParams. OccupancyMapParams are used used to define occupancy maps and to provide...
float obstacleProbabilityThreshold
Maximum pixel value of an obstacle in the map
std::vector< Pose2D > Pose2DVect
Create a Point2Di. Point2Di are used on objects that deal with pixels only, and should not care about...
Position2D originOffset
Metrical coordinate of the (0, 0) pixel.
Point2Di(int _x=0, int _y=0)
float metersPerPixel
Factor representing the metrical size of each pixel.
A pose in a 2-dimentional space.
static Point2Di getPixelFromOffsetAndScale(const Math::Pose2D &pose, float metersPerPixel, const Math::Position2D &originOffset)
Pose2Di(int _x=0, int _y=0, float _angle=0.0f)
Pose2Di(const Point2Di &pt, float _angle=0.0f)
bool operator==(const BodyMass< T > &lhs, const BodyMass< T > &rhs)
int size
Pixel size of the associated squared occupancy map.
Create a Pose2Di. Pose2Di are used on objects that deal with pixels only, and should not care about m...