8 #include <unordered_map> 45 CostMap(
const std::vector<std::string>& layers);
64 const Position& position = Position::Zero());
90 void add(
const std::string& layer,
const Matrix& data);
97 bool exists(
const std::string& layer)
const;
105 const Matrix&
get(
const std::string& layer)
const;
114 Matrix&
get(
const std::string& layer);
122 const Matrix&
operator [](
const std::string& layer)
const;
138 bool erase(
const std::string& layer);
144 const std::vector<std::string>&
getLayers()
const;
198 DataType&
at(
const std::string& layer,
const Index& index);
207 DataType
at(
const std::string& layer,
const Index& index)
const;
255 bool isValid(
const Index& index,
const std::string& layer)
const;
267 bool isValid(
const Index& index,
const std::vector<std::string>& layers)
const;
287 bool getVector(
const std::string& layerPrefix,
const Index& index,
288 Eigen::Vector3d& vector)
const;
299 bool& isSuccess)
const;
311 Index& indexInSubmap,
bool& isSuccess)
const;
321 bool move(
const Position& position, std::vector<BufferRegion>& newRegions);
342 bool overwriteData,
bool copyAllLayers,
343 std::vector<std::string> layers = std::vector<std::string>());
356 void clear(
const std::string& layer);
444 void clearCols(
unsigned int index,
unsigned int nCols);
451 void clearRows(
unsigned int index,
unsigned int nRows);
466 void resize(
const Eigen::Array2i& bufferSize);
475 std::unordered_map<std::string, Matrix>
data_;
Time timestamp_
Timestamp of the grid map (nanoseconds).
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > Matrix
const unsigned char NO_INFORMATION
const Length & getLength() const
const Matrix & operator[](const std::string &layer) const
DataType & at(const std::string &layer, const Index &index)
bool isValid(const Index &index) const
const std::vector< std::string > & getBasicLayers() const
const Size & getSize() const
void clearCols(unsigned int index, unsigned int nCols)
double getResolution() const
void setStartIndex(const Index &startIndex)
void add(const std::string &layer, const DataType value=NO_INFORMATION)
Size size_
Size of the buffer (rows and cols of the data structure).
void setPosition(const Position &position)
void setFrameId(const std::string &frameId)
bool addDataFrom(const CostMap &other, bool extendMap, bool overwriteData, bool copyAllLayers, std::vector< std::string > layers=std::vector< std::string >())
void setGeometry(const Length &length, const double resolution, const Position &position=Position::Zero())
bool getPosition3(const std::string &layer, const Index &index, Position3 &position) const
Index startIndex_
Circular buffer start indeces.
bool hasSameLayers(const CostMap &other) const
void clear(const std::string &layer)
const std::string & getFrameId() const
void setBasicLayers(const std::vector< std::string > &basicLayers)
Time getTimestamp() const
DataType & atPosition(const std::string &layer, const Position &position)
std::unordered_map< std::string, Matrix > data_
Grid map data stored as layers of matrices.
void setTimestamp(const Time timestamp)
bool getVector(const std::string &layerPrefix, const Index &index, Eigen::Vector3d &vector) const
const Position & getPosition() const
Length length_
Side length of the map in x- and y-direction [m].
void clearRows(unsigned int index, unsigned int nRows)
bool erase(const std::string &layer)
bool move(const Position &position, std::vector< BufferRegion > &newRegions)
Position position_
Map position in the grid map frame [m].
double resolution_
Map resolution in xy plane [m/cell].
bool exists(const std::string &layer) const
CostMap getSubmap(const Position &position, const Length &length, bool &isSuccess) const
grid_map::Position Position
grid_map::Position3 Position3
const Index & getStartIndex() const
std::string frameId_
Frame id of the grid map.
const std::vector< std::string > & getLayers() const
void resize(const Eigen::Array2i &bufferSize)
bool extendToInclude(const CostMap &other)
cost_map::Matrix::Scalar DataType
std::vector< std::string > basicLayers_
bool isInside(const Position &position) const
bool getIndex(const Position &position, Index &index) const
bool atPositionLinearInterpolated(const std::string &layer, const Position &position, float &value) const
std::vector< std::string > layers_
Names of the data layers.