ROS2 Humble Gazebo Simulation Custom Robotic arm Difficulty gripping object replicating pick and place example

Hello,

I am working on a project to simulate a robotic arm picking up an object with ROS2 control framework that I learned through the ROS2 Control framework course of the Construct community. I was successful in moving the robotic arm and the gripper to close an object. When it came to the point of engaging with the object; The object would slip off the object. I tried increasing the mu1 and mu2 values of the object to allow it to stick since most documentation I found online would work theoretically.

I wanted to hear your insight on what parameters I can fine tune or a ros_gazebo package I should look into the fix my dilemma. I would like advice on what I can try to work with. I am using ROS2 Humble on my current machine. I will also share the main codes used for my project: xacro/urdf files, world, how I ran it and how it simulated; I appreciate any help or direction to advance forward.

I was worried I did it wrong so I used the information on the Moveit2 course and took inspiration of the grasp_box urdf file if it would work with urdf only or sdf would not be enough.

Controllers Yaml file: mycobot_280_controllers.yaml

# controller_manager provides the necessary infrastructure to manage multiple controllers efficiently and robustly using ROS 2 Control.
controller_manager:
  ros__parameters:
    update_rate: 10 # update_rate specifies how often (in Hz) the controllers should be updated.

    # The JointTrajectoryController allows you to send joint trajectory commands to a group 
    # of joints on a robot. These commands specify the desired positions for each joint.     
    arm_controller:
      type: joint_trajectory_controller/JointTrajectoryController

    grip_controller:
      type: joint_trajectory_controller/JointTrajectoryController

    # Responsible for publishing the current state of the robot's joints to the /joint_states 
    # ROS 2 topic
    joint_state_broadcaster:
      type: joint_state_broadcaster/JointStateBroadcaster

# Define the parameters for each controller
arm_controller:
  ros__parameters:
    joints:
      - link1_to_link2
      - link2_to_link3
      - link3_to_link4
      - link4_to_link5
      - link5_to_link6
      - link6_to_link6flange

    # The controller will expect position commands as input for each of these joints.
    command_interfaces:
      - position
    
    # Tells the controller that it should expect to receive position data as the state 
    # feedback from the hardware interface,
    state_interfaces:
      - position

    # If true, When set to true, the controller will not use any feedback from the system 
    # (e.g., joint positions, velocities, efforts) to compute the control commands. 
    open_loop_control: true

    # When set to true, it allows the controller to integrate the trajectory goals it receives. 
    # This means that if the goal trajectory only specifies positions, the controller will 
    # numerically integrate the positions to compute the velocities and accelerations required 
    # to follow the trajectory.
    allow_integration_in_goal_trajectories: true

grip_controller:
  ros__parameters:
    joints:
      - gripper_controller
      
    command_interfaces:
      - position

    state_interfaces:
      - position

    open_loop_control: true
    allow_integration_in_goal_trajectories: true

URDF File: mycobot_280.urdf.xacro

