55 using Grid = std::vector<Eigen::MatrixXf>;
66 const std::optional<Mask>& mask = std::nullopt,
79 const std::optional<Mask>& mask = std::nullopt);
104 return Eigen::Rotation2Df{degrees *
static_cast<float>(
M_PI) / 180.F};
110 Eigen::Rotation2Df rot{rotationDeg *
static_cast<float>(
M_PI) / 180.F};
117 return Eigen::Rotation2Df{pose.linear()}.angle() * 180.F /
M_PI;
131 std::optional<Rotation> rotation = std::nullopt)
const;
133 const Parameters&
params() const noexcept;
141 const Eigen::Vector2f Costmap3D_P_center{
147 auto rotationDeg = 0.F;
148 if (rotation.has_value())
150 rotationDeg = rotation->degrees;
152 Eigen::Rotation2Df rot{rotationDeg * static_cast<float>(M_PI) / 180.F};
155 return global_T_Costmap3D * Eigen::Translation2f(Costmap3D_P_center) * rot;
174 const std::optional<Mask>&
getMask() const noexcept;
190 return global_T_Costmap3D;
206 bool initializeMask =
false)
const;
212 void validateSizes()
const;
217 std::optional<Mask> mask;
221 const Parameters parameters;
223 core::Pose2D global_T_Costmap3D = core::Pose2D::Identity();
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
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.
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
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