How to set forceon links when some of the links are of mass zero?

asked 2019-11-27 10:49:05 -0600

Suyash gravatar image

updated 2019-11-28 03:23:10 -0600

kumpakri gravatar image

Hi,

I am trying to model three revolute joints in series using an sdf file (below you can find the sdf snippet for link and joint definition) with the following configuration:

  1. Revolute 1 with axis (0 0 1): Main_body->Link1 (zero mass)
  2. Revolute 1 with axis (0 1 0): Link1 (zero mass)->Link2(zero mass)
  3. Revolute 1 with axis (1 0 0): Link2 (zero mass) -> Link3

Here link 1 and link 2 are of zero mass.

The problem is when I am trying to assign a force using SetForce function to main body at its center of mass, it is not moving. I guess this is because Gazebo is unable to solve the forces through massless link to be transferred to the link 3 which is not mass less. I am however able to set any acceleration, velocity and position to any of the link. I want to apply force to the main body. Is there a way around? I would also want to apply torques to the link 3 from mainbody.

Also I am trying to apply force on the joints between main_body and link 1 and that also seems to not be working. Please suggest the needful. Thank you.

Massless link defination

  <link name='RW2'>
    <pose frame=''>0 0 0 0 0 0</pose>
    <inertial>
      <pose frame=''>0.030076 -1e-06 -0.015425 0 -0 0</pose>
      <mass>0</mass>
      <inertia>
        <ixx>0</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>0</iyy>
        <iyz>0</iyz>
        <izz>0</izz>
      </inertia>
    </inertial>
    <self_collide>0</self_collide>
    <enable_wind>0</enable_wind>
    <kinematic>1</kinematic>
    <visual name='RW2_visual'>
      <pose frame=''>0 0 0 0 -0 0</pose>
      <geometry>
        <mesh>
          <scale>0.1 0.1 0.1</scale>
          <uri>/home/suyash/urdf_main/src/cleaner/meshes/RW.STL</uri>
        </mesh>
      </geometry>
      <material>
        <shader type='pixel'/>
      </material>
      <transparency>1</transparency>
      <cast_shadows>0</cast_shadows>
    </visual>
  </link>

JOINT definition:

 <joint name='RW1_to_RW2' type='revolute'>
    <parent>RW1</parent>
    <child>RW2</child>
    <pose frame=''>0 0 -0.015 0 -0 0</pose>
    <axis>
      <xyz>0 1 0</xyz>
      <use_parent_model_frame>0</use_parent_model_frame>
      <limit>
        <lower>-1</lower>
        <upper>1</upper>
        <velocity>100</velocity>
      </limit>
    </axis>
  </joint>
edit retag flag offensive close merge delete

Comments

1

Hi, just a technical note. I have formatted your question so that the code showed in distinct boxes. You have correctly added the spaces in front of every line of the first block, but you also need to add an empty line above the first line of code. The second block of code started with only 2 spaces from the left. You need at least 4. You can mark the whole code in your answer and click the "code" button in the top toolbar. This formats code right. code-button

kumpakri gravatar imagekumpakri ( 2019-11-28 03:29:59 -0600 )edit

Now about the question. In my experience ineria and mass of 0 should not even allow you to load the robot in the simulator. I am of the believe that this cannot exist. You need to put some mass and ineria to every link. And it cannot be too small either because that would cause instabilities in the computations. Divide the mass among all three links somehow. Either the same mass or put majority on the top, but leave enough mass for the dummy links.

kumpakri gravatar imagekumpakri ( 2019-11-28 03:35:54 -0600 )edit

Hi, thank you for your response. I was able to set a small mass and inertia to my links and run it. Thank you ery much for your support!

Suyash gravatar imageSuyash ( 2019-11-30 10:52:00 -0600 )edit