Gazebo | Ignition | Community
Ask Your Question
0

Manipulator arm in gazebo goes bonkers and keeps spinning whenever I include gazebo_ros2_controller in urdf.

asked 2023-06-05 05:45:42 -0500

aki1608 gravatar image

Hello everyone,

I am working with "ros2 (humble)" and trying to simulate open_manipulator arm in Gazebo. I can spawn it in gazebo, but when I include "gazebo_ros2_controller", it keeps moving everywhere like shown in this photo. C:\fakepath\No_world_joint-min.png. It keeps rotating. Sometimes it flies in the air as well. I tried introducing a fixed joint (I thought it might stop rotating if I do so). When I did that, as you can see in the screenshot, the base link stays fixed to ground, other links start flying.C:\fakepath\Fixed_world_joint-min.png. I dont know if this the problem related to gazebo or I am giving some false input. The URDF file that I am using:

Link and Joints part of URDF:

<?xml version="1.0"?>
<!-- Open_Manipulator Chain -->
<!-- <robot xmlns:xacro="http://ros.org/wiki/xacro"> -->
<robot name="open_manipulator" xmlns:xacro="http://ros.org/wiki/xacro">

  <!-- Link 1 -->
  <link name="link1">
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <mesh filename="file://$(find open_manipulator_wv_moveit_config)/meshes/chain_link1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="grey"/>
    </visual>

    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <mesh filename="file://$(find open_manipulator_wv_moveit_config)/meshes/chain_link1.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>

    <inertial>
      <origin xyz="3.0876154e-04 0.0000000e+00 -1.2176461e-04" />
      <mass value="7.9119962e-02" />
      <inertia ixx="1.2505234e-05" ixy="0.0" ixz="-1.7855208e-07"
               iyy="2.1898364e-05" iyz="0.0"
               izz="1.9267361e-05" />
    </inertial>
  </link>

  <!-- Joint 1 -->
  <joint name="joint1" type="revolute">
    <parent link="link1"/>
    <child link="link2"/>
    <origin xyz="0.012 0.0 0.017" rpy="0 0 0"/>
    <axis xyz="0 0 1"/>
    <limit velocity="4.8" effort="1" lower="${-pi*0.9}" upper="${pi*0.9}" />
  </joint>

  <!--  Link 2 -->
  <link name="link2">
    <visual>
      <origin xyz="0 0 0.019" rpy="0 0 0"/>
      <geometry>
        <mesh filename="file://$(find open_manipulator_wv_moveit_config)/meshes/chain_link2.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="grey"/>
    </visual>

    <collision>
      <origin xyz="0 0 0.019" rpy="0 0 0"/>
      <geometry>
        <mesh filename="file://$(find open_manipulator_wv_moveit_config)/meshes/chain_link2.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>

    <inertial>
      <origin xyz="-3.0184870e-04 5.4043684e-04 ${0.018 + 2.9433464e-02}" />
      <mass value="9.8406837e-02" />
      <inertia ixx="3.4543422e-05" ixy="-1.6031095e-08" ixz="-3.8375155e-07"
               iyy="3.2689329e-05" iyz="2.8511935e-08"
               izz="1.8850320e-05" />
    </inertial>
  </link>

  <!--  Joint 2 -->
  <joint name="joint2" type="revolute">
    <parent link="link2"/>
    <child link="link3"/>
    <origin xyz="0.0 0.0 0.0595" rpy="0 0 0"/>
    <axis xyz="0 1 0"/>
    <limit velocity="4.8" effort="1" lower="${-pi*0.57}" upper="${pi*0.5}" />
  </joint>

  <!--  Link 3 -->
  <link name="link3">
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <mesh filename="file://$(find open_manipulator_wv_moveit_config)/meshes/chain_link3.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="grey"/>
    </visual>

    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <mesh filename="file://$(find open_manipulator_wv_moveit_config)/meshes/chain_link3.stl" scale="0.001 0.001 0.001 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-13 08:13:33 -0500

aki1608 gravatar image

I found the solution. I had to include damping and friction value to all of my joints under <dynamics> tag. As shown here

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-06-05 05:45:42 -0500

Seen: 286 times

Last updated: Jun 13 '23