55 using Grid = std::vector<Eigen::MatrixXf>;
66 const std::optional<Mask>& mask = std::nullopt,
79 const std::optional<Mask>& mask = std::nullopt);
112 return Eigen::Rotation2Df{degrees *
static_cast<float>(
M_PI) / 180.F};
118 Eigen::Rotation2Df rot{rotationDeg *
static_cast<float>(
M_PI) / 180.F};
125 return Eigen::Rotation2Df{pose.linear()}.angle() * 180.F /
M_PI;
139 std::optional<Rotation> rotation = std::nullopt)
const;
150 float clearance = 0.F)
const;
169 float minClearance = 0.F)
const;
171 const Parameters&
params() const noexcept;
179 const Eigen::Vector2f Costmap3D_P_center{
185 auto rotationDeg = 0.F;
186 if (rotation.has_value())
188 rotationDeg = rotation->degrees;
190 Eigen::Rotation2Df rot{rotationDeg * static_cast<float>(M_PI) / 180.F};
193 return global_T_Costmap3D * Eigen::Translation2f(Costmap3D_P_center) * rot;
212 const std::optional<Mask>&
getMask() const noexcept;
228 return global_T_Costmap3D;
244 bool initializeMask =
false)
const;
252 void validateSizes()
const;
255 std::optional<Mask> mask;
259 const Parameters parameters;
261 core::Pose2D global_T_Costmap3D = core::Pose2D::Identity();
std::pair< Rotation, Rotation > bracketingRotationsFromDegrees(RotationDegrees degrees) const
The two orientation slices bracketing the given continuous rotation.
void convertToPseudoSDF()
Costmap costmapForOrientation(RotationIndex rotationIndex, bool initializeMask=false) const
bool isWithinRange(const Index &index) const noexcept
const core::Pose2D & origin() const
const SceneBounds & getLocalSceneBounds() const noexcept
Position toPositionGlobal(const Index &index) const
Index findClosestValidIndex(const Index &index)
void cutToValidBoundingBox()
const Grid & getGrid() const
static Costmap3D WithSameDimsAs(const Costmap3D &other, const Grid &grid, const std::optional< Mask > &mask=std::nullopt)
Create a Costmap3D with the same dimensions and parameters as the given one.
std::optional< Vertex > findClosestCollisionFreeVertex(const Position &position, RotationDegrees orientationDeg, float maxDistance, float minClearance=0.F) const
Find the closest position where the robot fits at the given continuous orientation with more than min...
Costmap3D(const Grid &grid, const Parameters ¶meters, const SceneBounds &sceneBounds, const std::optional< Mask > &mask=std::nullopt, const core::Pose2D &origin=core::Pose2D::Identity())
core::Pose2D globalPose(const Index &index, const RotationDegrees &rotationDeg) const
static constexpr Rotation ALL_ORIENTATIONS
bool isInCollision(const Position &p, std::optional< Rotation > rotation=std::nullopt) const
const std::optional< Mask > & getMask() const noexcept
std::size_t numberOfValidElements() const
Eigen::Rotation2Df rotationLocal(const RotationDegrees degrees) const
bool isMaskedOut(const Index &index) const noexcept
Eigen::Matrix< bool, Eigen::Dynamic, Eigen::Dynamic > Mask
Rotation rotationFromIndex(RotationIndex index) const
Rotation closestRotationFromDegrees(RotationDegrees degrees) const
Position toPositionLocal(const Index &index) const
std::optional< Costmap3D::Mask > & getMutableMask() noexcept
void convertToPseudoSDFForRotation(RotationIndex rot_index)
friend class Costmap3DBuilder
std::vector< Eigen::MatrixXf > Grid
std::optional< float > value(const Index &index, const RotationIndex rot_index) const
std::pair< Index, Index > getValidBoundingBox() const
RotationDegrees rotationDegrees(const core::Pose2D &pose) const
Vertex toVertex(const Position &globalPosition) const
void setOrigin(const core::Pose2D &globalPose)
core::Pose2D centerPose(std::optional< Rotation > rotation=std::nullopt) const
bool isValid(const Index &index) const noexcept
checks whether the cell is masked out
Optimum optimum(Rotation rotation=ALL_ORIENTATIONS) const
const Parameters & params() const noexcept
bool isFreeWithClearance(const Position &p, RotationDegrees orientationDeg, float clearance=0.F) const
Whether the robot fits at the given position and continuous orientation with more than the given obst...
float value_ignore_mask(const Index &index, const RotationIndex rot_index) const
This file is part of ArmarX.
This file is part of ArmarX.
This file is part of ArmarX.
int orientations
How many orientations of the robot each cell contains.
float cellSize
How big each cell is in the uniform grid.
struct armarx::navigation::algorithms::orientation_aware::Costmap3D::Parameters::RobotModel robotModel