Closed Helloxuxuxu closed 2 weeks ago
Probably the planner is not able to find a path satisfying your constraint. Are you sure, the constraint is feasible?
Probably the planner is not able to find a path satisfying your constraint. Are you sure, the constraint is feasible?
Thank you for your reply! 1.First, I have adjusted the initial orientation to the target orientation, and this step has been successful.
/*First, align the end-effector pose with the target pose*/
geometry_msgs::msg::PoseStamped current_pose;
current_pose = move_group_interface_.getCurrentPose("gripper_fake_center_link");
geometry_msgs::msg::Pose target_pose_temp; //Intermediate pose
target_pose_temp.position = current_pose.pose.position;
target_pose_temp.orientation = target_pose.orientation;
move_group_interface_.setPoseTarget(target_pose_temp);
moveit::planning_interface::MoveGroupInterface::Plan my_plan;
bool success = (move_group_interface_.plan(my_plan)
== moveit::core::MoveItErrorCode::SUCCESS);
if (success){
RCLCPP_INFO(logger_,"Move to target_pose_temp successful.");
move_group_interface_.execute(my_plan);
} else {
RCLCPP_ERROR(logger_,"Planning failed to target_pose_temp.");
return;
}
2.Then, I set the constraint to 3.1515926, which is almost equal to no constraint.
moveit_msgs::msg::OrientationConstraint ocm;
ocm.link_name = "gripper_fake_center_link";
ocm.header.frame_id = "base_link";
ocm.orientation = target_pose.orientation;
ocm.absolute_x_axis_tolerance = 3.1415926; // Set tolerance
ocm.absolute_y_axis_tolerance = 3.1415926;
ocm.absolute_z_axis_tolerance = 3.1415926;
ocm.weight = 1.0; // Weight can be set to 1.0, to make the planner prioritize this constraint
moveit_msgs::msg::Constraints test_constraints;
test_constraints.orientation_constraints.push_back(ocm);
move_group_interface_.setPathConstraints(test_constraints);
3.In the end, the plan failed, and the planned time far exceeded the time I had set before (more than 2min).
move_group_interface_.setPlanningTime(10);
I really don't understand how to use this constraint. Finally, thank you again for your prompt reply
This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.
This issue was closed because it has been stalled for 45 days with no activity.
Description
I am encountering an issue with MoveIt! where the motion planning fails to generate a valid trajectory when path constraints are applied. Specifically, the code hangs after setting path constraints and attempting to plan a motion, ultimately timing out and returning a failure message.
Your environment
ROS 2: Humble OS Version: Ubuntu 22.04 source: moveit2 release 2.5.5
Steps to reproduce
Launch the MoveIt! node with the specified robot model. Set the path constraints using the setPathConstraints method. Attempt to plan a motion using the plan method. Observe the code hanging at the indicated location and eventually timing out.
Expected behaviour
The motion planning should successfully generate a valid trajectory that adheres to the specified path constraints.
Actual behaviour
The code hangs after setting the path constraints and does not proceed to execute the motion planning. It exceeds the predefined time limit and returns a failure message. Even I set:
when I cancel the
move_group_interface_.setPathConstraints(test_constraints);
every thing will be ok.Backtrace or Console output
moveit console
code console
code: