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

Method findSubmapParameters

grid_map_core/src/iterators/EllipseIterator.cpp:92–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void EllipseIterator::findSubmapParameters(const Position& center, const Length& length, const double rotation,
93 Index& startIndex, Size& bufferSize) const
94{
95 const Eigen::Rotation2Dd rotationMatrix(rotation);
96 Eigen::Vector2d u = rotationMatrix * Eigen::Vector2d(length(0), 0.0);
97 Eigen::Vector2d v = rotationMatrix * Eigen::Vector2d(0.0, length(1));
98 const Length boundingBoxHalfLength = (u.cwiseAbs2() + v.cwiseAbs2()).array().sqrt();
99 Position topLeft = center.array() + boundingBoxHalfLength;
100 Position bottomRight = center.array() - boundingBoxHalfLength;
101 boundPositionToRange(topLeft, mapLength_, mapPosition_);
102 boundPositionToRange(bottomRight, mapLength_, mapPosition_);
103 getIndexFromPosition(startIndex, topLeft, mapLength_, mapPosition_, resolution_, bufferSize_, bufferStartIndex_);
104 Index endIndex;
105 getIndexFromPosition(endIndex, bottomRight, mapLength_, mapPosition_, resolution_, bufferSize_, bufferStartIndex_);
106 bufferSize = getSubmapSizeFromCornerIndeces(startIndex, endIndex, bufferSize_, bufferStartIndex_);
107}
108
109} /* namespace grid_map */
110

Callers

nothing calls this directly

Calls 3

boundPositionToRangeFunction · 0.85
getIndexFromPositionFunction · 0.85

Tested by

no test coverage detected