MRSL Motion Primitive Library  1.2
A motion primitive library for generating trajectory for mobile robots
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MPL::GraphSearch< Dim, Coord > Class Template Reference

GraphSearch class. More...

#include <graph_search.h>

Public Member Functions

 GraphSearch (bool verbose=false)
 Simple empty constructor. More...
 
decimal_t Astar (const Coord &start_coord, const std::shared_ptr< env_base< Dim >> &ENV, std::shared_ptr< StateSpace< Dim, Coord >> &ss_ptr, Trajectory< Dim > &traj, int max_expand=-1)
 Astar graph search. More...
 
decimal_t LPAstar (const Coord &start_coord, const std::shared_ptr< env_base< Dim >> &ENV, std::shared_ptr< StateSpace< Dim, Coord >> &ss_ptr, Trajectory< Dim > &traj, int max_expand=-1)
 Lifelong Planning Astar graph search. More...
 

Private Member Functions

bool recoverTraj (StatePtr< Coord > currNode_ptr, std::shared_ptr< StateSpace< Dim, Coord >> ss_ptr, const std::shared_ptr< env_base< Dim >> &ENV, const Coord &start_key, Trajectory< Dim > &traj)
 Recover trajectory.
 

Private Attributes

bool verbose_ = false
 Verbose flag.
 

Detailed Description

template<int Dim, typename Coord>
class MPL::GraphSearch< Dim, Coord >

GraphSearch class.

Implement A* and Lifelong Planning A*

Constructor & Destructor Documentation

◆ GraphSearch()

template<int Dim, typename Coord >
MPL::GraphSearch< Dim, Coord >::GraphSearch ( bool  verbose = false)
inline

Simple empty constructor.

Parameters
verboseenable print out debug infos, default is set to False

Member Function Documentation

◆ Astar()

template<int Dim, typename Coord >
decimal_t MPL::GraphSearch< Dim, Coord >::Astar ( const Coord &  start_coord,
const std::shared_ptr< env_base< Dim >> &  ENV,
std::shared_ptr< StateSpace< Dim, Coord >> &  ss_ptr,
Trajectory< Dim > &  traj,
int  max_expand = -1 
)
inline

Astar graph search.

Parameters
start_coordstart state
ENVobject of `env_base' class
ss_ptrworkspace input
trajoutput trajectory
max_expandmax number of expanded states, default value is -1 which means there is no limitation

Comment following if build single connected graph

Comment this block if build multiple connected graph succNode_ptr->pred_coord.front() = currNode_ptr->coord; // Assign new parent succNode_ptr->pred_action_id.front() = succ_act_id[s]; succNode_ptr->pred_action_cost.front() = succ_cost[s];

◆ LPAstar()

template<int Dim, typename Coord >
decimal_t MPL::GraphSearch< Dim, Coord >::LPAstar ( const Coord &  start_coord,
const std::shared_ptr< env_base< Dim >> &  ENV,
std::shared_ptr< StateSpace< Dim, Coord >> &  ss_ptr,
Trajectory< Dim > &  traj,
int  max_expand = -1 
)
inline

Lifelong Planning Astar graph search.

Parameters
start_coordstart state
ENVobject of `env_base' class
ss_ptrworkspace input
trajoutput trajectory
max_expandmax number of expanded states, default value is -1 which means there is no limitation

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