9#include <moveit/kinematic_constraints/utils.h>
19 : targetPose(target_pose)
30 ROS_DEBUG(
"[CbMoveEndEfector] new thread started to move absolute end effector");
31 moveit::planning_interface::MoveGroupInterface move_group(*(this->
group_));
33 ROS_DEBUG(
"[CbMoveEndEfector] to move absolute end effector thread destroyed");
37 ROS_DEBUG(
"[CbMoveEndEfector] new thread started to move absolute end effector");
39 ROS_DEBUG(
"[CbMoveEndEfector] to move absolute end effector thread destroyed");
44 geometry_msgs::PoseStamped &targetObjectPose)
47 ROS_DEBUG(
"[CbMoveEndEffector] Synchronous sleep of 1 seconds");
48 ros::Duration(0.5).sleep();
50 moveGroupInterface.setPlanningTime(1.0);
52 ROS_INFO_STREAM(
"[CbMoveEndEffector] Target End efector Pose: " << targetObjectPose);
54 moveGroupInterface.setPoseTarget(targetObjectPose,
tip_link_);
55 moveGroupInterface.setPoseReferenceFrame(targetObjectPose.header.frame_id);
57 moveit::planning_interface::MoveGroupInterface::Plan computedMotionPlan;
58 bool success = (moveGroupInterface.plan(computedMotionPlan) == moveit::core::MoveItErrorCode::SUCCESS);
59 ROS_INFO_NAMED(
"CbMoveEndEffector",
"Success Visualizing plan 1 (pose goal) %s", success ?
"" :
"FAILED");
63 auto executionResult = moveGroupInterface.execute(computedMotionPlan);
65 if (executionResult == moveit_msgs::MoveItErrorCodes::SUCCESS)
67 ROS_INFO(
"[CbMoveEndEffector] motion execution succeeded");
74 ROS_INFO(
"[CbMoveEndEffector] motion execution failed");
81 ROS_INFO(
"[CbMoveEndEffector] motion execution failed");
86 ROS_DEBUG(
"[CbMoveEndEffector] Synchronous sleep of 1 seconds");
87 ros::Duration(0.5).sleep();
boost::optional< std::string > group_
bool moveToAbsolutePose(moveit::planning_interface::MoveGroupInterface &moveGroupInterface, geometry_msgs::PoseStamped &targetObjectPose)
virtual void onEntry() override
ClMoveGroup * movegroupClient_
geometry_msgs::PoseStamped targetPose
moveit::planning_interface::PlanningSceneInterface planningSceneInterface
void postEventMotionExecutionFailed()
moveit::planning_interface::MoveGroupInterface moveGroupClientInterface
void postEventMotionExecutionSucceded()
void requiresClient(SmaccClientType *&storage)