Bench-MR
A Motion Planning Benchmark for Wheeled Mobile Robots
OMPLAnytimePathShortening.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <ompl/control/planners/rrt/RRT.h>
4#include <ompl/geometric/planners/AnytimePathShortening.h>
5
6#include "OMPLPlanner.hpp"
7
8namespace ob = ompl::base;
9namespace og = ompl::geometric;
10namespace oc = ompl::control;
11
12template <class PLANNER>
13class OMPLAnytimePathShortening : public OMPLPlanner<PLANNER> {
14 public:
15 bool shortcut{true};
16 bool hybridize{true};
17
18 std::string name() const override { return "OMPL Anytime Path Shortening"; }
19
20 virtual ob::PlannerStatus run() {
21 ob::PlannerPtr planner;
22 planner = std::make_shared<og::AnytimePathShortening>(
23 this->ss->getSpaceInformation());
24 planner->as<og::AnytimePathShortening>()->setHybridize(hybridize);
25 planner->as<og::AnytimePathShortening>()->setShortcut(shortcut);
26 ob::PlannerPtr optimizingPlanner(
27 new PLANNER(this->ss->getSpaceInformation()));
28 planner->as<og::AnytimePathShortening>()->addPlanner(optimizingPlanner);
29 this->ss->setPlanner(planner);
30 this->ss->setup();
31 auto solved = this->ss->solve(global::settings.max_planning_time);
32 OMPL_INFORM("OMPL anytime path shortening planning status: %s",
33 solved.asString().c_str());
34
35 if (!solved) OMPL_WARN("OMPL Anytime PS found no solution.");
36 return solved;
37 };
38};
39
OMPLAnytimePathShortening< og::SORRTstar > SORRTstarAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:45
OMPLAnytimePathShortening< og::InformedRRTstar > InformedRRTstarAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:44
OMPLAnytimePathShortening< og::RRT > RRTAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:40
OMPLAnytimePathShortening< og::STRIDE > STRIDEAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:56
OMPLAnytimePathShortening< og::RRTstar > RRTstarAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:41
OMPLAnytimePathShortening< og::PRMstar > PRMstarAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:51
OMPLAnytimePathShortening< og::PRM > PRMAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:49
OMPLAnytimePathShortening< og::CForest > CForestAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:52
OMPLAnytimePathShortening< og::BITstar > BITstarAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:46
OMPLAnytimePathShortening< og::KPIECE1 > KPIECEAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:55
OMPLAnytimePathShortening< og::BFMT > BFMTAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:48
OMPLAnytimePathShortening< og::RRTsharp > RRTsharpAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:42
OMPLAnytimePathShortening< og::SST > SSTAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:54
OMPLAnytimePathShortening< og::FMT > FMTAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:47
OMPLAnytimePathShortening< og::EST > ESTAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:53
OMPLAnytimePathShortening< og::SBL > SBLAnytimePathShortening
Definition: OMPLAnytimePathShortening.hpp:50
og::SimpleSetup * ss
Definition: AbstractPlanner.h:114
Definition: OMPLAnytimePathShortening.hpp:13
virtual ob::PlannerStatus run()
Definition: OMPLAnytimePathShortening.hpp:20
std::string name() const override
Definition: OMPLAnytimePathShortening.hpp:18
bool hybridize
Definition: OMPLAnytimePathShortening.hpp:16
bool shortcut
Definition: OMPLAnytimePathShortening.hpp:15
Definition: OMPLPlanner.hpp:52
static PlannerSettings::GlobalSettings settings
Definition: PlannerSettings.h:699