How to define the inertial parameters of tool0?
I followed the tutorial of creating URDF to build a industrial robot model. I defined link "tool0" as default so that it has no parameters at all and then attached it with a "fixed" joint to the robot. But when I attached another tool to the "tool0" frame and the tool had force interaction with the environment, it failed like this
I pegged a long and thin gun into a tube and tried to lift it up. The gun and tube both had mass and inertia. The tool seemed to be detached from the flange but they were not actually seperated. I tried to modify the inertia matrix with a bigger value like 1e-1, it behaved as expected. So is this the key to my problem and how to properly define the inertial parameters including mass and inertia matrix of virtual link "tool0"?
EDIT1
My robot URDF is as follow:
<link name="link_1">...</link>
...
<link name="link_6">...</link>
<link name="tool0"/> <---where I modified later
<joint name="joint_1" type="revolute">...</joint>
....
<joint name="joint_6" type="revolute">...</joint>
<joint name="link_6-tool0" type="fixed">
<parent link="link_6"/>
<child link="tool0"/>
<origin xyz="0.037 0 0" rpy="0 0 0"/>
</joint>
In another URDF I define the sensor-related parts:
<link name="sensor_link">...</link>
<joint name="sensor_joint" type="fixed">
<parent link="tool0"/>
<child link="sensor_link"/>
<origin xyz="0 0 0" rpy="0 0 0"/>
</joint>
<gazebo reference="sensor_joint">
<provideFeedback>true</provideFeedback>
<disableFixedJointLumping>true</disableFixedJointLumping>
</gazebo>
<gazebo>
<plugin name="FTsensor_controller" filename="libgazebo_ros_ft_sensor.so">
<updateRate>100.0</updateRate>
<topicName>/usr/sensor_topic</topicName>
<jointName>sensor_joint</jointName>
</plugin>
</gazebo>
Then I include two URDF(actually XACRO) in a new one to put them together.
So, if tool0 doesn't have a body and is fixed to link6, what's the point in having it? Why not just attach your sensor link directly to link6?