neka-nat / ur_ws

Universal robot with robotiq hand workspace
26 stars 10 forks source link

Objects slips from gripper during Gazebo simulation #6

Closed jainvrushabh5 closed 1 year ago

jainvrushabh5 commented 1 year ago

Hello @JenniferBuehler I 'm trying to simulate a simple scenario of pick and place for my UR5 ARM robot but i'm encoutering some problems during grasp. In particular, when grasping the gripper starts shaking untill the object slips out of the gripper the gripper seems to explode as can be seen in Video I am using effort_controllers. please help me to solve the issue.

MY GAZEBO PLUGINS:

<gazebo>
        <!-- loading plugin: mimic joints works in gazebo now -->
         <plugin name="gazebo_mimic_joint_plugin_1" filename="libroboticsgroup_gazebo_mimic_joint_plugin.so">
                    <joint>gripper_finger1_joint</joint>
                    <mimicJoint>gripper_finger2_joint</mimicJoint>
                    <multiplier>1.0</multiplier>
                    <offset>0.0</offset>
                    <sensitiveness>0.0</sensitiveness>
                    <maxEffort>500</maxEffort>
                    <robotNamespace>/ur5</robotNamespace>
 </plugin>
        <plugin name="gazebo_mimic_joint_plugin_2" filename="libroboticsgroup_gazebo_mimic_joint_plugin.so">
                    <joint>gripper_finger1_joint</joint>
                    <mimicJoint>gripper_finger2_inner_knuckle_joint</mimicJoint>
                    <multiplier>1.0</multiplier>
                    <offset>0.0</offset>
                    <sensitiveness>0.0</sensitiveness>
                    <maxEffort>500</maxEffort>
                    <robotNamespace>/ur5</robotNamespace>
 </plugin>
 <plugin name="gazebo_mimic_joint_plugin_3" filename="libroboticsgroup_gazebo_mimic_joint_plugin.so">
                    <joint>gripper_finger1_joint</joint>
                    <mimicJoint>gripper_finger1_inner_knuckle_joint</mimicJoint>
                    <multiplier>1.0</multiplier>
                    <offset>0.0</offset>
                    <sensitiveness>0.0</sensitiveness>
                    <maxEffort>500</maxEffort>
                    <robotNamespace>/ur5</robotNamespace>
 </plugin>
 <plugin name="gazebo_mimic_joint_plugin_4" filename="libroboticsgroup_gazebo_mimic_joint_plugin.so">
                    <joint>gripper_finger1_joint</joint>
                    <mimicJoint>gripper_finger1_finger_tip_joint</mimicJoint>
                    <multiplier>-1.0</multiplier>
                    <offset>0.0</offset>
                    <sensitiveness>0.0</sensitiveness>
                    <maxEffort>500</maxEffort>
                    <robotNamespace>/ur5</robotNamespace>
 </plugin>
 <plugin name="gazebo_mimic_joint_plugin_5" filename="libroboticsgroup_gazebo_mimic_joint_plugin.so">
                    <joint>gripper_finger1_joint</joint>
                    <mimicJoint>gripper_finger2_finger_tip_joint</mimicJoint>
                    <multiplier>-1.0</multiplier>
                    <offset>0.0</offset>
                    <sensitiveness>0.0</sensitiveness>
                    <maxEffort>800</maxEffort>
                    <robotNamespace>/ur5</robotNamespace>
        </plugin>
    </gazebo>
    <!--using the grasp plugin so that the gripper can grasp things in simulation-->
    <gazebo>
        <plugin name="gazebo_grasp_fix" filename="libgazebo_grasp_fix.so">
            <arm>
                <arm_name>ur5</arm_name>
                <palm_link>wrist_3_link</palm_link>
                <gripper_link>gripper_finger1_finger_tip_link</gripper_link>
                <gripper_link>gripper_finger2_finger_tip_link</gripper_link>
                <gripper_link>gripper_finger1_inner_knuckle_link</gripper_link>
                <gripper_link>gripper_finger2_inner_knuckle_link</gripper_link>
                <gripper_link>gripper_finger1_knuckle_link</gripper_link>
                <gripper_link>gripper_finger2_knuckle_link</gripper_link>
            </arm>
            <forces_angle_tolerance>100</forces_angle_tolerance>
            <update_rate>10</update_rate>
            <grip_count_threshold>4</grip_count_threshold>
            <max_grip_count>8</max_grip_count>
            <release_tolerance>0.005</release_tolerance>
            <disable_collisions_on_attach>false</disable_collisions_on_attach>
            <contact_topic>__default_topic__</contact_topic>
        </plugin>
    </gazebo>
JenniferBuehler commented 1 year ago

Hi, can you please send the command line output with gazebo set to verbose output? Thanks :) I suspect that the plugin was not loaded.

JenniferBuehler commented 1 year ago

libgazebo_grasp_fix.so must be in the GAZEBO_PLUGIN_PATH (check with echo $GAZEBO_PLUGIN_PATH in the console where you are running Gazebo)

jainvrushabh5 commented 1 year ago

@JenniferBuehler

Screenshot from 2023-08-03 14-31-07 Screenshot from 2023-08-03 14-35-23

jainvrushabh5 commented 1 year ago

Hey, @JenniferBuehler the object is getting pick but gripper starts shaking please watch this [ video] on terminal [Msg] GazeboGraspFix: Attaching unit_box_red::link::collision to gripper ur5 and after some time [Msg] GazeboGraspFix: Detaching unit_box_red::link::collision from gripper ur5. (https://drive.google.com/file/d/1znzHTJ-Yr_xQvNHKJFJWJ8PJRh3vOXQB/view?usp=sharing)

JenniferBuehler commented 1 year ago

Hi, sorry I won't have time to check before the weekend. If it attaches and then detaches again I think you should play with parameters like the release tolerance (check the wiki on the repo for documentation). It should stay attached. If it detaches, and the robot is still applying force, it will wobble.

jainvrushabh5 commented 1 year ago

Hey @JenniferBuehler I tried everything, but it's not working. 10 out of 1 time the object gets attached, and gripper wobbles start. Sometimes the message is also not getting printed on the terminal, whether it's detach or attatch. If an object gets attached, it slips away too quickly, and messages get print ; it's detached. Debuging ?

JenniferBuehler commented 1 year ago

Could you please send the console output showing the attachment/detachment messages?

Also, have you checked the inertial of the object which is attached? Consider that when the object attaches, it becomes part of the robot. If the object is heavy and/or the inertial is off, the robot can behave weird.

JenniferBuehler commented 1 year ago

Also, I'm a bit confused by the output you sent above, GAZEBO_PLUGIN_PATH should be set to where the plugin is. Or did you put it in a standard path? You have posted part of the plugin output so I'm guessing it must be running

jainvrushabh5 commented 1 year ago

Hey, @JenniferBuehler Thank you for your help. It's working now, reducing release tolerance and the mass of the object it worked for me. final video.

JenniferBuehler commented 1 year ago

I'm glad it's working now :)