<?xml version="1.0" ?>
<robot xmlns:xacro="http://wiki.ros.org/xacro" name="mycobot_280">
    <xacro:include filename="$(find mycobot_gazebo)/urdf/ros2_control/classic_gazebo/mycobot_280_classic_gazebo.xacro"/>
    <xacro:include filename="$(find mycobot_gazebo)/urdf/ros2_control/classic_gazebo/mycobot_280_ros2_control.xacro"/>

	<link name="world"/>

	<xacro:property name="effort" value="5.0"/>
	<xacro:property name="velocity" value="2.792527"/>

    <xacro:macro name="default_transmission" params="joint_name">
        <transmission name="transmission_${joint_name}">
            <plugin>transmission_interface/SimpleTransmission</plugin>
            <actuator name="actuator_${joint_name}" role="actuator_${joint_name}"/>
            <joint name="${joint_name}" role="${joint_name}">
                <mechanical_reduction>1.0</mechanical_reduction>
            </joint>
        </transmission>
    </xacro:macro>
	
	<link name="base_link">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
			<mass value="0.33"/>
			<inertia
				ixx="0.000784" ixy="0.0" ixz="0.0"
				iyy="0.000867" iyz="0.0"
				izz="0.001598"/>
		</inertial>
		<visual>
			<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/base_link.dae"/>
			</geometry>
			<origin xyz = "0.0 0 -0.03" rpy = "0 0 ${pi/2}"/>
		</visual>
		<collision>
			<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/base_link.dae"/>
			</geometry>
			<origin xyz = "0.0 0 -0.03" rpy = "0 0 ${pi/2}"/>
		</collision>
	</link>

	<link name="link1">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
			<mass value="0.12"/>
			<inertia
				ixx="0.000148" ixy="0.0" ixz="0.0"
				iyy="0.000148" iyz="0.0"
				izz="0.000096"/>
		</inertial>
		<visual>
			<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link1.dae"/>
			</geometry>
			<origin xyz = "0.0 0 0 " rpy = " 0 0 ${-pi/2}"/>
		</visual>
		<collision>
			<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link1.dae"/>
			</geometry>
			<origin xyz = "0.0 0 0.0 " rpy = " 0 0 ${-pi/2}"/>
		</collision>
	</link>
	
	<link name="link2">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
			<mass value="0.19"/>
			<inertia
				ixx="0.000148" ixy="0.0" ixz="0.0"
				iyy="0.000148" iyz="0.0"
				izz="0.000096"/>
		</inertial>
		<visual>
			<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link2.dae"/>
			</geometry>
			<origin xyz = "0.0 0 -0.06096" rpy = " 0 0 ${-pi/2}"/>
		</visual>
		<collision>
			<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link2.dae"/>
			</geometry>
			<origin xyz = "0.0 0 -0.06096" rpy = " 0 0 ${-pi/2}"/>
		</collision>
	</link>

	<link name="link3">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.16"/>
			<inertia
			  ixx="0.000148" ixy="0.0" ixz="0.0"
			  iyy="0.000148" iyz="0.0"
			  izz="0.000096"/>
		</inertial>
		<visual>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link3.dae"/>
		  	</geometry>
			<origin xyz = "0.0 0 0.03256 " rpy = " 0 ${-pi/2} 0"/>
		</visual>
		<collision>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link3.dae"/>
		  	</geometry>
		  	<origin xyz = "0.00 0 0.03256 " rpy = " 0 ${-pi/2} 0"/>
		</collision>
	</link>

	<link name="link4">
		<inertial>
		  	<origin xyz="0 0 0.0" rpy="0 0 0"/>
			<mass value="0.124"/>
			<inertia
			  	ixx="0.000103" ixy="0.0" ixz="0.0"
			  	iyy="0.000103" iyz="0.0"
			  	izz="0.000096"/>
		</inertial>
		<visual>
			<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link4.dae"/>
			</geometry>
			<origin xyz = "0.0 0 0.03056 " rpy = " 0 ${-pi/2} 0"/>
		</visual>
		<collision>
			<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link4.dae"/>
			</geometry>
			<origin xyz = "0.0 0 0.03056 " rpy = " 0 ${-pi/2} 0"/>
		</collision>
	</link>

	<link name="link5">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.11"/>
			<inertia
			  ixx="0.000103" ixy="0.0" ixz="0.0"
			  iyy="0.000103" iyz="0.0"
			  izz="0.000096"/>
		</inertial>
		<visual>
		  	<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link5.dae"/>
		  	</geometry>
		  	<origin xyz = "0.0 0 -0.03356 " rpy = "${-pi/2} 0 0"/>
		</visual>
		<collision>
		   	<geometry>	
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link5.dae"/>
		  	</geometry>
		  	<origin xyz = "0.0 0 -0.03356 " rpy = "${-pi/2} 0 0"/>
		</collision>
	</link>

	<link name="link6">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.0739"/>
			<inertia
			  ixx="0.00006649" ixy="0.0" ixz="0.0"
			  iyy="0.00006649" iyz="0.0"
			  izz="0.000096"/>
		</inertial>
		<visual>
		  	<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link6.dae"/>
		  	</geometry>
		  	<origin xyz = "0 0.00 -0.038" rpy = "0 0 0"/>
		</visual>
		<collision>
		   	<geometry>	
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link6.dae"/>
		  	</geometry>
		  	<origin xyz = "0 0.00 -0.038" rpy = "0 0 0"/>
		</collision>
	</link>

	<link name="link6_flange">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.035"/>
		  	<inertia
				ixx="0.0000149" ixy="0.0" ixz="0.0"
				iyy="0.0000149" iyz="0.0"
				izz="0.0000196"/>
		</inertial>
		<visual>
		  	<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link7.dae"/>
		  	</geometry>
		  	<origin xyz = "0.0 0 -0.012 " rpy = "0 0 0"/>
		</visual>
		<collision>
		   	<geometry>	
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/link7.dae"/>
		  	</geometry>
		  	<origin xyz = "0.0 0 -0.012 " rpy = "0 0 0"/>
		</collision>
	</link>

	<link name="gripper_base">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.07"/>
		  	<inertia
				ixx="0.000010725" ixy="0.0" ixz="0.0"
				iyy="0.000014392" iyz="0.0"
				izz="0.000018517"/>
		</inertial>
		<visual>
		  	<geometry>
				<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_base.dae"/>
		  	</geometry>
		  	<origin xyz = "0.0 0.0 -0.012" rpy = "0 0 0"/>
		</visual>
		<collision>
		   	<geometry>	
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_base.dae"/>
		  	</geometry>
		  	<origin xyz = "0.0 0.0 -0.012" rpy = "0 0 0"/>
		</collision>
	</link>

	<link name="gripper_left1">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.007"/>
		  	<inertia
				ixx="1e-6" ixy="0.0" ixz="0.0"
				iyy="1e-6" iyz="0.0"
				izz="1e-6"/>
		</inertial>
		<visual>
		  	<geometry>
		  		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_left1.dae"/>
		  	</geometry>
			<origin xyz = "0.039 -0.0133 -0.012 " rpy = " 0 0 0"/>
		</visual>
		<collision>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_left1.dae"/>
		  	</geometry>
			<origin xyz = "0.039 -0.0133 -0.012 " rpy = " 0 0 0"/>
		</collision>
	</link>
	
	<link name="gripper_left2">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.007"/>
		  	<inertia
				ixx="1e-6" ixy="0.0" ixz="0.0"
				iyy="1e-6" iyz="0.0"
				izz="1e-6"/>
		</inertial>
		<visual>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_left2.dae"/>
		  	</geometry>
			<origin xyz = "0.005 -0.0195 -0.012 " rpy = " 0 0 0"/>
		</visual>
		<collision>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_left2.dae"/>
		  	</geometry>
				<origin xyz = "0.005 -0.0195 -0.012 " rpy = " 0 0 0"/>
		</collision>
	</link>
	
	<link name="gripper_left3">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.007"/>
		  	<inertia
				ixx="1e-6" ixy="0.0" ixz="0.0"
				iyy="1e-6" iyz="0.0"
				izz="1e-6"/>
		</inertial>
		<visual>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_left3.dae"/>
		  	</geometry>
		<origin xyz = "0.012 0.0025 -0.012 " rpy = " 0 0 0"/>
		</visual>
		<collision>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_left3.dae"/>
		  	</geometry>
			<origin xyz = "0.012 0.0025 -0.012" rpy = " 0 0 0"/>
		</collision>
	</link>
	
	<link name="gripper_right1">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.007"/>
		  	<inertia
				ixx="1e-6" ixy="0.0" ixz="0.0"
				iyy="1e-6" iyz="0.0"
				izz="1e-6"/>
		</inertial>
		<visual>
			<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_right1.dae"/>
		  	</geometry>
			<origin xyz = "-0.039 -0.0133 -0.012 " rpy = " 0 0 0"/>
		</visual>
		<collision>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_right1.dae"/>
		  	</geometry>
			<origin xyz = "-0.039 -0.0133 -0.012 " rpy = " 0 0 0"/>
		</collision>
	</link>
	
	<link name="gripper_right2">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.007"/>
		  	<inertia
				ixx="1e-6" ixy="0.0" ixz="0.0"
				iyy="1e-6" iyz="0.0"
				izz="1e-6"/>
		</inertial>
		<visual>
			<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_right2.dae"/>
		 	</geometry>
			<origin xyz = "-0.005 -0.0195 -0.012 " rpy = " 0 0 0"/>
		</visual>
		<collision>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_right2.dae"/>
		  	</geometry>
			<origin xyz = "-0.005 -0.0195 -0.012 " rpy = " 0 0 0"/>
		</collision>
	</link>
	
	<link name="gripper_right3">
		<inertial>
			<origin xyz="0 0 0.0" rpy="0 0 0"/>
		  	<mass value="0.007"/>
		  	<inertia
				ixx="1e-6" ixy="0.0" ixz="0.0"
				iyy="1e-6" iyz="0.0"
				izz="1e-6"/>
		</inertial>
		<visual>
			<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_right3.dae"/>
			</geometry>
			<origin xyz = "-0.012 0.0025 -0.012 " rpy = " 0 0 0"/>
		</visual>
		<collision>
		  	<geometry>
		   		<mesh filename="file://$(find mycobot_description)/meshes/mycobot_280/gripper_right3.dae"/>
		  	</geometry>
			<origin xyz = "-0.012 0.0025 -0.012" rpy = " 0 0 0"/>
		</collision>
	</link>

    <gazebo reference="base_link">
        <material>Gazebo/Grey</material>
    </gazebo>
    <gazebo reference="link1">
        <material>Gazebo/White</material>
    </gazebo>
    <gazebo reference="link2">
        <material>Gazebo/White</material>
    </gazebo>
    <gazebo reference="link3">
        <material>Gazebo/White</material>
    </gazebo>
    <gazebo reference="link4">
        <material>Gazebo/White</material>
    </gazebo>
    <gazebo reference="link5">
        <material>Gazebo/White</material>
    </gazebo>
    <gazebo reference="link6">
        <material>Gazebo/White</material>
    </gazebo>
    <gazebo reference="link6_flange">
        <material>Gazebo/White</material>
    </gazebo>
    <gazebo reference="gripper_base">
        <material>Gazebo/White</material>
    </gazebo>
  
    <joint name="virtual_joint" type="fixed">
	<parent link="world"/>
	    <child link="base_link"/>
	    <origin xyz= "0 0 0" rpy = "0 0 0"/>  
    </joint>
	
    <joint name="base_link_to_link1" type="fixed">
        <parent link="base_link"/>
            <child link="link1"/>
            <origin xyz="0 0 0" rpy="0 0 0"/>
    </joint>

	<joint name="link1_to_link2" type="revolute">
		<axis xyz="0 0 1"/>
		<limit effort = "${effort}" lower = "-2.879793" upper = "2.879793" velocity = "${velocity}"/>
		<parent link="link1"/>
		<child link="link2"/>
		<origin xyz= "0 0 0.13156" rpy = "0 0 ${pi/2}"/>  
        <dynamics damping="12.0" friction="6.0"/>
	</joint>

	<joint name="link2_to_link3" type="revolute">
		<axis xyz="0 0 1"/>
		<limit effort = "${effort}" lower = "-2.879793" upper = "2.879793" velocity = "${velocity}"/>
		<parent link="link2"/>
		<child link="link3"/>
		<origin xyz= "0 0 -0.001" rpy = "0 ${pi/2} ${-pi/2}"/>  
        <dynamics damping="12.0" friction="6.0"/>
	</joint>

	<joint name="link3_to_link4" type="revolute">
		<axis xyz=" 0 0 1"/>
		<limit effort = "${effort}" lower = "-2.879793" upper = "2.879793" velocity = "${velocity}"/>
		<parent link="link3"/>
		<child link="link4"/>
		<origin xyz= "-0.1104 0 0   " rpy = "0 0 0"/>
        <dynamics damping="12.0" friction="6.0"/>
	</joint>

	<joint name="link4_to_link5" type="revolute">
		<axis xyz=" 0 0 1"/>
		<limit effort = "${effort}" lower = "-2.879793" upper = "2.879793" velocity = "${velocity}"/>
		<parent link="link4"/>
		<child link="link5"/>
		<origin xyz= "-0.096 0 0.06062" rpy = "0 0 ${-pi/2}"/>
        <dynamics damping="12.0" friction="6.0"/>
	</joint>

	<joint name="link5_to_link6" type="revolute">
		<axis xyz=" 0 0 1"/>
		<limit effort = "${effort}" lower = "-2.879793" upper = "2.879793" velocity = "${velocity}"/>
		<parent link="link5"/>
		<child link="link6"/>
		<origin xyz= "0 -0.07318 0" rpy = "${pi/2} ${-pi/2} 0"/>
        <dynamics damping="7.0" friction="4.0"/>
	</joint>

	<joint name="link6_to_link6flange" type="revolute">
		<axis xyz=" 0 0 1"/>
		<limit effort = "${effort}" lower = "-3.05" upper = "3.05" velocity = "${velocity}"/>
		<parent link="link6"/>
		<child link="link6_flange"/>
		<origin xyz= "0 0.0456 0" rpy = "${-pi/2} 0 0"/>
        <dynamics damping="3.0" friction="3.0"/>
	</joint>

	<joint name="link6flange_to_gripper_base" type="fixed">
		<parent link="link6_flange"/>
		<child link="gripper_base"/>
		<origin xyz= "0 0 0.034" rpy = "1.579 0 0"/>
	</joint>

	<joint name="gripper_controller" type="revolute">
		<axis xyz="0 0 1"/>
		<limit effort = "${effort}" lower = "-0.7" upper = "0.15" velocity = "${velocity}"/>
		<parent link="gripper_base"/>
		<child link="gripper_left3"/>
		<origin xyz= "-0.012 0.005 0" rpy = "0 0 0"/> 
        <dynamics damping="2.0" friction="4.0"/>
	</joint>
	
	<joint name="gripper_base_to_gripper_left2" type="revolute">
		<axis xyz="0 0 1"/>
		<limit effort = "${effort}" lower = "-0.8" upper = "0.5" velocity = "${velocity}"/>
		<parent link="gripper_base"/>
		<child link="gripper_left2"/>
		<origin xyz= "-0.005 0.027 0" rpy = "0 0 0"/> 
		<mimic joint="gripper_controller" multiplier="1.0" offset="0" />
        <dynamics damping="2.0" friction="4.0"/>
	</joint>
	
	<joint name="gripper_left3_to_gripper_left1" type="revolute">
		<axis xyz="0 0 1"/>
		<limit effort = "${effort}" lower = "-0.5" upper = "0.5" velocity = "${velocity}"/>
		<parent link="gripper_left3"/>
		<child link="gripper_left1"/>
		<origin xyz= "-0.027 0.016 0" rpy = "0 0 0"/> 
		<mimic joint="gripper_controller" multiplier="-1.0" offset="0" />
        <dynamics damping="2.0" friction="4.0"/>
	</joint>
	
	<joint name="gripper_base_to_gripper_right3" type="revolute">
		<axis xyz="0 0 1"/>
		<limit effort = "${effort}" lower = "-0.15" upper = "0.7" velocity = "${velocity}"/>
		<parent link="gripper_base"/>
		<child link="gripper_right3"/>
		<origin xyz= "0.012 0.005 0" rpy = "0 0 0"/> 
		<mimic joint="gripper_controller" multiplier="-1.0" offset="0" />
        <dynamics damping="2.0" friction="4.0"/>
	</joint>
	
	<joint name="gripper_base_to_gripper_right2" type="revolute">
		<axis xyz="0 0 1"/>
		<limit effort = "${effort}" lower = "-0.5" upper = "0.8" velocity = "${velocity}"/>
		<parent link="gripper_base"/>
		<child link="gripper_right2"/>
		<origin xyz= "0.005 0.027 0" rpy = "0 0 0"/> 
		<mimic joint="gripper_controller" multiplier="-1.0" offset="0" />
        <dynamics damping="2.0" friction="4.0"/>
	</joint>
	
	<joint name="gripper_right3_to_gripper_right1" type="revolute">
		<axis xyz="0 0 1"/>
		<limit effort = "${effort}" lower = "-0.5" upper = "0.5" velocity = "${velocity}"/>
		<parent link="gripper_right3"/>
		<child link="gripper_right1"/>
		<origin xyz= "0.027 0.016 0" rpy = "0 0 0"/> 
		<mimic joint="gripper_controller" multiplier="1.0" offset="0" />
        <dynamics damping="2.0" friction="4.0"/>
	</joint>

    <xacro:default_transmission joint_name="link1_to_link2"/>
    <xacro:default_transmission joint_name="link2_to_link3"/>
    <xacro:default_transmission joint_name="link3_to_link4"/>
    <xacro:default_transmission joint_name="link4_to_link5"/>
    <xacro:default_transmission joint_name="link5_to_link6"/>
    <xacro:default_transmission joint_name="link6_to_link6flange"/>
    <xacro:default_transmission joint_name="gripper_controller"/>
 
