1
$\begingroup$

In my gazebo simulation my robot fails to maintain itself. It falls over in the spawn and starts to vibrate by itself. There were multiple terminal errors. While fixing these errors, I sometimes cause another problem:

The published robot description file (urdf) seems not to be genuine

I don't always get this error. Sometimes I do, sometimes I don't.

  • What causing my urdf file to be not genuine?
  • Why is my robot falling over spawn? I know that many reasons for this are not having proper controllers which I fixed it in my recent post with Gazebo_ros2_control library, not having proper damping and friction values, not having proper inertia values and not having a proper PID gains. If there are more reasons I want to know and how can I also add PID gains to my project. For now I will only add my urdf file but if you suspect from anything let me know.

My urdf file:

<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from octobot.xacro                  | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="octobot">
  <material name="silver">
    <color rgba="0.700 0.700 0.700 1.000"/>
  </material>
  <transmission name="doner12_tran">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="doner12">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="doner12_actr">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>10</mechanicalReduction>
    </actuator>
  </transmission>
  <transmission name="doner23_tran">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="doner23">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="doner23_actr">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>10</mechanicalReduction>
    </actuator>
  </transmission>
  <transmission name="doner34_tran">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="doner34">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="doner34_actr">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>10</mechanicalReduction>
    </actuator>
  </transmission>
  <transmission name="doner45_tran">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="doner45">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="doner45_actr">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>10</mechanicalReduction>
    </actuator>
  </transmission>
  <transmission name="doner56_tran">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="doner56">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="doner56_actr">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>10</mechanicalReduction>
    </actuator>
  </transmission>
  <transmission name="doner67_tran">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="doner67">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="doner67_actr">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>10</mechanicalReduction>
    </actuator>
  </transmission>
  <gazebo>
    <plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
      <parameters>/home/dogukanyilmaz/ws_octobot/src/cores/octobot_config/config/ros2_controllers.yaml</parameters>
    </plugin>
  </gazebo>
  <gazebo reference="base_link">
    <material>Gazebo/Silver</material>
    <mu1>0.2</mu1>
    <mu2>0.2</mu2>
    <self_collide>true</self_collide>
    <gravity>true</gravity>
  </gazebo>
  <gazebo reference="Motor2Gv_1">
    <material>Gazebo/Silver</material>
    <mu1>0.2</mu1>
    <mu2>0.2</mu2>
    <self_collide>true</self_collide>
  </gazebo>
  <gazebo reference="Motor3Gv_1">
    <material>Gazebo/Silver</material>
    <mu1>0.2</mu1>
    <mu2>0.2</mu2>
    <self_collide>true</self_collide>
  </gazebo>
  <gazebo reference="Motor4Gv_1">
    <material>Gazebo/Silver</material>
    <mu1>0.2</mu1>
    <mu2>0.2</mu2>
    <self_collide>true</self_collide>
  </gazebo>
  <gazebo reference="Motor5Gv_1">
    <material>Gazebo/Silver</material>
    <mu1>0.2</mu1>
    <mu2>0.2</mu2>
    <self_collide>true</self_collide>
  </gazebo>
  <gazebo reference="Motor6Gv_1">
    <material>Gazebo/Silver</material>
    <mu1>0.2</mu1>
    <mu2>0.2</mu2>
    <self_collide>true</self_collide>
  </gazebo>
  <gazebo reference="Motor7Gv_1">
    <material>Gazebo/Silver</material>
    <mu1>0.2</mu1>
    <mu2>0.2</mu2>
    <self_collide>true</self_collide>
  </gazebo>
  <link name="base_link">
    <inertial>
      <origin rpy="0 0 0" xyz="0.01104339129651807 -5.25334719245186e-08 0.09293988490750445"/>
      <mass value="17.613743236958385"/>
      <inertia ixx="0.087346" ixy="-0.0" ixz="0.000413" iyy="0.099484" iyz="0.0" izz="0.061677"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/base_link.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="silver"/>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/base_link.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="Motor2Gv_1">
    <inertial>
      <origin rpy="0 0 0" xyz="0.0073547207227992635 -5.7183835097550754e-08 0.13244866550568501"/>
      <mass value="14.13180132167806"/>
      <inertia ixx="0.05358" ixy="-0.0" ixz="-0.002639" iyy="0.052304" iyz="0.0" izz="0.029049"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="-0.0 -0.0 -0.174"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor2Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="silver"/>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0 -0.0 -0.174"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor2Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="Motor3Gv_1">
    <inertial>
      <origin rpy="0 0 0" xyz="-0.040302427728824475 -3.1776755710503087e-08 0.14852969258891868"/>
      <mass value="9.34356309497989"/>
      <inertia ixx="0.04708" ixy="0.0" ixz="0.012293" iyy="0.053199" iyz="-0.0" izz="0.020547"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="-0.059 0.0 -0.326"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor3Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="silver"/>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="-0.059 0.0 -0.326"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor3Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="Motor4Gv_1">
    <inertial>
      <origin rpy="0 0 0" xyz="-0.0030612425184283498 -3.0946477218760627e-06 0.1067843579424047"/>
      <mass value="8.873874448445003"/>
      <inertia ixx="0.023613" ixy="0.0" ixz="0.000801" iyy="0.023432" iyz="1e-06" izz="0.012203"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0.0 0.0 -0.5455"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor4Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="silver"/>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0.0 0.0 -0.5455"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor4Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="Motor5Gv_1">
    <inertial>
      <origin rpy="0 0 0" xyz="0.02928590541122761 2.9599701849593294e-05 0.14797355123897027"/>
      <mass value="9.684238619334375"/>
      <inertia ixx="0.049575" ixy="-7e-06" ixz="-0.012451" iyy="0.056529" iyz="-1.3e-05" izz="0.021122"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0.0495 5e-05 -0.6725"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor5Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="silver"/>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0.0495 5e-05 -0.6725"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor5Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="Motor6Gv_1">
    <inertial>
      <origin rpy="0 0 0" xyz="0.0011632770512901751 1.17570137097191e-06 0.09112293887057576"/>
      <mass value="6.164349978605796"/>
      <inertia ixx="0.013483" ixy="-1e-06" ixz="-0.000289" iyy="0.013993" iyz="-0.0" izz="0.00637"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0.0 -0.0 -0.8933"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor6Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="silver"/>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0.0 -0.0 -0.8933"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor6Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="Motor7Gv_1">
    <inertial>
      <origin rpy="0 0 0" xyz="-0.02716716791682726 -2.753113110725478e-05 0.09747913986651802"/>
      <mass value="5.870034266249876"/>
      <inertia ixx="0.014009" ixy="-3e-06" ixz="0.003344" iyy="0.016521" iyz="3e-06" izz="0.008501"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="-0.0435 -4.4e-05 -1.0093"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor7Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="silver"/>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0435 -4.4e-05 -1.0093"/>
      <geometry>
        <mesh filename="file:///home/dogukanyilmaz/ws_octobot/src/cores/octobot_description/meshes/Motor7Gv_1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="world"></link>
  <joint name="fixed" type="fixed">
    <parent link="world"/>
    <child link="base_link"/>
  </joint>
  <joint name="doner12" type="continuous">
    <origin rpy="0 0 0" xyz="0.0 0.0 0.174"/>
    <parent link="base_link"/>
    <child link="Motor2Gv_1"/>
    <dynamics damping="10.0" friction="10.0"/>
    <axis xyz="0.0 -0.0 -1.0"/>
  </joint>
  <joint name="doner23" type="continuous">
    <origin rpy="0 0 0" xyz="0.059 -0.0 0.152"/>
    <parent link="Motor2Gv_1"/>
    <child link="Motor3Gv_1"/>
    <dynamics damping="10.0" friction="10.0"/>
    <axis xyz="-1.0 0.0 0.0"/>
  </joint>
  <joint name="doner34" type="continuous">
    <origin rpy="0 0 0" xyz="-0.059 0.0 0.2195"/>
    <parent link="Motor3Gv_1"/>
    <child link="Motor4Gv_1"/>
    <dynamics damping="10.0" friction="10.0"/>
    <axis xyz="0.0 0.0 -1.0"/>
  </joint>
  <joint name="doner45" type="continuous">
    <origin rpy="0 0 0" xyz="-0.0495 -5e-05 0.127"/>
    <parent link="Motor4Gv_1"/>
    <child link="Motor5Gv_1"/>
    <dynamics damping="10.0" friction="10.0"/>
    <axis xyz="0.999999 0.001011 0.0"/>
  </joint>
  <joint name="doner56" type="continuous">
    <origin rpy="0 0 0" xyz="0.0495 5e-05 0.2208"/>
    <parent link="Motor5Gv_1"/>
    <child link="Motor6Gv_1"/>
    <dynamics damping="10.0" friction="10.0"/>
    <axis xyz="0.0 -0.0 -1.0"/>
  </joint>
  <joint name="doner67" type="continuous">
    <origin rpy="0 0 0" xyz="0.0435 4.4e-05 0.116"/>
    <parent link="Motor6Gv_1"/>
    <child link="Motor7Gv_1"/>
    <dynamics damping="10.0" friction="10.0"/>
    <axis xyz="-0.999999 -0.001011 0.0"/>
  </joint>
    <ros2_control name="GazeboSystem" type="system">
      <hardware>
        <plugin>gazebo_ros2_control/GazeboSystem</plugin>
      </hardware>
      <joint name="doner12">
        <command_interface name="position"/>
        <state_interface name="position">
          <param name="initial value">0.0</param>
        </state_interface>
        <state_interface name="velocity"/>
      </joint>
      <joint name="doner23">
        <command_interface name="position"/>
        <state_interface name="position">
          <param name="initial value">0.0</param>
        </state_interface>
        <state_interface name="velocity"/>
      </joint>
      <joint name="doner34">
        <command_interface name="position"/>
        <state_interface name="position">
          <param name="initial value">0.0</param>
        </state_interface>
        <state_interface name="velocity"/>
      </joint>
      <joint name="doner45">
        <command_interface name="position"/>
        <state_interface name="position">
          <param name="initial value">0.0</param>
        </state_interface>
        <state_interface name="velocity"/>
      </joint>
      <joint name="doner56">
        <command_interface name="position"/>
        <state_interface name="position">
          <param name="initial value">0.0</param>
        </state_interface>
        <state_interface name="velocity"/>
      </joint>
      <joint name="doner67">
        <command_interface name="position"/>
        <state_interface name="position">
          <param name="initial value">0.0</param>
        </state_interface>
        <state_interface name="velocity"/>
      </joint>
    </ros2_control>
