Costmap Class Reference

#include <armarx/navigation/algorithms/Costmap.h>

Classes

struct  Filter
 
struct  Optimum
 
struct  Parameters
 
struct  Vertex
 

Public Types

enum  AddMode { MIN, MAX }
 
using Grid = Eigen::MatrixXf
 
using Index = Eigen::Array2i
 
using Mask = Eigen::Matrix< bool, Eigen::Dynamic, Eigen::Dynamic >
 
using Position = Eigen::Vector2f
 

Public Member Functions

bool add (const Costmap &other, AddMode mode)
 
bool add (const Costmap &other, float weight=1.0)
 
core::Pose2D centerPose () const
 
 Costmap (const Grid &grid, const Parameters &parameters, const SceneBounds &sceneBounds, const std::optional< Mask > &mask=std::nullopt, const core::Pose2D &origin=core::Pose2D::Identity())
 
void cutToValidBoundingBox ()
 
void excludeUnreachable (const Position &position)
 
void filter (const Filter &filter)
 
const GridgetGrid () const
 
const SceneBoundsgetLocalSceneBounds () const noexcept
 
const std::optional< Mask > & getMask () const noexcept
 
GridgetMutableGrid ()
 
std::optional< Costmap::Mask > & getMutableMask () noexcept
 
std::pair< Index, IndexgetValidBoundingBox () const
 
bool isInCollision (const Position &p) const
 
bool isValid (const Index &index) const noexcept
 checks whether the cell is masked out More...
 
Costmap mergeInto (const std::vector< Costmap > &costmaps, const std::vector< float > &weights) const
 Merge a list of costmaps into this costmap. More...
 
std::size_t numberOfValidElements () const
 
Optimum optimum () const
 
const core::Pose2Dorigin () const
 
const Parametersparams () const noexcept
 
void setOrigin (const core::Pose2D &globalPose)
 
Position toPositionGlobal (const Index &index) const
 
Position toPositionLocal (const Index &index) const
 
Vertex toVertex (const Position &globalPosition) const
 
std::optional< floatvalue (const Index &index) const
 
std::optional< floatvalue (const Position &position) const
 

Static Public Member Functions

static Costmap WithSameDimsAs (const Costmap &other, const Grid &grid, const std::optional< Mask > &mask=std::nullopt)
 Create a costmap with the same dimensions and parameters as the given one. More...
 

Friends

class CostmapBuilder
 
class SocialCostmapBuilder
 

Detailed Description

Definition at line 16 of file Costmap.h.

Member Typedef Documentation

◆ Grid

using Grid = Eigen::MatrixXf

Definition at line 56 of file Costmap.h.

◆ Index

using Index = Eigen::Array2i

Definition at line 54 of file Costmap.h.

◆ Mask

using Mask = Eigen::Matrix<bool, Eigen::Dynamic, Eigen::Dynamic>

Definition at line 59 of file Costmap.h.

◆ Position

using Position = Eigen::Vector2f

Definition at line 55 of file Costmap.h.

Member Enumeration Documentation

◆ AddMode

enum AddMode
strong
Enumerator
MIN 
MAX 

Definition at line 129 of file Costmap.h.

Constructor & Destructor Documentation

◆ Costmap()

Costmap ( const Grid grid,
const Parameters parameters,
const SceneBounds sceneBounds,
const std::optional< Mask > &  mask = std::nullopt,
const core::Pose2D origin = core::Pose2D::Identity() 
)

Definition at line 30 of file Costmap.cpp.

Member Function Documentation

◆ add() [1/2]

bool add ( const Costmap other,
AddMode  mode 
)

Definition at line 321 of file Costmap.cpp.

+ Here is the call graph for this function:

◆ add() [2/2]

bool add ( const Costmap other,
float  weight = 1.0 
)

Definition at line 256 of file Costmap.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ centerPose()

core::Pose2D centerPose ( ) const
inline

Definition at line 105 of file Costmap.h.

+ Here is the call graph for this function:

◆ cutToValidBoundingBox()

void cutToValidBoundingBox ( )

Definition at line 432 of file Costmap.cpp.

+ Here is the call graph for this function:

