g.pre_grasp_posture.joint_names.resize(1, "r_gripper_motor_screw_joint");[ WARN] [1421259026.337060865, 5691.010000000]: Fail: ABORTED: Solution found but controller failed during execution[ WARN] [1421259182.528267093, 5807.111000000]: Controller handle r_gripper_controller reports status ABORTEDI'm trying to get Pick/Place to work on the PR2. I'm using moveit built from sources in Hydro on Precise.I have created a simple gazebo scene with a single coke can, and added this to the planning scene using ORK object detection.This looks fine:I'm using the pick/place tutorial from here:but without creating the planning scene manually, i.e. lines 156-215 are commented out and I'm passing in the correct object name from the planning scene.The first thing I stumbled upon was that I had to change the pre_grasp_posture and grasp_posture joint name tog.pre_grasp_posture.joint_names.resize(1, "r_gripper_motor_screw_joint");from just "r_gripper_joint" as it was before to make the gripper move at all. Is this a bug in the tutorial code or am I doing something wrong anywhere else?
Now, I'm observing the following behavior:The arm moves in position correctly and the gripper starts to open, when I get the following:In my client:[ WARN] [1421259026.337060865, 5691.010000000]: Fail: ABORTED: Solution found but controller failed during executionand in the move_group node:[ WARN] [1421259182.528267093, 5807.111000000]: Controller handle r_gripper_controller reports status ABORTEDHowever, the gripper is still in the process of opening, i.e. executing the movement and that succeeds (visually, i.e. it looks open at the end).
When I then try the same thing again (now the gripper already being open), this part succeeds and the robot starts closing the gripper around the object.The problem here is that the next motion, i.e. lifting the object already starts immediately, while the gripper is still closing. So it seems that the execution does not wait for the closing action to finish (or that action reports this incorrectly).
I'm not sure if these three problems originate from the same source or are just three independent issues. I'd be thankful for any hints as to what component might be at fault and/or how to debug and understand what is going on internally.Best,Christian
<node name="gripper_action_node"
pkg="pr2_gripper_action" type="pr2_gripper_action">
<!-- needed for stall detection in simulation with joint "jitter" -->
<param name="stall_velocity_threshold" value="0.02" type="double"/>
<param name="stall_timeout" value="0.5" type="double"/>
</node> // the gripper action reports failure when closing the gripper and an object is inside
if (state == actionlib::SimpleClientGoalState::ABORTED && closing_)
finishControllerExecution(actionlib::SimpleClientGoalState::SUCCEEDED);
else
finishControllerExecution(state);Hi Adolfo,it turns out you were right on all accounts.There are a couple things coming together, which I'll summarize in case someone stumbles upon this.
The first problem was that the gripper velocities that I get from gazebo don't match the controller config in pr2_controller_configuration_gazebo at all.I measured values around 0.015107115682 when the gripper is moving. pr2_default_controllers.launch has the following settings:<node name="gripper_action_node"
pkg="pr2_gripper_action" type="pr2_gripper_action">
<!-- needed for stall detection in simulation with joint "jitter" -->
<param name="stall_velocity_threshold" value="0.02" type="double"/>
<param name="stall_timeout" value="0.5" type="double"/>
</node>So movement was considered stall all the time and after the stall_timeout of 0.5s every action automatically aborts. Actual jitter that I see in gazebo is around 1e-7, so setting this to 1e-6 fixed this. I'll have to test a bitmore during grasping with this, but the original 0.02 is way too high for what I see.Now actions still abort, but after the default timeout set in moveit as you suspected. When I give an explicit timepoint in the pre_grasp_posture everything works fine.The lifting starting immediately is caused by the implementation of pr2_moveit_controller_manager:// the gripper action reports failure when closing the gripper and an object is inside
if (state == actionlib::SimpleClientGoalState::ABORTED && closing_)
finishControllerExecution(actionlib::SimpleClientGoalState::SUCCEEDED);
else
finishControllerExecution(state);With the wrong stall velocity this immediate abort caused the assumption that the object is now grasped.
std::vector<moveit_msgs::Grasp> grasps;
moveit_msgs::Grasp g;
g.grasp_pose = p;
g.pre_grasp_approach.direction.vector.x = 1.0;
g.pre_grasp_approach.direction.header.frame_id = "r_wrist_roll_link";
g.pre_grasp_approach.min_distance = 0.2;
g.pre_grasp_approach.desired_distance = 0.4;
g.post_grasp_retreat.direction.header.frame_id = "base_footprint";
g.post_grasp_retreat.direction.vector.z = 1.0;
g.post_grasp_retreat.min_distance = 0.1;
g.post_grasp_retreat.desired_distance = 0.25;
g.pre_grasp_posture.joint_names.resize(1, "r_gripper_motor_screw_joint");
g.pre_grasp_posture.points.resize(1);
g.pre_grasp_posture.points[0].positions.resize(1);
g.pre_grasp_posture.points[0].positions[0] = 1.0;
g.pre_grasp_posture.points[0].time_from_start = ros::Duration(45.0);
g.grasp_posture.joint_names.resize(1, "r_gripper_motor_screw_joint");
g.grasp_posture.points.resize(1);
g.grasp_posture.points[0].positions.resize(1);
g.grasp_posture.points[0].positions[0] = 0;
g.grasp_posture.points[0].time_from_start = ros::Duration(45.0);
grasps.push_back(g);
return group.pick(object, grasps);
Hi Christian,
Thanks. In my case I have to set both, default 'stall_timeout' and 'time_from_start', to very high values in order to make it work. Now, the complete pick and place is working fine but the gripper's opening and closing are very slow. Is it also happening to you or anyone? And how to make it fast?
Regards,
Ali
Thanks. Now, I have set stall_velocity_threshold to a small value and stall_timeout to default value. I have also set time_from_start to 45. Now, It does complete both pick and place but still the gripper closes/opens very slowly.
Regards,
Ali