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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 20 of file ur5_benchmark.cpp.

21 {
22  // Startup ROS
23  ROS ros(argc, argv);
24 
25  // Create the default UR5 robot.
26  auto ur5 = std::make_shared<UR5Robot>();
27  ur5->initialize();
28 
29  // Create an empty scene.
30  auto scene = std::make_shared<Scene>(ur5);
31 
32  // Create the default planner for the UR5.
33  auto planner = std::make_shared<OMPL::UR5OMPLPipelinePlanner>(ur5);
34  planner->initialize();
35 
36  // Create a motion planning request with a joint position goal.
37  MotionRequestBuilderPtr joint_request(new MotionRequestBuilder(planner, "manipulator"));
38  joint_request->setStartConfiguration({0.0677, -0.8235, 0.9860, -0.1624, 0.0678, 0.0});
39  joint_request->setGoalConfiguration({-0.39, -0.69, -2.12, 2.82, -0.39, 0});
40 
41  // Create a motion planning request with a pose goal.
42  MotionRequestBuilderPtr pose_request(new MotionRequestBuilder(planner, "manipulator"));
43  pose_request->setStartConfiguration({0.0677, -0.8235, 0.9860, -0.1624, 0.0678, 0.0});
44 
45  RobotPose pose = RobotPose::Identity();
46  pose.translate(Eigen::Vector3d{-0.268, -0.826, 1.313});
47  Eigen::Quaterniond orn{0, 0, 1, 0};
48 
49  pose_request->setGoalRegion("ee_link", "world", // links
50  pose, Geometry::makeSphere(0.1), // position
51  orn, {0.01, 0.01, 0.01} // orientation
52  );
53 
54  Profiler::Options options;
55  Experiment experiment("ur5_demo", // Name of experiment
56  options, // Options for internal profiler
57  5.0, // Timeout allowed for ALL queries
58  50); // Number of trials
59 
60  experiment.addQuery("joint", scene, planner, joint_request);
61  experiment.addQuery("pose", scene, planner, pose_request);
62 
63  auto dataset = experiment.benchmark(4);
64 
65  OMPLPlanDataSetOutputter output("robowflex_ur5_demo");
66  output.dump(*dataset);
67 
68  return 0;
69 }
A helper class for benchmarking that controls running multiple queries.
Definition: benchmarking.h:349
A shared pointer wrapper for robowflex::MotionRequestBuilder.
A helper class to build motion planning requests for a robowflex::Planner.
Definition: builder.h:34
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
std::shared_ptr< dart::dynamics::SphereShape > makeSphere(double radius)
Create a sphere.
Definition: structure.cpp:385
std::decay< decltype(std::declval< moveit::core::Transforms >().getTransform("")) >::type RobotPose
A pose (point in SE(3)) used in various functions. Defined from what MoveIt! uses.
Definition: adapter.h:24
Functions for loading and animating scenes in Blender.
Options for profiling.
Definition: benchmarking.h:220