ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to call pick function using both arms?

asked 2020-02-23 23:46:10 -0500

Tawfiq Chowdhury gravatar image

updated 2020-02-23 23:49:12 -0500

I am trying to call pick function using right arm first and then left arm but it is not working.

Here is my code:

moveit::planning_interface::MoveGroup group("right_arm");
  group.setPlanningTime(45.0);
  ros::WallDuration(1.0).sleep();
  geometry_msgs::PoseStamped p;
  p.header.frame_id = "odom_combined";
  p.pose.position.x = (float)req.a;
  p.pose.position.y = (float)req.b;
  p.pose.position.z = (float)req.c;
  p.pose.orientation.x = (float)req.d;
  p.pose.orientation.y = (float)req.e;
  p.pose.orientation.z = (float)req.f;
  p.pose.orientation.w = (float)req.g;

  geometry_msgs::PoseStamped q;
  q.header.frame_id = "odom_combined";
  q.pose.position.x = (float)req.h;
  q.pose.position.y = (float)req.i;
  q.pose.position.z = (float)req.j;
  q.pose.orientation.x = (float)req.k;
  q.pose.orientation.y = (float)req.l;
  q.pose.orientation.z = (float)req.m;
  q.pose.orientation.w = (float)req.n;


  pick_right(group, p);

  ros::WallDuration(1.0).sleep();
  moveit::planning_interface::MoveGroup group_l("left_arm");
  group_l.setPlanningTime(45.0);
  ros::WallDuration(1.0).sleep();

  pick_left(group_l, q);

I have the corresponding pick_left functions. The right arm picks but nothing happens with the left arm.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-03 04:32:40 -0500

fvd gravatar image

updated 2020-03-03 04:34:34 -0500

No one knows what is in your custom functions pick_left and pick_right, or what your terminal output is. You should update your original post with that information.

If those methods call the MoveIt pick/place pipeline functions, then the second one would fail because the object is not in the PlanningScene as a world object anymore, but attached to a robot. If they just move to a pose and close their gripper, the second robot might collide with the first. You would see errors in the terminal either way.

If you want to move your second arm to a known point on the attached object to support it, you can use subframes, but you will probably need to do some more legwork afterwards (e.g. you will need to constrain the two arms' motions yourself).

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-02-23 23:46:10 -0500

Seen: 90 times

Last updated: Mar 03 '20