3#include <boost/dynamic_bitset/dynamic_bitset.hpp>
6#include <Eigen/Geometry>
23 return low <= value && value < high;
41 init(std::size_t gridSizeX,
42 std::size_t gridSizeY,
69 setOccupied(std::size_t indexX, std::size_t indexY,
bool posOccupied)
83 return Eigen::Vector2f(posX, posY);
89 std::size_t indexX = (std::size_t)std::roundf((posX -
originX) /
stepSize);
90 std::size_t indexY = (std::size_t)std::roundf((posY -
originY) /
stepSize);
97 const int indexX =
static_cast<int>(std::roundf((posX -
originX) /
stepSize));
98 const int indexY =
static_cast<int>(std::roundf((posY -
originY) /
stepSize));
139 float maxDistance = 15'000;
140 float testStepSize = 0.5f *
stepSize;
141 Eigen::Vector2f testStep = testStepSize * dir;
142 std::size_t lineSteps = std::ceil(maxDistance / testStepSize);
143 for (std::size_t i = 0; i < lineSteps; ++i)
145 Eigen::Vector2f testPos = pos + i * testStep;
148 return i * testStepSize;
bool contains(T value) const
This file offers overloads of toIce() and fromIce() functions for STL container types.
Interval< T > interval(T lo, T hi)
void setOccupied(std::size_t indexX, std::size_t indexY, bool posOccupied)
float computeDistance(Eigen::Vector2f pos, Eigen::Vector2f dir)
bool isOccupied(std::size_t indexX, std::size_t indexY) const
bool isInBounds(float posX, float posY) const
bool isOccupied(float posX, float posY) const
boost::dynamic_bitset< std::size_t > occupied
Eigen::Vector2f getCentralPosition(std::size_t indexX, std::size_t indexY) const
void init(std::size_t gridSizeX, std::size_t gridSizeY, float originX, float originY, float gridStepSize)