</robot>
$\endgroup$
12
  • $\begingroup$ can you add the full log please? $\endgroup$ Commented May 14 at 12:34
  • $\begingroup$ and add also the ROS distro you are using $\endgroup$ Commented May 14 at 12:34
  • $\begingroup$ @ChristophFroehlich I am using iron, I stopped getting the error but falling problem continiues and according to this log, controllers do indeed properly load. Here is the full log: [link] (pastebin.com/eEUJy0vc) Edit: I fixed the link and paste issue $\endgroup$ Commented May 14 at 12:42
  • $\begingroup$ what do you mean by falling down? as if the motors have no power, or "exploding"? The latter is typical for wrong inertia/mass values. $\endgroup$ Commented May 14 at 12:52
  • $\begingroup$ joint_trajectory_controller should hold the position on activation. And you use position interface, this should be ideal in gazebo_ros2_control without the need for any PID tuning. $\endgroup$ Commented May 14 at 12:53

2 Answers 2

1
$\begingroup$

I have had a robot fall over when spawning because it was spawning in the ground. I am not sure that is the case here but making sure it spawns a centimeter above the ground has fixed this issue for me.

$\endgroup$
3
  • $\begingroup$ So should add something like this to my first link after dummy world link? ' <axis xyz="0.0 -0.0 0.01"/>' $\endgroup$ Commented May 14 at 13:04
  • $\begingroup$ I have always done it by doing this: gazebo_spawner = Node( package='gazebo_ros', executable='spawn_entity.py', output='screen', arguments=["-topic", "/robot_description", "-entity", "robot", '-z', LaunchConfiguration('z_pos')]) and DeclareLaunchArgument('z_pos', default_value='1.6'), $\endgroup$
    – McQueenPC
    Commented May 14 at 13:09
  • 1
    $\begingroup$ Solved the problem thanks for everything. I have a new error but atleast it worked :D $\endgroup$ Commented May 14 at 13:37
1
$\begingroup$
  • A robot might fall over if the controller could not be loaded properly.
  • The URDF error can happen if you have configured joints which are not included in your URDF, see the release notes here (only applies if you use Jazzy or Rolling).
  • gazebo_ros2_contol does not support transmissions, which you have added in your URDF.
$\endgroup$
5
  • $\begingroup$ Transmissions are auto-generated by ros2. I created this urdf file from xacro file which was obtained after the conversion from fusion. I commented the transmission part didnt not change anything. $\endgroup$ Commented May 14 at 12:51
  • $\begingroup$ ROS 2 does not auto-generate anything. You mean the moveit2 wizard? However, ros2_control does not use this information anyways, so it was expected to not change anything. $\endgroup$ Commented May 14 at 12:58
  • $\begingroup$ I used the command xacro model.xacro > model.urdf However you are right about the auto-generate. I am not sure what converts it. $\endgroup$ Commented May 14 at 13:05
  • $\begingroup$ xacro only does evaluate your xacro commands, but does not auto-add the transmissions. $\endgroup$ Commented May 14 at 13:08
  • $\begingroup$ Yes sorry what mean is that generated from this exporter: github.com/syuntoku14/fusion2urdf $\endgroup$ Commented May 14 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.