Why does my robot model fall in Gazebo? [closed]
Apologies for a very long post. I created the following xacro file, when I load in gazebo using the following launch file, the robot does not stand straight and falls down. I tried with different values of mass for different links, but no luck. It looks like I am missing something, can anyone help? I have removed the inertia calculation xacros for brevity.
<?xml version="1.0" ?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro"
xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
name="rosbot_v1">
<!--Physical attributes definition for base box-->
<xacro:property name="base_box_length" value="1" />
<xacro:property name="base_box_width" value="1" />
<xacro:property name="base_box_height" value="0.6" />
<xacro:property name="base_box_mass" value="4" />
<!--Physical attributes definition for the swivel arm-->
<xacro:property name="swivel_arm_length" value="0.2" />
<xacro:property name="swivel_arm_radius" value="0.2" />
<xacro:property name="swivel_arm_mass" value="1" />
<!--Physical attributes definition for the arms-->
<xacro:property name="arm_length" value="1" />
<xacro:property name="arm_radius" value="0.1" />
<xacro:property name="arm_mass" value="0.1" />
<!--Physical attributes definition for gripper box-->
<xacro:property name="gripper_box_length" value="0.5" />
<xacro:property name="gripper_box_width" value="0.4" />
<xacro:property name="gripper_box_height" value="0.2" />
<xacro:property name="gripper_box_mass" value="0.01" />
<!--Physical attributes definition for gripper fingers-->
<xacro:property name="gripper_finger_length" value="0.12" />
<xacro:property name="gripper_finger_width" value="0.4" />
<xacro:property name="gripper_finger_height" value="0.12" />
<xacro:property name="gripper_finger_mass" value="0.001" />
<!-- world link -->
<link name="base_link"/>
<link name="rosbot_base">
<xacro:inertial_matrix_cuboid mass="${base_box_mass}" box_length="${base_box_length}" box_width="${base_box_width}"/>
<collision name="rosbot_collision">
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<box size="${base_box_length} ${base_box_width} ${base_box_height}"/>
</geometry>
</collision>
<visual name="rosbot_visual">
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<box size="${base_box_length} ${base_box_width} ${base_box_height}"/>
</geometry>
<material name="blue"/>
</visual>
</link>
<!-- base_link and its fixed joint -->
<joint name="joint_fix" type="fixed">
<parent link="base_link"/>
<child link="rosbot_base"/>
</joint>
<!-- A swiveling base on which next arm will sit -->
<link name="rosbot_swivel_base">
<xacro:inertial_matrix_cylinder mass="${swivel_arm_mass}" arm_length="${swivel_arm_length}" arm_radius="${swivel_arm_radius}"/>
<collision name="rosbot_collision">
<origin rpy="0 0 0" xyz="0 0 ${swivel_arm_length/2}"/>
<geometry>
<cylinder length="${swivel_arm_length}" radius="${swivel_arm_radius}"/>
</geometry>
</collision>
<visual name="rosbot_visual">
<origin rpy="0 0 0" xyz="0 0 ${swivel_arm_length/2}"/>
<geometry>
<cylinder length="${swivel_arm_length}" radius="${swivel_arm_radius}"/>
</geometry>
<material name="white"/>
</visual>
</link>
<!-- The joint between swivel and base needs to be flush on the top face of rosbot_base -->
<joint name="rosbot_base_swivel_joint" type="revolute">
<parent link="rosbot_base"/>
<child link="rosbot_swivel_base"/>
<origin rpy="0 0 0" xyz="0 0 ${base_box_height/2}"/>
<axis xyz="0 0 1"/>
<limit effort="100" lower="-1.57" upper="1.57" velocity="100"/>
</joint>
<!-- A moving/manipulating arm1 -->
<link name="rosbot_arm1">
<xacro:inertial_matrix_cylinder mass="${arm_mass}" arm_length="${arm_length}" arm_radius="${arm_radius}"/>
<collision name="rosbot_collision">
<origin rpy="0 0 0" xyz="0 0 ${arm_length/2}"/>
<geometry>
<cylinder length="${arm_length}" radius="${arm_radius}"/>
</geometry>
</collision>
<visual name="rosbot_visual">
<origin rpy="0 0 0" xyz="0 ...