Cartesian path won't achieve full trajectory
Hi,
Using this code:
geometry_msgs::PoseStamped current_pose;
current_pose = move_group_interface_arm.getCurrentPose("ee_link");
geometry_msgs::Pose target_pose1;
target_pose1.orientation = current_pose.pose.orientation;
//target_pose1.orientation.w = 1.0;
target_pose1.position.x = 0.3;
target_pose1.position.y = 0.5;
target_pose1.position.z = 0.8;
move_group_interface_arm.setPoseTarget(target_pose1);
success = (move_group_interface_arm.plan(my_plan) == moveit::planning_interface::MoveItErrorCode::SUCCESS);
ROS_INFO_NAMED("Spraying", "Visualizing plan 2 (pose goal) %s", success ? "" : "FAILED");
move_group_interface_arm.move();
ros::Duration(0.5).sleep();
moveit::planning_interface::MoveGroupInterface::Plan my_plan_gripper;
// 3. close the gripper
move_group_interface_gripper.setJointValueTarget(move_group_interface_gripper.getNamedTargetValues("closed"));
success = (move_group_interface_gripper.plan(my_plan_gripper) ==
moveit::planning_interface::MoveItErrorCode::SUCCESS);
ROS_INFO_NAMED("Spraying", "Visualizing plan 3 (pose goal) %s", success ? "" : "FAILED");
move_group_interface_gripper.move();
ros::Duration(0.5).sleep();
std::vector<geometry_msgs::Pose> waypoints;
waypoints.push_back(target_pose1);
geometry_msgs::Pose target_pose2 = target_pose1;
target_pose2.position.x -= 0.6;
waypoints.push_back(target_pose2); // right
target_pose2.position.z -= 0.2;
waypoints.push_back(target_pose2); // down
target_pose2.position.x += 0.6;
waypoints.push_back(target_pose2); // left
moveit_msgs::RobotTrajectory trajectory;
const double jump_threshold = 0.0;
const double eef_step = 0.01;
double fraction = move_group_interface_arm.computeCartesianPath(waypoints, eef_step, jump_threshold, trajectory);
ROS_INFO_NAMED("tutorial", "Visualizing plan 4 (Cartesian path) (%.2f%% achieved)", fraction * 100.0);
move_group_interface_arm.execute(trajectory);
ros::Duration(0.5).sleep();
I get the Console output:
[ INFO] [1653046139.892592363]: Received request to compute Cartesian path
[ INFO] [1653046139.893181186]: Attempting to follow 12 waypoints for link 'ee_link' using a step of 0.010000 m and jump threshold 0.000000 (in global reference frame)
[ INFO] [1653046139.937448016]: Computed Cartesian path with 146 points (followed 34.583333% of requested trajectory)
[ INFO] [1653046139.938547863]: Execution request received
[ INFO] [1653046139.978539353]: Fake execution of trajectory
[ INFO] [1653046150.178819596]: Completed trajectory execution with status SUCCEEDED ...
[ INFO] [1653046150.179159290]: Execution completed: SUCCEEDED
There are no errors displayed in terminal, and I've got no obstacles in my environment. How do I get to execute the full trajectory?