</robot>

URDF file: mycobot_280_classic_gazebo.xacro

<?xml version="1.0" ?>
<robot xmlns:xacro="http://wiki.ros.org/xacro" name="mycobot_280">
    <!-- The Gazebo plugin for ros2_control -->
    <gazebo>
        <plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
            <robot_param>robot_description</robot_param>
            <robot_param_node>robot_state_publisher</robot_param_node>
            <parameters>$(find mycobot_gazebo)/config/mycobot_280_controllers.yaml</parameters>
        </plugin>
    </gazebo>
</robot>

URDF: mycobot_280_ros2_controls

<?xml version="1.0" ?>
<robot xmlns:xacro="http://wiki.ros.org/xacro" name="mycobot_280">

    <!-- Interface the robot's hardware with the ROS 2 Control library -->
    <ros2_control name="RobotSystem" type="system">
        <hardware>
            <plugin>gazebo_ros2_control/GazeboSystem</plugin>
        </hardware>

        <joint name="link1_to_link2">
            <command_interface name="position">
                <param name="min">-2.879793</param>
                <param name="max">2.879793</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="link2_to_link3">
            <command_interface name="position">
                <param name="min">-2.879793</param>
                <param name="max">2.879793</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="link3_to_link4">
            <command_interface name="position">
                <param name="min">-2.879793</param>
                <param name="max">2.879793</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="link4_to_link5">
            <command_interface name="position">
                <param name="min">-2.879793</param>
                <param name="max">2.879793</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="link5_to_link6">
            <command_interface name="position">
                <param name="min">-2.879793</param>
                <param name="max">2.879793</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="link6_to_link6flange">
            <command_interface name="position">
                <param name="min">-3.05</param>
                <param name="max">3.05</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="gripper_controller">
            <command_interface name="position">
                <param name="min">-0.7</param>
                <param name="max">0.15</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="gripper_base_to_gripper_left2">
            <param name="mimic">gripper_controller</param>
            <param name="multiplier">1.0</param>
            <command_interface name="position">
                <param name="min">-0.8</param>
                <param name="max">0.5</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="gripper_left3_to_gripper_left1">
            <param name="mimic">gripper_controller</param>
            <param name="multiplier">-1.0</param>
            <command_interface name="position">
                <param name="min">-0.5</param>
                <param name="max">0.5</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="gripper_base_to_gripper_right3">
            <param name="mimic">gripper_controller</param>
            <param name="multiplier">-1.0</param>
            <command_interface name="position">
                <param name="min">-0.15</param>
                <param name="max">0.7</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="gripper_base_to_gripper_right2">
            <param name="mimic">gripper_controller</param>
            <param name="multiplier">-1.0</param>
            <command_interface name="position">
                <param name="min">-0.5</param>
                <param name="max">0.8</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

        <joint name="gripper_right3_to_gripper_right1">
            <param name="mimic">gripper_controller</param>
            <param name="multiplier">1.0</param>
            <command_interface name="position">
                <param name="min">-0.5</param>
                <param name="max">0.5</param>
            </command_interface>
            <state_interface name="position"/>
        </joint>

    </ros2_control>
    
    
