cb_base_navigation
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
cb_global_planner::AStarPlanner Class Reference

#include <a_star_planner.h>

Classes

struct  CellInfo
 
struct  compareCellInfos
 

Public Member Functions

 AStarPlanner (int width, int height)
 
bool plan (std::vector< unsigned int > mx_start, std::vector< unsigned int > my_start, int mx_goal, int my_goal, std::vector< int > &plan_xs, std::vector< int > &plan_ys, bool best_heuristic=false)
 
void resize (int nx, int ny)
 
void setCostmap (const unsigned char *char_cost_map)
 
virtual ~AStarPlanner ()
 

Protected Member Functions

double calculateHeuristicCost (int x, int y, int x_goal, int y_goal, double min_cell_cost)
 
void deleteMap ()
 
void expandCell (CellInfo *c, int dx, int dy, double cost_factor, double **visited_map, int x_goal, int y_goal, double min_cell_cost, std::priority_queue< CellInfo *, std::vector< CellInfo * >, compareCellInfos > &Q)
 
double getCost (int x, int y)
 

Protected Attributes

const unsigned char * char_cost_map_
 
unsigned int height_
 
double ** visited_map_
 
unsigned int width_
 

Static Protected Attributes

static long N_OBJECTS = 0
 
static constexpr double SQRT2 = 1.414213562
 

Detailed Description

Definition at line 27 of file a_star_planner.h.

Constructor & Destructor Documentation

◆ AStarPlanner()

cb_global_planner::AStarPlanner::AStarPlanner ( int  width,
int  height 
)

Definition at line 11 of file a_star_planner.cpp.

◆ ~AStarPlanner()

cb_global_planner::AStarPlanner::~AStarPlanner ( )
virtual

Definition at line 16 of file a_star_planner.cpp.

Member Function Documentation

◆ calculateHeuristicCost()

double cb_global_planner::AStarPlanner::calculateHeuristicCost ( int  x,
int  y,
int  x_goal,
int  y_goal,
double  min_cell_cost 
)
protected

Definition at line 193 of file a_star_planner.cpp.

◆ deleteMap()

void cb_global_planner::AStarPlanner::deleteMap ( )
protected

Definition at line 199 of file a_star_planner.cpp.

◆ expandCell()

void cb_global_planner::AStarPlanner::expandCell ( CellInfo c,
int  dx,
int  dy,
double  cost_factor,
double **  visited_map,
int  x_goal,
int  y_goal,
double  min_cell_cost,
std::priority_queue< CellInfo *, std::vector< CellInfo * >, compareCellInfos > &  Q 
)
protected

Definition at line 176 of file a_star_planner.cpp.

◆ getCost()

double cb_global_planner::AStarPlanner::getCost ( int  x,
int  y 
)
protected

Definition at line 31 of file a_star_planner.cpp.

◆ plan()

bool cb_global_planner::AStarPlanner::plan ( std::vector< unsigned int >  mx_start,
std::vector< unsigned int >  my_start,
int  mx_goal,
int  my_goal,
std::vector< int > &  plan_xs,
std::vector< int > &  plan_ys,
bool  best_heuristic = false 
)

Definition at line 79 of file a_star_planner.cpp.

◆ resize()

void cb_global_planner::AStarPlanner::resize ( int  nx,
int  ny 
)

Definition at line 53 of file a_star_planner.cpp.

◆ setCostmap()

void cb_global_planner::AStarPlanner::setCostmap ( const unsigned char *  char_cost_map)

Definition at line 27 of file a_star_planner.cpp.

Member Data Documentation

◆ char_cost_map_

const unsigned char* cb_global_planner::AStarPlanner::char_cost_map_
protected

Definition at line 56 of file a_star_planner.h.

◆ height_

unsigned int cb_global_planner::AStarPlanner::height_
protected

Definition at line 60 of file a_star_planner.h.

◆ N_OBJECTS

long cb_global_planner::AStarPlanner::N_OBJECTS = 0
staticprotected

Definition at line 52 of file a_star_planner.h.

◆ SQRT2

constexpr double cb_global_planner::AStarPlanner::SQRT2 = 1.414213562
staticconstexprprotected

Definition at line 50 of file a_star_planner.h.

◆ visited_map_

double** cb_global_planner::AStarPlanner::visited_map_
protected

Definition at line 58 of file a_star_planner.h.

◆ width_

unsigned int cb_global_planner::AStarPlanner::width_
protected

Definition at line 59 of file a_star_planner.h.


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