EasyNav Costmap Stack
Loading...
Searching...
No Matches
CostmapTest Class Reference
Inheritance diagram for CostmapTest:
Collaboration diagram for CostmapTest:

Public Member Functions

 CostmapTest (unsigned int size_x, unsigned int size_y, double resolution, double origin_x, double origin_y, unsigned char default_val=0)
 
unsigned char * getCostmap ()
 
unsigned int getSize ()
 
void raytraceLine (CostmapAction ca, unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1, unsigned int max_length=UINT_MAX, unsigned int min_length=0)
 
- Public Member Functions inherited from Costmap2D
unsigned int cellDistance (double world_dist)
 Given distance in the world... convert it to cells.
 
void convexFillCells (const std::vector< MapLocation > &polygon, std::vector< MapLocation > &polygon_cells)
 Get the map cells that fill a convex polygon.
 
bool copyCostmapWindow (const Costmap2D &map, double win_origin_x, double win_origin_y, double win_size_x, double win_size_y)
 Turn this costmap into a copy of a window of a costmap passed in.
 
bool copyWindow (const Costmap2D &source, unsigned int sx0, unsigned int sy0, unsigned int sxn, unsigned int syn, unsigned int dx0, unsigned int dy0)
 Copies the (x0,y0)..(xn,yn) window from source costmap into a current costmap.
 
 Costmap2D ()
 Default constructor.
 
 Costmap2D (const Costmap2D &map)
 Copy constructor for a costmap, creates a copy efficiently.
 
 Costmap2D (const nav_msgs::msg::OccupancyGrid &map)
 Constructor for a costmap from an OccupancyGrid map.
 
 Costmap2D (unsigned int cells_size_x, unsigned int cells_size_y, double resolution, double origin_x, double origin_y, unsigned char default_value=0)
 Constructor for a costmap.
 
unsigned char * getCharMap () const
 Will return a pointer to the underlying unsigned char array used as the costmap.
 
unsigned char getCost (unsigned int index) const
 Get the cost of a cell in the costmap.
 
unsigned char getCost (unsigned int mx, unsigned int my) const
 Get the cost of a cell in the costmap.
 
unsigned char getDefaultValue ()
 Get the default background value of the costmap.
 
unsigned int getIndex (unsigned int mx, unsigned int my) const
 Given two map coordinates... compute the associated index.
 
bool getMapRegionOccupiedByPolygon (const std::vector< geometry_msgs::msg::Point > &polygon, std::vector< MapLocation > &polygon_map_region)
 Gets the map region occupied by polygon.
 
mutex_tgetMutex ()
 
double getOriginX () const
 Accessor for the x origin of the costmap.
 
double getOriginY () const
 Accessor for the y origin of the costmap.
 
double getResolution () const
 Accessor for the resolution of the costmap.
 
unsigned int getSizeInCellsX () const
 Accessor for the x size of the costmap in cells.
 
unsigned int getSizeInCellsY () const
 Accessor for the y size of the costmap in cells.
 
double getSizeInMetersX () const
 Accessor for the x size of the costmap in meters.
 
double getSizeInMetersY () const
 Accessor for the y size of the costmap in meters.
 
bool inBounds (unsigned int x, unsigned int y) const
 Checks whether a given cell coordinate is within the bounds of the costmap.
 
void indexToCells (unsigned int index, unsigned int &mx, unsigned int &my) const
 Given an index... compute the associated map coordinates.
 
void mapToWorld (unsigned int mx, unsigned int my, double &wx, double &wy) const
 Convert from map coordinates to world coordinates.
 
void mapToWorldNoBounds (int mx, int my, double &wx, double &wy) const
 Convert from map coordinates to world coordinates with no bounds checking.
 
Costmap2Doperator= (const Costmap2D &map)
 Overloaded assignment operator.
 
void polygonOutlineCells (const std::vector< MapLocation > &polygon, std::vector< MapLocation > &polygon_cells)
 Get the map cells that make up the outline of a polygon.
 
