Robowflex  v0.1
Making MoveIt Easy
fetch_benchmark.cpp File Reference

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Variables

static const std::string GROUP = "arm_with_torso"
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 25 of file fetch_benchmark.cpp.

26 {
27  // Startup ROS
28  ROS ros(argc, argv);
29 
30  // Create the default Fetch robot.
31  auto fetch = std::make_shared<FetchRobot>();
32  fetch->initialize();
33 
34  // Create an empty scene.
35  auto scene = std::make_shared<Scene>(fetch);
36 
37  // Create the default planner for the Fetch.
38  auto planner = std::make_shared<OMPL::FetchOMPLPipelinePlanner>(fetch, "default");
39  planner->initialize();
40 
41  // Setup a benchmarking request for the joint and pose motion plan requests.
42  Profiler::Options options;
43  options.metrics = Profiler::WAYPOINTS | Profiler::CORRECT | Profiler::LENGTH | Profiler::SMOOTHNESS;
44  Experiment experiment("unfurl", // Name of experiment
45  options, // Options for internal profiler
46  5.0, // Timeout allowed for ALL queries
47  100); // Number of trials
48 
49  // Create a motion planning request with a pose goal.
50  auto request = std::make_shared<MotionRequestBuilder>(planner, GROUP);
51  fetch->setGroupState(GROUP, {0.05, 1.32, 1.40, -0.2, 1.72, 0.0, 1.66, 0.0}); // Stow
52  request->setStartConfiguration(fetch->getScratchState());
53 
54  fetch->setGroupState(GROUP, {0.265, 0.501, 1.281, -2.272, 2.243, -2.774, 0.976, -2.007}); // Unfurl
55  request->setGoalConfiguration(fetch->getScratchState());
56 
57  request->setConfig("RRTConnect");
58  experiment.addQuery("rrtconnect", scene, planner, request->getRequest());
59 
60  request->setConfig("RRT");
61  experiment.addQuery("rrt", scene, planner, request->getRequest());
62 
63  request->setConfig("PRM");
64  experiment.addQuery("prm", scene, planner, request->getRequest());
65 
66  request->setConfig("KPIECE");
67  experiment.addQuery("kpiece", scene, planner, request->getRequest());
68 
69  request->setConfig("BKPIECE");
70  experiment.addQuery("bkpiece", scene, planner, request->getRequest());
71 
72  request->setConfig("LBKPIECE");
73  experiment.addQuery("lbkpiece", scene, planner, request->getRequest());
74 
75  request->setConfig("EST");
76  experiment.addQuery("est", scene, planner, request->getRequest());
77 
78  // Use the post-query callback to visualize the data live.
80  experiment.setPostQueryCallback(
81  [&](PlanDataSetPtr dataset, const PlanningQuery &) { plot.dump(*dataset); });
82 
83  auto dataset = experiment.benchmark(4);
84 
85  OMPLPlanDataSetOutputter output("robowflex_fetch_demo");
86  output.dump(*dataset);
87 
88  return 0;
89 }
A helper class for benchmarking that controls running multiple queries.
Definition: benchmarking.h:349
Helper class to plot a real metric as a box plot using GNUPlot from benchmarking data.
Definition: gnuplot.h:129
Benchmark outputter that saves results into OMPL benchmarking log files. If ompl_benchmark_statistics...
Definition: benchmarking.h:572
A shared pointer wrapper for robowflex::PlanDataSet.
RAII-pattern for starting up ROS.
Definition: util.h:52
static const std::string GROUP
Functions for loading and animating scenes in Blender.
A container structure for all elements needed in a planning query, plus an identifying name.
Definition: benchmarking.h:44
Options for profiling.
Definition: benchmarking.h:220
uint32_t metrics
Bitmask of which metrics to compute after planning.
Definition: benchmarking.h:221

Variable Documentation

◆ GROUP

const std::string GROUP = "arm_with_torso"
static

Definition at line 23 of file fetch_benchmark.cpp.