# OMPL Plannification: /home/blue/GitLab Repo/OMPL_Planning/Source Files/mapping_planning_tutorial/control_turtlebot/src/OMPL_Planning/OMPL_Planner/OMPL_Planner.hpp Source File

OMPL_Planner.hpp
Go to the documentation of this file.
//#include <string>
//using namespace std;
//OMPL//
//#include <ompl/config.h>
//#include <ompl/base/SpaceInformation.h>
//#include <ompl/base/spaces/RealVectorStateSpace.h>
#include <ompl/geometric/SimpleSetup.h>
#include <ompl/geometric/planners/cforest/CForest.h>
#include <ompl/geometric/planners/rrt/RRTstar.h>
#include <ompl/base/spaces/SE3StateSpace.h>
#include <ompl/base/spaces/SE2StateSpace.h>
//OMPL namespaces
namespace ob = ompl::base;
namespace og = ompl::geometric;
#include "StateChecker.hpp"
class OMPL_Planner
{
public :
OMPL_Planner(int dim);
void setPlanningBounds(const std::vector<double> planning_bounds_x, const std::vector<double> planning_bounds_y, const std::vector<double> planning_bounds_z = std::vector<double>());
void setPlanningDepth(double depth_limit = 1);
void setPlanner(const std::string plannerName = "RRTstar");
void setStateChecker(const ob::StateValidityCheckerPtr state_checker);
void setStateChecker(const std::string mapFile, double collision_mask_x, double collision_mask_y, double collision_mask_z = 0.2);
void setStateChecker(octomap::OcTree* octree, double collision_mask_x, double collision_mask_y, double collision_mask_z);
void updateStateChecker(octomap::OcTree* octree);
void setStartGoal(const std::vector<double> start_state, const std::vector<double> goal_state);
bool findPath(double solving_time);
bool isValid(std::vector<double> position) const;
bool checkPath() const;
bool updatePath(octomap::OcTree* octree, double solving_time, const std::vector<double> start_state, const std::vector<double> goal_state);
og::PathGeometric getPath() const;
og::SimpleSetup getSimpleSetup() const;
~OMPL_Planner();
private :
int _planningDimension;
ob::SpaceInformationPtr _si;
ob::StateSpacePtr _space;
og::SimpleSetup _simple_setup;
StateChecker* _checker = nullptr;
//std::vector<double> _start_state, _goal_state;
double _depth_limit;
};
StateChecker
Class for state checking for 2D and 3D planning. Extension of an abstract class used to implement the...
Definition: StateChecker.hpp:41
OMPL_Planner::updatePath
bool updatePath(octomap::OcTree *octree, double solving_time, const std::vector< double > start_state, const std::vector< double > goal_state)
Update the path.
Definition: OMPL_Planner.cpp:194
OMPL_Planner::setStateChecker
void setStateChecker(const ob::StateValidityCheckerPtr state_checker)
Set the state checker.
Definition: OMPL_Planner.cpp:71
OMPL_Planner::setStartGoal
void setStartGoal(const std::vector< double > start_state, const std::vector< double > goal_state)
Set the planning objectives.
Definition: OMPL_Planner.cpp:116
OMPL_Planner::findPath
bool findPath(double solving_time)
Solve the planning problem.
Definition: OMPL_Planner.cpp:139
OMPL_Planner::getPath
og::PathGeometric getPath() const
Return the path found by the planner.
Definition: OMPL_Planner.cpp:207
OMPL_Planner::setPlanningDepth
void setPlanningDepth(double depth_limit=1)
Set the planning depth.
Definition: OMPL_Planner.cpp:49
OMPL_Planner::~OMPL_Planner
~OMPL_Planner()
Destructor.
Definition: OMPL_Planner.cpp:20
OMPL_Planner::setPlanningBounds
void setPlanningBounds(const std::vector< double > planning_bounds_x, const std::vector< double > planning_bounds_y, const std::vector< double > planning_bounds_z=std::vector< double >())
Set the bounds of the planner workspace.
Definition: OMPL_Planner.cpp:31
OMPL_Planner::getSimpleSetup
og::SimpleSetup getSimpleSetup() const
Return the OMPL object containing most of the information of the planning problem.
Definition: OMPL_Planner.cpp:212
OMPL_Planner::checkPath
bool checkPath() const
Check if the path is valid.
Definition: OMPL_Planner.cpp:187
OMPL_Planner::OMPL_Planner
OMPL_Planner(int dim)
Constructor.
Definition: OMPL_Planner.cpp:11
OMPL_Planner::setPlanner
void setPlanner(const std::string plannerName="RRTstar")
Set the planning algorithm used to solve the problem.
Definition: OMPL_Planner.cpp:56
OMPL_Planner::updateStateChecker
void updateStateChecker(octomap::OcTree *octree)
Update the state checker.
Definition: OMPL_Planner.cpp:109
OMPL_Planner
Class for planner for 2D and 3D planning.
Definition: OMPL_Planner.hpp:35
OMPL_Planner::isValid
bool isValid(std::vector< double > position) const
Check if position is collision-free.
Definition: OMPL_Planner.cpp:158