How to reduce unnecessary move

ROS Version : noetic v1.15.14
Moveit Version : moveit 1 noetic
Description:
I just set a pose tar get like this, target point is very closed to start point

tf2::Quaternion q_rot;

  double r=0, p=3.14, y=0;  // Rotate the previous pose by 180* about X
  q_rot.setRPY(r, p, y);


  geometry_msgs::Pose target_pose1;
  target_pose1.orientation.x = q_rot.getX();
  target_pose1.orientation.y = q_rot.getY();
  target_pose1.orientation.z = q_rot.getZ();
  target_pose1.orientation.w = q_rot.getW();
  target_pose1.position.x = 0;
  target_pose1.position.y = 0.4;
  target_pose1.position.z = 0.3;

  move_group_interface.setPoseTarget(target_pose1);

  ROS_INFO_NAMED("tutorial", "x: %f y: %f z: %f w: %f", q_rot.getX(), q_rot.getY(), q_rot.getZ(), q_rot.getW());

  moveit::planning_interface::MoveGroupInterface::Plan my_plan;

  
  bool success = (move_group_interface.plan(my_plan) == moveit::planning_interface::MoveItErrorCode::SUCCESS);
 

  move_group_interface.move();

but I get this , it’s weird

Robot run a circle rather than just move a bit to a very close point.

Why an how does this behavior happen ?

This question is probably better suited for ROS Answers, but-- perhaps cartesian planning meets your needs better?

1 Like

The default IK solver may generate an IK solution that is far in joint distance despite being close to the start in EEF pose distance. There are other IK solvers (TRAC-IK, BioIK) that can generate IK solutions with additional constraints (e.g., as close as possible to the start config.). You can change the IK solve in the kinematics.yaml file inside the MoveIt config for your manipulator.

4 Likes

yes , I have tried, but I wonder why cartesian have minimal move behave at most time (not all)
I will searching for it