</robot>

URDF object : grasp_box urdf object of interest to collect

<robot name="grasp_box">

    <!-- Colours for RVIZ for geometric elements -->
    <material name="blue">
        <color rgba="0 0 0.8 1"/>
    </material>
    <material name="red">
        <color rgba="0.8 0 0 1"/>
    </material>
    <material name="green">
        <color rgba="0 0.8 0 1"/>
    </material>
    <material name="grey">
        <color rgba="0.75 0.75 0.75 1"/>
    </material>
    <material name="white">
        <color rgba="1.0 1.0 1.0 1"/>
    </material>
    <material name="black">
        <color rgba="0 0 0 1"/>
    </material>


	<!-- * * * Link Definitions * * * -->

    <link name="grasp_box_base_link">
 	    <inertial>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <mass value="0.1" />
        <inertia ixx="0.000133333333333" ixy="0.0" ixz="0.0" iyy="0.000133333333333" iyz="0.0" izz="0.000133333333333"/>
    </inertial>
    <collision>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <box size="0.02 0.02 0.04"/>
        </geometry>
        <surface>
            <friction>
                <ode>
                    <mu>1.0</mu>   <!-- Adjust as needed -->
                    <mu2>1.0</mu2> <!-- Adjust as needed -->
                </ode>
            </friction>
        </surface>
    </collision>
    <visual>
        <origin rpy="0.0 0 0" xyz="0 0 0"/>
        <geometry>
            <box size="0.02 0.02 0.04"/>
        </geometry>
        <material name="red"/>
    </visual>
    </link>

    <gazebo reference="grasp_box_base_link">
        <kp>100000.0</kp>
        <kd>100.0</kd>
        <mu1>1.0</mu1>
        <mu2>1.0</mu2>
        <material>Gazebo/Red</material>
    </gazebo>

