Bench-MR
A Motion Planning Benchmark for Wheeled Mobile Robots
ThetaStar.h
Go to the documentation of this file.
1#pragma once
2
3#include <ompl/geometric/PathGeometric.h>
4#include <algorithm>
5
7
8#include "gnode.h"
9#include "stl_thetastar.h"
10
11namespace ob = ompl::base;
12namespace og = ompl::geometric;
13
14class ThetaStar : public AbstractPlanner, public ob::Planner {
15 public:
16 ThetaStar();
17 virtual ~ThetaStar();
18
19 std::string name() const override { return "Theta*"; }
20
21 bool initialize();
22
23 void setProblemDefinition(const ob::ProblemDefinitionPtr &pdef) override;
24 ob::PlannerStatus solve(const ob::PlannerTerminationCondition &ptc) override;
25
26 ob::PlannerStatus run() override;
27
28 og::PathGeometric solution() const override;
29
30 bool hasReachedGoalExactly() const override;
31 double planningTime() const override;
32 unsigned int steps() const;
33
34 private:
35 bool COST_SEARCH;
36 bool USE_ASTAR;
37 bool USE_GRANDPARENT;
38
39 double _planningTime;
40 unsigned int _steps;
41
42 std::vector<std::vector<GNode> > global_paths;
43
44 bool search(std::vector<std::vector<GNode> > &paths, GNode start, GNode goal);
45
46 protected:
47 explicit ThetaStar(bool astar, std::string name);
48
49 public:
50 inline ob::Planner *omplPlanner() override { return this; }
51};
Definition: AbstractPlanner.h:29
Definition: gnode.h:12
Definition: ThetaStar.h:14
void setProblemDefinition(const ob::ProblemDefinitionPtr &pdef) override
Definition: ThetaStar.cpp:270
og::PathGeometric solution() const override
Returns the solution of the planner, which is a sparse PathGeometric.
Definition: ThetaStar.cpp:248
ThetaStar()
Definition: ThetaStar.cpp:15
double planningTime() const override
Definition: ThetaStar.cpp:268
ob::PlannerStatus solve(const ob::PlannerTerminationCondition &ptc) override
Definition: ThetaStar.cpp:274
ob::PlannerStatus run() override
Definition: ThetaStar.cpp:233
bool hasReachedGoalExactly() const override
Definition: ThetaStar.cpp:266
std::string name() const override
Definition: ThetaStar.h:19
virtual ~ThetaStar()
bool initialize()
Definition: ThetaStar.cpp:51
unsigned int steps() const
Definition: ThetaStar.cpp:340
ob::Planner * omplPlanner() override
Definition: ThetaStar.h:50
Planner
Definition: PlannerSettings.h:16