Robowflex  v0.1
Making MoveIt Easy
wam7_test.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 11 of file wam7_test.cpp.

12 {
13  // Startup ROS
14  ROS ros(argc, argv);
15 
16  // Create a WAM7 robot, specifying all necessary files.
17  auto wam7 = std::make_shared<Robot>("wam7");
18  wam7->initialize("package://barrett_model/robots/wam_7dof_wam_bhand.urdf.xacro", // urdf
19  "package://barrett_wam_moveit_config/config/wam7_hand.srdf", // srdf
20  "package://barrett_wam_moveit_config/config/joint_limits.yaml", // joint limits
21  "package://barrett_wam_moveit_config/config/kinematics.yaml" // kinematics
22  );
23 
24  // Load kinematics for the WAM7 arm.
25  wam7->loadKinematics("arm");
26 
27  // Create an empty scene.
28  auto scene = std::make_shared<Scene>(wam7);
29 
30  // Create the default OMPL planner with path simplification disabled, with the WAM7 planning
31  // configuration.
32  auto planner = std::make_shared<OMPL::OMPLPipelinePlanner>(wam7);
33 
34  OMPL::Settings settings;
35  settings.simplify_solutions = false;
36  planner->initialize("package://barrett_wam_moveit_config/config/ompl_planning.yaml", // planner config
37  settings);
38 
39  // Create a motion planning request with a joint position goal.
40  MotionRequestBuilder request(planner, "arm");
41  request.setStartConfiguration({0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0});
42  request.setGoalConfiguration({0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0});
43  request.setConfig("BKPIECE");
44 
45  // Do motion planning!
46  planning_interface::MotionPlanResponse res = planner->plan(scene, request.getRequest());
47  if (res.error_code_.val != moveit_msgs::MoveItErrorCodes::SUCCESS)
48  return 1;
49 
50  return 0;
51 }
A helper class to build motion planning requests for a robowflex::Planner.
Definition: builder.h:34
Settings descriptor for settings provided by the default MoveIt! OMPL planning pipeline.
bool simplify_solutions
Whether or not planner should simplify solutions.
RAII-pattern for starting up ROS.
Definition: util.h:52
Functions for loading and animating scenes in Blender.
moveit_msgs::MoveItErrorCodes error_code_