36 auto cob4 = std::make_shared<Cob4Robot>();
43 cob4->setGroupState(
BOTH_ARMS, {-1.14, -1.50, 0.34, -1.50, 0.43, -1.56, -1.20, 2.69, 1.70, -0.91, 1.50,
47 auto scene = std::make_shared<Scene>(cob4);
48 scene->fromYAMLFile(
"package://robowflex_library/yaml/test_cob4.yml");
52 rviz.visualizeCurrentState();
53 rviz.updateScene(
scene);
54 RBX_INFO(
"Care-O-Bot4 with both_arms folded is visualized. Press enter to continue...");
58 auto planner = std::make_shared<OMPL::Cob4OMPLPipelinePlanner>(cob4);
59 planner->initialize();
63 request_both_arms.setStartConfiguration(cob4->getScratchState());
66 const auto &goal_pose_right =
TF::createPoseQ(0.6, -0.26, 0.97, 1.0, 0.0, 0.0, 0.0);
67 const auto &goal_pose_left =
TF::createPoseQ(0.38, 0.26, 0.78, 0.0, 0.707, 0.0, 0.707);
70 rviz.addTransformMarker(
"pose_right",
"base_link", goal_pose_right);
71 rviz.addTransformMarker(
"pose_left",
"base_link", goal_pose_left);
73 RBX_INFO(
"Target IK poses are visualized. Press enter to continue...");
77 if (not cob4->setFromIK(query))
84 rviz.visualizeCurrentState();
85 request_both_arms.setGoalConfiguration(cob4->getScratchState());
86 RBX_INFO(
"Solution to IK is visualized and set as goal for both_arms! Press enter to plan...");
90 request_both_arms.setConfig(
"RRTConnect");
92 if (res.
error_code_.val != moveit_msgs::MoveItErrorCodes::SUCCESS)
96 rviz.updateTrajectory(res);
99 auto both_arms_trajectory = std::make_shared<Trajectory>(res.
trajectory_);
100 cob4->setGroupState(
BOTH_ARMS, both_arms_trajectory->vectorize().
back());
102 rviz.visualizeCurrentState();
104 RBX_INFO(
"Trajectory visualize. Press enter to exit.");
RVIZ visualization helper. See Live Visualization with RViz for more information.
A helper class to build motion planning requests for a robowflex::Planner.
RAII-pattern for starting up ROS.
static const std::string LEFT_EE
static const std::string BOTH_ARMS
static const std::string RIGHT_EE
#define RBX_ERROR(fmt,...)
Output a error logging message.
#define RBX_INFO(fmt,...)
Output a info logging message.
RobotPose createPoseQ(double x, double y, double z, double W, double X, double Y, double Z)
Creates a robot pose from a linear component and a Quaternion.
Functions for loading and animating scenes in Blender.
moveit_msgs::MoveItErrorCodes error_code_
robot_trajectory::RobotTrajectoryPtr trajectory_
Robot IK Query options. IK queries in Robowflex consist of: a) A position specified by some geometric...