Ask Your Question

Why does my robot model fall in Gazebo? [closed]

asked 2018-02-15 00:58:38 -0500

dpakshimpo gravatar image

updated 2018-02-15 01:03:55 -0500

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="" 

<!--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"/>
        <box size="${base_box_length} ${base_box_width} ${base_box_height}"/>
    <visual name="rosbot_visual">
      <origin rpy="0  0  0" xyz="0  0  0"/>
        <box size="${base_box_length} ${base_box_width} ${base_box_height}"/>
      <material name="blue"/>

<!-- base_link and its fixed joint -->
<joint name="joint_fix" type="fixed">
    <parent link="base_link"/>
    <child link="rosbot_base"/>

<!-- 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}"/>
        <cylinder length="${swivel_arm_length}" radius="${swivel_arm_radius}"/>
    <visual name="rosbot_visual">
      <origin rpy="0  0  0" xyz="0   0  ${swivel_arm_length/2}"/>
        <cylinder length="${swivel_arm_length}" radius="${swivel_arm_radius}"/>
      <material name="white"/>

<!-- 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"/>

<!-- 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}"/>
        <cylinder length="${arm_length}" radius="${arm_radius}"/> 
    <visual name="rosbot_visual">
      <origin rpy="0  0  0" xyz="0 ...
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by dpakshimpo
close date 2018-03-22 03:21:16.651587

1 Answer

Sort by ยป oldest newest most voted

answered 2018-02-15 02:07:08 -0500

F.Brosseau gravatar image

You can try to add some friction on your joint to make them resist the gravity force.

You may need to control your joint with a ros tool or a gazebo plugin to make them keep a particular position.

Maybe this will give you some hints :

edit flag offensive delete link more



Thank you sir. When I added damping and friction, the entire robot model seems to have collapsed onto its own and i can see only the base and one arm.

<dynamics damping="50" friction="1"/>
dpakshimpo gravatar image dpakshimpo  ( 2018-02-15 02:57:10 -0500 )edit

Hello F.Brosseau,

I reduced the damping value as below, then it is working :) thanks for your suggestion.

<xacro:property name="damping_value" value="10" />
<xacro:property name="friction_value" value="0.1" />
dpakshimpo gravatar image dpakshimpo  ( 2018-02-15 04:21:15 -0500 )edit

Question Tools

1 follower


Asked: 2018-02-15 00:58:38 -0500

Seen: 2,379 times

Last updated: Feb 15 '18