Grasping is not working in this primitive case I've made with Gazebo 9 and ROS Kinetic. This question is a follow-up to a question I posted here earlier. The reason I've made a separate post is that I have some new data to include and the other question had already grown pretty long.
The object is a box of mass 1 and default friction and contact parameters. The gripper uses two prismatic joints to move two c-shaped links together. All these are shown in this image. Note the gripper-joint coordinate frames (the x- and z-direction vectors are visible).
When the gripper closes on the box and the robot then moves upward, the box does not get lifted, as shown in this animation (it's for a taller gripper than above but the behavior is identical, also the gripper in the animation used just one prismatic joint). Since the normal force between the gripper and box is 200 N (that's what I have the joint effort set at, as shown in the sdf below) then the lifting force should be at least 200 N, while 9.81 N should suffice to lift the box. Do you have an idea why the box doesn't go up?
The following plots were made via
rqt_plot ft_senr_topic_p/wrench/force/x, ft_sensor_topic_p/wrench/force/z, ft_sensor_topic_d/wrench/force/x, ft_sensor_topic_d/wrench/force/z
to graph the x and z components of the joint forces for the two prismatic gripper joints. In this one the joints are controlled with the EffortJointInterface. When the x components drop down, at about 28.6 seconds, that's when the gripper is higher than the box and it closes.
For this plot the gripper friction coefficient is changed to 100, which appears to have made no change.
The final plot is with mu=100 and using the PositionJointInterface. At about 24.4 seconds On this one, the x-components drop down. That's when the robot starts to move upward (prior to that it's stationary with the gripper closed around the box). The spikes after that, at 24.8, are when the gripper clears the box. It's odd to me that one joint has a positive z-component and the other has a negative z-component of force.
Here is the controller part from the gripper urdf xacro file.
<transmission name="gripper_joint_transmission_p">
<type>transmission_interface/SimpleTransmission</type>
<joint name="gripper_joint_p">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="gripper_joint_motor_p">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="gripper_joint_transmission_d">
<type>transmission_interface/SimpleTransmission</type>
<joint name="gripper_joint_d">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="gripper_joint_motor_d">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
The sdf it produces is pasted at the end, but first, here is the box sdf.
<?xml version="1.0" ?>
<sdf version="1.5">
<model name="table_block">
<static>false</static>
<link name='link'>
<inertial>
<mass>1</mass>
</inertial>
<collision name="collision">
<geometry>
<box>
<size>0.32 0.32 0.3</size>
</box>
</geometry>
<!--surface>
<friction>
<ode>
<mu>100.0</mu>
<mu2>100.0</mu2>
</ode>
</friction>
<contact>
<ode>
<kp>1e9</kp>
<kd>1e2</kd>
<max_vel>0</max_vel>
<min_depth>0.0</min_depth>
</ode>
</contact>
</surface-->
</collision>
<visual name="visual">
<geometry>
<box>
<size>0.32 0.32 0.3</size>
</box>
</geometry>
<material>
<ambient>1 0 0 1</ambient>
<diffuse>1 0 0 1</diffuse>
<specular>0.1 0.1 0.1 1</specular>
<emissive>0 0 0 0</emissive>
</material>
</visual>
<sensor name='my_contact' type='contact'>
<contact>
<collision>collision</collision>
</contact>
<update_rate> 5 </update_rate>
</sensor>
</link>
</model>
</sdf>
The surface tag is commented out because no changes there helped the simulation. Here is the gripper sdf (again, it came from gripper.urdf.xacro).
<sdf version='1.6'>
<model name='gripper'>
<link name='gripper_center'>
<pose frame=''>0 0 0 0 -0 0</pose>
<inertial>
<pose frame=''>0 0 0 0 -0 0</pose>
<mass>0.01</mass>
<inertia>
<ixx>0.0001</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.0001</iyy>
<iyz>0</iyz>
<izz>0.0001</izz>
</inertia>
</inertial>
</link>
<link name='gripper_wide_block_d'>
<pose frame=''>0.14 0 0 0 -0 0</pose>
<inertial>
<pose frame=''>-0.0238 -0 0 0 -0 0</pose>
<mass>1.944</mass>
<inertia>
<ixx>0.0603698</ixx>
<ixy>3.30291e-19</ixy>
<ixz>0</ixz>
<iyy>0.00457571</iyy>
<iyz>0</iyz>
<izz>0.0617055</izz>
</inertia>
</inertial>
<collision name='gripper_wide_block_d_collision'>
<pose frame=''>0 0 0 0 -0 0</pose>
<geometry>
<box>
<size>0.01 0.468 0.1</size>
</box>
</geometry>
<surface>
<contact>
<ode>
<max_vel>0</max_vel>
<min_depth>0</min_depth>
</ode>
</contact>
<friction>
<ode>
<mu>100</mu>
<mu2>100</mu2>
</ode>
</friction>
</surface>
</collision>
<collision name='gripper_wide_block_d_fixed_joint_lump__collision_collision_1'>
<pose frame=''>-0.068 0.229 0 0 -0 0</pose>
<geometry>
<box>
<size>0.126 0.01 0.1</size>
</box>
</geometry>
</collision>
<collision name='gripper_wide_block_d_fixed_joint_lump__collision_collision_2'>
<pose frame=''>-0.068 -0.229 0 0 -0 0</pose>
<geometry>
<box>
<size>0.126 0.01 0.1</size>
</box>
</geometry>
</collision>
<visual name='gripper_wide_block_d_visual'>
<pose frame=''>0 0 0 0 -0 0</pose>
<geometry>
<box>
<size>0.01 0.468 0.1</size>
</box>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<visual name='gripper_wide_block_d_fixed_joint_lump__gripper_side_block_d1_visual_1'>
<pose frame=''>-0.068 0.229 0 0 -0 0</pose>
<geometry>
<box>
<size>0.126 0.01 0.1</size>
</box>
</geometry>
</visual>
<visual name='gripper_wide_block_d_fixed_joint_lump__gripper_side_block_d2_visual_2'>
<pose frame=''>-0.068 -0.229 0 0 -0 0</pose>
<geometry>
<box>
<size>0.126 0.01 0.1</size>
</box>
</geometry>
</visual>
<gravity>1</gravity>
<velocity_decay/>
</link>
<joint name='gripper_joint_d' type='prismatic'>
<child>gripper_wide_block_d</child>
<parent>gripper_center</parent>
<axis>
<xyz>1 0 0</xyz>
<limit>
<lower>-100</lower>
<upper>100</upper>
<effort>200</effort>
<velocity>0.5</velocity>
</limit>
<dynamics>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>1</use_parent_model_frame>
</axis>
<physics>
<provide_feedback>1</provide_feedback>
<ode>
<provide_feedback>1</provide_feedback>
<limit>
<cfm>0</cfm>
<erp>0.2</erp>
</limit>
</ode>
</physics>
</joint>
<link name='gripper_wide_block_p'>
<pose frame=''>-0.14 0 0 0 -0 0</pose>
<inertial>
<pose frame=''>0.0238 -0 0 0 -0 0</pose>
<mass>1.944</mass>
<inertia>
<ixx>0.0603698</ixx>
<ixy>-3.30291e-19</ixy>
<ixz>0</ixz>
<iyy>0.00457571</iyy>
<iyz>0</iyz>
<izz>0.0617055</izz>
</inertia>
</inertial>
<collision name='gripper_wide_block_p_collision'>
<pose frame=''>0 0 0 0 -0 0</pose>
<geometry>
<box>
<size>0.01 0.468 0.1</size>
</box>
</geometry>
<surface>
<contact>
<ode>
<max_vel>0</max_vel>
<min_depth>0</min_depth>
</ode>
</contact>
<friction>
<ode>
<mu>100</mu>
<mu2>100</mu2>
</ode>
</friction>
</surface>
</collision>
<collision name='gripper_wide_block_p_fixed_joint_lump__collision_collision_1'>
<pose frame=''>0.068 0.229 0 0 -0 0</pose>
<geometry>
<box>
<size>0.126 0.01 0.1</size>
</box>
</geometry>
</collision>
<collision name='gripper_wide_block_p_fixed_joint_lump__collision_collision_2'>
<pose frame=''>0.068 -0.229 0 0 -0 0</pose>
<geometry>
<box>
<size>0.126 0.01 0.1</size>
</box>
</geometry>
</collision>
<visual name='gripper_wide_block_p_visual'>
<pose frame=''>0 0 0 0 -0 0</pose>
<geometry>
<box>
<size>0.01 0.468 0.1</size>
</box>
</geometry>
<material>
<script>
<uri>__default__</uri>
<name>__default__</name>
</script>
</material>
</visual>
<visual name='gripper_wide_block_p_fixed_joint_lump__gripper_side_block_p1_visual_1'>
<pose frame=''>0.068 0.229 0 0 -0 0</pose>
<geometry>
<box>
<size>0.126 0.01 0.1</size>
</box>
</geometry>
</visual>
<visual name='gripper_wide_block_p_fixed_joint_lump__gripper_side_block_p2_visual_2'>
<pose frame=''>0.068 -0.229 0 0 -0 0</pose>
<geometry>
<box>
<size>0.126 0.01 0.1</size>
</box>
</geometry>
</visual>
<gravity>1</gravity>
<velocity_decay/>
</link>
<joint name='gripper_joint_p' type='prismatic'>
<child>gripper_wide_block_p</child>
<parent>gripper_center</parent>
<axis>
<xyz>1 0 0</xyz>
<limit>
<lower>-100</lower>
<upper>100</upper>
<effort>200</effort>
<velocity>0.5</velocity>
</limit>
<dynamics>
<spring_reference>0</spring_reference>
<spring_stiffness>0</spring_stiffness>
</dynamics>
<use_parent_model_frame>1</use_parent_model_frame>
</axis>
<physics>
<provide_feedback>1</provide_feedback>
<ode>
<provide_feedback>1</provide_feedback>
<limit>
<cfm>0</cfm>
<erp>0.2</erp>
</limit>
</ode>
</physics>
</joint>
<plugin name='ft_sensor_p' filename='libgazebo_ros_ft_sensor.so'>
<updateRate>100.0</updateRate>
<topicName>ft_sensor_topic_p</topicName>
<jointName>gripper_joint_p</jointName>
</plugin>
<static>0</static>
<plugin name='ft_sensor_d' filename='libgazebo_ros_ft_sensor.so'>
<updateRate>100.0</updateRate>
<topicName>ft_sensor_topic_d</topicName>
<jointName>gripper_joint_d</jointName>
</plugin>
</model>
</sdf>
Thanks for your time!