void resetMap (unsigned int x0, unsigned int y0, unsigned int xn, unsigned int yn)
 Reset the costmap in bounds.
 
void resetMapToValue (unsigned int x0, unsigned int y0, unsigned int xn, unsigned int yn, unsigned char value)
 Reset the costmap in bounds to a value.
 
void resizeMap (unsigned int size_x, unsigned int size_y, double resolution, double origin_x, double origin_y)
 Resize the costmap.
 
void restoreMapRegionOccupiedByPolygon (const std::vector< MapLocation > &polygon_map_region)
 Restores the corresponding map region using given map region.
 
bool setConvexPolygonCost (const std::vector< geometry_msgs::msg::Point > &polygon, unsigned char cost_value)
 Sets the cost of a convex polygon to a desired value.
 
void setCost (unsigned int mx, unsigned int my, unsigned char cost)
 Set the cost of a cell in the costmap.
 
void setDefaultValue (unsigned char c)
 Set the default background value of the costmap.
 
void setMapRegionOccupiedByPolygon (const std::vector< MapLocation > &polygon_map_region, unsigned char new_cost_value)
 Sets the given map region to desired value.
 
void toOccupancyGridMsg (nav_msgs::msg::OccupancyGrid &msg) const
 Converts the current costmap into a nav_msgs::msg::OccupancyGrid message.
 
virtual void updateOrigin (double new_origin_x, double new_origin_y)
 Move the origin of the costmap to a new location....
 
bool worldToMap (double wx, double wy, unsigned int &mx, unsigned int &my) const
 Convert from world coordinates to map coordinates.
 
bool worldToMapContinuous (double wx, double wy, float &mx, float &my) const
 Convert from world coordinates to map coordinates.
 
void worldToMapEnforceBounds (double wx, double wy, int &mx, int &my) const
 Convert from world coordinates to map coordinates, constraining results to legal bounds.
 
void worldToMapNoBounds (double wx, double wy, int &mx, int &my) const
 Convert from world coordinates to map coordinates without checking for legal bounds.
 
virtual ~Costmap2D ()
 Destructor.
 

Additional Inherited Members

- Public Types inherited from Costmap2D
typedef std::recursive_mutex mutex_t
 
- Protected Member Functions inherited from Costmap2D
template<typename data_type>
void copyMapRegion (data_type *source_map, unsigned int sm_lower_left_x, unsigned int sm_lower_left_y, unsigned int sm_size_x, data_type *dest_map, unsigned int dm_lower_left_x, unsigned int dm_lower_left_y, unsigned int dm_size_x, unsigned int region_size_x, unsigned int region_size_y)
 Copy a region of a source map into a destination map.
 
virtual void deleteMaps ()
 Deletes the costmap, static_map, and markers data structures.
 
virtual void initMaps (unsigned int size_x, unsigned int size_y)
 Initializes the costmap, static_map, and markers data structures.
 
template<class ActionType>
void raytraceLine (ActionType at, unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1, unsigned int max_length=UINT_MAX, unsigned int min_length=0)
 Raytrace a line and apply some action at each step.
 
virtual void resetMaps ()
 Resets the costmap and static_map to be unknown space.
 
- Protected Attributes inherited from Costmap2D
unsigned char * costmap_
 
unsigned char default_value_
 
double origin_x_
 
double origin_y_
 
double resolution_
 
unsigned int size_x_
 
unsigned int size_y_
 

Constructor & Destructor Documentation

◆ CostmapTest()

CostmapTest ( unsigned int size_x,
unsigned int size_y,
double resolution,
double origin_x,
double origin_y,
unsigned char default_val = 0 )

Member Function Documentation

◆ getCostmap()

unsigned char * getCostmap ( )

◆ getSize()

unsigned int getSize ( )

◆ raytraceLine()

void raytraceLine ( CostmapAction ca,
unsigned int x0,
unsigned int y0,
unsigned int x1,
unsigned int y1,
unsigned int max_length = UINT_MAX,
unsigned int min_length = 0 )

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