Robotics StackExchange | Archived questions

Virtual Joint/World Joint not working with Gazebo

Hello friends,

I am unsure of where this post belongs as I posted something similar in the ROS Answers and did not get much attention that side.

I am attempting to correctly fix my gazebo model to the empty world as I have seen in so many tutorials (like this one), but am struggling...a lot.

My GitHub for the project can be found here...where I am attempting to launch demo_gazebo.launch but get a similar behavior as this previously asked question: 22078.

I have attempted both the solutions there with no luck.

The URDF being utilized is here.

I have tried several iterations with and without the "world" link (truncated URDF):

    <?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from arm.xacro                      | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="arm" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <!-- base_link -->
  <gazebo reference="base_link">
  </gazebo>
  <!-- plat_link -->
  <gazebo reference="plat_link">
  </gazebo>
  <!-- lock_link -->
  <gazebo reference="lock_link">
  </gazebo>
  <!-- shoulder_link -->
  <gazebo reference="shoulder_link">
  </gazebo>
  <!-- forearm_link -->
  <gazebo reference="forearm_link">
  </gazebo>
  <!-- wrist_link -->
  <gazebo reference="wrist_link">
  </gazebo>
  <create/>
  <gazebo>
    <plugin filename="libgazebo_ros_control.so" name="gazebo_ros_control">
      <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
      <legacyModeNS>true</legacyModeNS>
    </plugin>
  </gazebo>

  <!--World Link-->
  <link name="world"/>
  <!-- World Joint -->
  <joint name="world_joint" type="fixed">
    <parent link="world"/>
    <child link="base_link"/>
  </joint>

  <!--Base Link-->
  <link name="base_link">
    <inertial>
      <mass value="1.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx="0.00153508333333" ixy="0" ixz="0" iyy="0.00153508333333" iyz="0" izz="0.00245"/>
    </inertial>
    <collision>....................................................

I realize this is probably a one line quick fix but I am so stumped and I really want my custom 4 DOF shakin' before June!

Any time you fine people can give is greatly appreciated.

m

Asked by matthewmarkey on 2020-05-19 03:56:35 UTC

Comments

Answers

Hi,

Adding these lines at the end of the URDF should be enough

  <link name="world"/>
  <joint name="world_joint" type="fixed">
     <parent link="world"/>
     <child link="dummy_link"/>
  </joint>

Asked by ahcorde on 2020-05-19 09:48:43 UTC

Comments

Hey @ahcorde, thank you for checking out my question, I appreciate your time.

In my quest to solve this, I have tried your suggestion as well. I have updated the URDF and the SRDF in my project in a form that I feel should be the solution.

When this is run, the arm acts erratically in both Gazebo and Rviz/Moveit.

Asked by matthewmarkey on 2020-05-20 06:32:44 UTC

Whenever I use the lines of code you have suggested, my model moves very quickly in many different directions.

Asked by matthewmarkey on 2020-05-20 06:35:24 UTC