◆ excludeUnreachable()

void excludeUnreachable ( const Position position)

Definition at line 622 of file Costmap.cpp.

+ Here is the call graph for this function:

◆ filter()

void filter ( const Filter filter)

Definition at line 179 of file Costmap.cpp.

+ Here is the call graph for this function:

◆ getGrid()

const Costmap::Grid & getGrid ( ) const

Definition at line 243 of file Costmap.cpp.

+ Here is the caller graph for this function:

◆ getLocalSceneBounds()

const SceneBounds & getLocalSceneBounds ( ) const
noexcept

Definition at line 130 of file Costmap.cpp.

+ Here is the caller graph for this function:

◆ getMask()

const std::optional< Costmap::Mask > & getMask ( ) const
noexcept

Definition at line 399 of file Costmap.cpp.

+ Here is the caller graph for this function:

◆ getMutableGrid()

Grid& getMutableGrid ( )
inline

Definition at line 92 of file Costmap.h.

+ Here is the caller graph for this function:

◆ getMutableMask()

std::optional< Costmap::Mask > & getMutableMask ( )
noexcept

Definition at line 405 of file Costmap.cpp.

+ Here is the caller graph for this function:

◆ getValidBoundingBox()

std::pair< Costmap::Index, Costmap::Index > getValidBoundingBox ( ) const

Definition at line 589 of file Costmap.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInCollision()

bool isInCollision ( const Position p) const

Definition at line 249 of file Costmap.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValid()

bool isValid ( const Index index) const
noexcept

checks whether the cell is masked out

Definition at line 76 of file Costmap.cpp.

+ Here is the caller graph for this function:

◆ mergeInto()

Costmap mergeInto ( const std::vector< Costmap > &  costmaps,
const std::vector< float > &  weights 
) const

Merge a list of costmaps into this costmap.

Parameters
costmapslist of other costmaps
weights[weights of other costmaps..., weights of this costmap]
Returns
this

Definition at line 473 of file Costmap.cpp.

+ Here is the call graph for this function:

◆ numberOfValidElements()

std::size_t numberOfValidElements ( ) const

Definition at line 545 of file Costmap.cpp.

◆ optimum()

Costmap::Optimum optimum ( ) const

Definition at line 136 of file Costmap.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ origin()

const core::Pose2D& origin ( ) const
inline

Definition at line 155 of file Costmap.h.

+ Here is the caller graph for this function:

◆ params()

const Costmap::Parameters & params ( ) const
noexcept

Definition at line 237 of file Costmap.cpp.

+ Here is the caller graph for this function:

◆ setOrigin()

void setOrigin ( const core::Pose2D globalPose)
inline

Definition at line 161 of file Costmap.h.

◆ toPositionGlobal()

Costmap::Position toPositionGlobal ( const Index index) const

Definition at line 69 of file Costmap.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toPositionLocal()

Costmap::Position toPositionLocal ( const Index index) const

Definition at line 55 of file Costmap.cpp.

+ Here is the caller graph for this function:

◆ toVertex()

Costmap::Vertex toVertex ( const Position globalPosition) const

Definition at line 103 of file Costmap.cpp.

+ Here is the caller graph for this function:

◆ value() [1/2]

std::optional< float > value ( const Index index) const

Definition at line 411 of file Costmap.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ value() [2/2]

std::optional< float > value ( const Position position) const

Definition at line 423 of file Costmap.cpp.

+ Here is the call graph for this function:

◆ WithSameDimsAs()

Costmap WithSameDimsAs ( const Costmap other,
const Grid grid,
const std::optional< Mask > &  mask = std::nullopt 
)
static

Create a costmap with the same dimensions and parameters as the given one.

Only the content (grid and mask) are altered.

Parameters
otherThe costmap providing the dimensions and parameters
grid
mask
Returns
Costmap

Definition at line 728 of file Costmap.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ CostmapBuilder

friend class CostmapBuilder
friend

Definition at line 21 of file Costmap.h.

◆ SocialCostmapBuilder

friend class SocialCostmapBuilder
friend

Definition at line 22 of file Costmap.h.


The documentation for this class was generated from the following files: