24 const auto &ompl_planner = std::dynamic_pointer_cast<const OMPL::OMPLInterfacePlanner>(planner);
25 const auto &op = ompl_planner->getLastSimpleSetup()->getPlanner();
27 ompl::base::PlannerData pd(op->getSpaceInformation());
28 op->getPlannerData(pd);
30 return (
int)pd.numVertices();
40 const auto &ompl_planner = std::dynamic_pointer_cast<const OMPL::OMPLInterfacePlanner>(planner);
42 const auto &pdef = ompl_planner->getLastSimpleSetup()->getProblemDefinition();
43 double distance = pdef->getSolutionDifference();
47 const auto &start = pdef->getStartState(0);
48 const auto &goal = std::dynamic_pointer_cast<ompl::base::GoalRegion>(pdef->getGoal());
49 distance = goal->distanceGoal(start);
56 int main(
int argc,
char **argv)
62 auto fetch = std::make_shared<FetchRobot>();
69 auto planner = std::make_shared<OMPL::OMPLInterfacePlanner>(
fetch,
"default");
70 planner->initialize(
"package://robowflex_resources/fetch/config/ompl_planning.yaml");
73 auto request = std::make_shared<MotionRequestBuilder>(planner,
GROUP);
74 fetch->setGroupState(
GROUP, {0.05, 1.32, 1.40, -0.2, 1.72, 0.0, 1.66, 0.0});
75 request->setStartConfiguration(
fetch->getScratchState());
77 fetch->setGroupState(
GROUP, {0.265, 0.501, 1.281, -2.272, 2.243, -2.774, 0.976, -2.007});
78 request->setGoalConfiguration(
fetch->getScratchState());
80 request->setConfig(
"RRTstar");
100 output.
dump(*dataset);
A helper class for benchmarking that controls running multiple queries.
PlanDataSetPtr benchmark(std::size_t n_threads=1) const
Run benchmarking on this experiment. Note that, for some planners, multiple threads cannot be used wi...
void addQuery(const std::string &planner_name, const SceneConstPtr &scene, const PlannerPtr &planner, const planning_interface::MotionPlanRequest &request)
Add a query to the experiment for profiling.
Profiler & getProfiler()
Get a reference to the profiler used by the experiment. Add callback functions to this profiler for c...
Benchmark outputter that saves results into OMPL benchmarking log files. If ompl_benchmark_statistics...
void dump(const PlanDataSet &results) override
Dumps results into a OMPL benchmarking log file in prefix_ named after the request name_.
Detailed statistics and metrics computed from profiling a planner's motion planning.
A shared pointer wrapper for robowflex::Planner.
void addMetricCallback(const std::string &name, const ComputeMetricCallback &metric)
Add a callback function to compute a metric at the end of planning.
@ WAYPOINTS
Number of waypoints in path.
@ SMOOTHNESS
Smoothness of path.
@ CORRECT
Is the path correct (no collisions?).
@ LENGTH
Length of the path.
RAII-pattern for starting up ROS.
A const shared pointer wrapper for robowflex::Scene.
Profiler::ComputeMetricCallback getNumVerticesCallback()
int main(int argc, char **argv)
Profiler::ComputeMetricCallback getGoalDistanceCallback()
static const std::string GROUP
moveit_msgs::MotionPlanRequest MotionPlanRequest
Main namespace. Contains all library classes and functions.
boost::variant< bool, double, int, std::size_t, std::string > PlannerMetric
Variant type of possible values a run metric could be.
Functions for loading and animating scenes in Blender.
uint32_t metrics
Bitmask of which metrics to compute after planning.