Robotics StackExchange | Archived questions

MoveIt 2 unneccesary movements with UR3e

Setup

Robot: UR3e

OS: Ubuntu 22.04

Distro: ROS2 Humble

I try to move my UR3e with moveit. I managed to move it to a desired location. But on the way it makes a lot of Unnecessary movements. For example: While moving to a position a littlebit to the left it makes 2 turns around himself and finally reaches the position.

I tried to fix this with a Cartesian Path which works fine with the Pandas Arm from the tutorial. But when i change this to the UR it still makes some crazy movements on this path.

My goal is to write a simple Pick and Place task. Move to a location. Grasp the Object. Move up, Move left, Move down, release the object.

Does anyone know how i can solve this?

// Set a target Pose
auto const target_pose = []{
  geometry_msgs::msg::Pose msg;
  msg.orientation.w = 1.0;
  msg.position.x = 0.28;
  msg.position.y = 0.2;
  msg.position.z = 0.4;
  return msg;
}();
move_group.setPoseTarget(target_pose);

// Create a plan to that target pose
auto const [success, plan] = [&move_group]{
  moveit::planning_interface::MoveGroupInterface::Plan msg;
  auto const ok = static_cast<bool>(move_group.plan(msg));
  return std::make_pair(ok, msg);
}();

// Execute the plan
if(success) {
  move_group.execute(plan);
} else {
  RCLCPP_ERROR(logger, "Planing failed!");
}

rclcpp::sleep_for(std::chrono::milliseconds(5000));

std::vector<geometry_msgs::msg::Pose> waypoints;
waypoints.push_back(target_pose);

geometry_msgs::msg::Pose target_pose3 = target_pose;

target_pose3.position.z = 0.2;
waypoints.push_back(target_pose3);  // up

target_pose3.position.y -= 0.2;
waypoints.push_back(target_pose3);  // right

target_pose3.position.z -= 0.2;
waypoints.push_back(target_pose3);  // down

moveit_msgs::msg::RobotTrajectory trajectory;
const double jump_threshold = 0.0;
const double eef_step = 0.01;
double fraction = move_group.computeCartesianPath(waypoints, eef_step, jump_threshold, trajectory);
//RCLCPP_INFO(LOGGER, "Visualizing plan 4 (Cartesian path) (%.2f%% achieved)", fraction * 100.0);

move_group.execute(trajectory); 

Asked by LucB on 2022-11-09 11:02:03 UTC

Comments

Answers