</robot>

shown of result:

Thank you again for your time and reading this post!

Hi @Agarcia5612 ,

Let me get straight into your problem: the robot gripper unable to grasp the object properly in the simulation.

The initial step that you took in changing the mu1 and mu2 values along with kp and kd are correct. However, to have successful grasp you need to do a bit more work.

The following points are what I think will help you the most:

  1. Spawn multiple blocks with different sizes. Try to get the value for the gripper for each size of object. Then you can use those values to find the “fitting-curve” for the gripper as a function that would return the gripper value for any object size that you put in, within gripper working limits.
  2. Implement an “effort controller” for the gripper. The gripper command comes along with effort values too. You need to find the effort that the gripper applies to move in empty space, that is, open and close in empty space. That will be your base effort. Once you have an object to grasp, you need to close the gripper with iterative closing method. Each iterative gripper closing action will return an effort value. Once you get the effort value more than the base value, you know that the gripper has applied extra effort and that is where the object has been grasped.
  3. Implement contact sensor for your robot. It is called bumper sensor for Gazebo. Implement the contact sensors for the gripper fingers. The contact data will be sent over a topic which you can subscribe to and know at which points the link of the gripper has contact with external world. Once you get those values, you can filter out the (x, y, z) values based on inside-gripper or outside-gripper. If you are grasping an object with inside gripper configuration, then you need to filter out the contact points that correspond to gripper faces of the fingers. Once you have a certain force on the contact points, then you will know that the object has been grasped.

The main reason the object slips away in the simulation is due to two reasons:

  1. Either you have closed the gripper completely - which will make the object fly away or will make the gripper fingers start to malfunction.
  2. You are applying a gripper value that is greater than the required value to grip that block. Let’s say your gripper working values are from 0.0 to 1.0. Let’s say the object is about 5 cm thick. Let the value that corresponds to 5 cm width is 0.72. If you set the value for gripper to a value greater than 0.72, say 0.80, then that will make the object slip from the gripper. in the previous case, it flies away, but in this case it slips away.

I hope this explanation helped you understand about your situation in detail.

Regards,
Girish

PS: Let me know which idea you implemented! If you tried all the 3 points, let me know which worked the best out of the three!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.