Robowflex  v0.1
Making MoveIt Easy
fetch_ompl_scenes_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 19 of file fetch_ompl_scenes_benchmark.cpp.

20 {
21  // Startup ROS
22  ROS ros(argc, argv);
23 
24  // Create the default Fetch robot.
25  auto fetch = std::make_shared<FetchRobot>();
26 
27  // Do not add the virtual joint since the real robot does not have one.
28  fetch->initialize(false);
29 
30  // Setup a benchmarking request for the joint and pose motion plan requests.
31  Profiler::Options options;
32  options.metrics = Profiler::WAYPOINTS | Profiler::CORRECT | Profiler::LENGTH;
33  Experiment experiment("fetch_scenes", options, 30.0, 2);
34 
35  const std::size_t start = 1;
36  const std::size_t end = 10;
37  for (std::size_t i = start; i <= end; i++)
38  {
39  const auto &scene_file =
40  log::format("package://robowflex_library/yaml/fetch_scenes/scene_vicon%1$04d.yaml", i);
41  const auto &request_file =
42  log::format("package://robowflex_library/yaml/fetch_scenes/request%1$04d.yaml", i);
43 
44  // Create an empty Scene.
45  auto scene = std::make_shared<Scene>(fetch);
46  if (not scene->fromYAMLFile(scene_file))
47  {
48  RBX_ERROR("Failed to read file: %s for scene", scene_file);
49  continue;
50  }
51 
52  // Create the default planner for the Fetch.
53  auto planner = std::make_shared<OMPL::FetchOMPLPipelinePlanner>(fetch);
54  planner->initialize();
55 
56  // Create an empty motion planning request.
57  auto request = std::make_shared<robowflex::MotionRequestBuilder>(planner, GROUP);
58  if (not request->fromYAMLFile(request_file))
59  {
60  RBX_ERROR("Failed to read file: %s for request", request_file);
61  continue;
62  }
63 
64  request->setConfig("PRMstar");
65 
66  // Add request
67  experiment.addQuery(log::format("scene%1$04d", i), scene, planner, request);
68  }
69 
70  auto dataset = experiment.benchmark(1);
71 
72  OMPLPlanDataSetOutputter output("robowflex_fetch_scenes_ompl");
73  output.dump(*dataset);
74 
75  return 0;
76 }
A helper class for benchmarking that controls running multiple queries.
Definition: benchmarking.h:349
Benchmark outputter that saves results into OMPL benchmarking log files. If ompl_benchmark_statistics...
Definition: benchmarking.h:572
RAII-pattern for starting up ROS.
Definition: util.h:52
T end(T... args)
static const std::string GROUP
#define RBX_ERROR(fmt,...)
Output a error logging message.
Definition: log.h:102
std::string format(const std::string &fmt, Args &&... args)
Recursion base case, return string form of formatted arguments.
Definition: log.h:60
Functions for loading and animating scenes in Blender.
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 17 of file fetch_ompl_scenes_benchmark.cpp.