33 auto cob4 = std::make_shared<Cob4Robot>();
37 auto scene = std::make_shared<Scene>(cob4);
44 cob4->setGroupState(
RIGHT_ARM, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0});
45 cob4->setGroupState(
LEFT_ARM, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0});
48 auto planner = std::make_shared<OMPL::Cob4OMPLPipelinePlanner>(cob4);
49 planner->initialize();
53 request_right_arm.setStartConfiguration(cob4->getScratchState());
56 cob4->setGroupState(
RIGHT_ARM, {2.69, 1.70, -0.91, 1.50, -2.14, -2.35, 1.06});
57 request_right_arm.setGoalConfiguration(cob4->getScratchState());
59 request_right_arm.setConfig(
"RRTConnect");
63 if (res.
error_code_.val != moveit_msgs::MoveItErrorCodes::SUCCESS)
67 auto right_arm_trajectory = std::make_shared<Trajectory>(res.
trajectory_);
70 right_arm_trajectory->toYAMLFile(
"cob4_right_arm_path.yml");
74 request_left_arm.setStartConfiguration(cob4->getScratchState());
77 cob4->setGroupState(
LEFT_ARM, {-1.14, -1.50, 0.34, -1.50, 0.43, -1.56, -1.20});
78 request_left_arm.setGoalConfiguration(cob4->getScratchState());
80 request_left_arm.setConfig(
"RRTConnect");
83 res = planner->plan(
scene, request_left_arm.getRequest());
84 if (res.
error_code_.val != moveit_msgs::MoveItErrorCodes::SUCCESS)
88 auto left_arm_trajectory = std::make_shared<Trajectory>(res.
trajectory_);
91 left_arm_trajectory->toYAMLFile(
"cob4_left_arm_path.yml");
A helper class to build motion planning requests for a robowflex::Planner.
RAII-pattern for starting up ROS.
static const std::string LEFT_ARM
static const std::string RIGHT_ARM
Functions for loading and animating scenes in Blender.
moveit_msgs::MoveItErrorCodes error_code_
robot_trajectory::RobotTrajectoryPtr trajectory_