ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Not able to simulate multiple joints

asked 2022-01-18 10:09:03 -0600

SHURIMA gravatar image

updated 2022-01-18 18:49:06 -0600

I've been trying to simulate a robotic arm in gazebo and my code works for the first 2 joints but somehow does not work when I add a third. I've tried copying the code for my first joint and just modifying values but it still does not work. Any idea why this is happening? This is the error that i get:

Error: unnamed joint found at line 345 in /build/urdfdom-YMMa9X/urdfdom-1.0.0/urdf_parser/src/joint.cpp Error: joint xml is not initialized correctly at line 206 in /build/urdfdom-YMMa9X/urdfdom-1.0.0/urdf_parser/src/model.cpp

Here is my code (works if arm_link_2 and arm_joint_2 are removed):

<?xml version='1.0'?>
<robot name='arm' xmlns:xacro='http://www.ros.org/wiki/xacro'>

  <xacro:property name="base_l" value="1"/>
  <xacro:property name="base_b" value="1"/>
  <xacro:property name="base_h" value="0.1"/>

  <xacro:property name="blink_l" value="0.1"/>
  <xacro:property name="blink_b" value="0.1"/>
  <xacro:property name="blink_h" value="0.5"/>

  <xacro:property name="link_l" value="0.5"/>
  <xacro:property name="link_b" value="0.1"/>
  <xacro:property name="link_h" value="0.1"/>

  <xacro:property name="joint_thickness" value="0.1"/>


  <!--arm_link_1-->
  <link name="arm_link_1">
    <pose>0 0 0 0 0 0</pose>
    <inertial>
      <mass value="1.1"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia
        ixx = '0.011'
        ixy = '0'
        ixz = '0'
        iyy = '0.0225'
        iyz = '0'
        izz = '0.0135'
        />
    </inertial>

    <visual name='arm_link_1_visual'>
      <origin rpy="0 0 0" xyz="${link_l/2-joint_thickness*0.5} 0 0"/>
      <geometry>
        <box size="${link_l} ${link_b} ${link_h}"/>
      </geometry>
    </visual>

    <collision name='arm_link_1_collision'>
      <origin rpy="0 0 0" xyz="${link_l+link_l/2} 0 0"/>
      <geometry>
        <box size="${link_l-joint_thickness} ${link_b-joint_thickness} ${link_h}"/>
      </geometry>
    </collision>
  </link>

  <joint name="arm_joint_1" type="revolute">
    <origin xyz="0 0 ${base_h+blink_h-1.5*link_h}"/>
    <axis xyz="0 -1 0"/>
    <parent link="blink"/>
    <child link="arm_link_1"/>
    <dynamics damping="0.7"/>
    <limit effort="10" velocity="1.0" lower="0" upper="100" />
  </joint>



  <!--arm_link_2-->
  <link name="arm_link_2">
    <pose>0 0 0 0 0 0</pose>
    <inertial>
      <mass value="1.1"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia
        ixx = '0.011'
        ixy = '0'
        ixz = '0'
        iyy = '0.0225'
        iyz = '0'
        izz = '0.0135'
        />
    </inertial>

    <visual name='arm_link_2_visual'>
      <origin rpy="0 0 0" xyz="${link_l/2-joint_thickness*0.5} 0 0"/>
      <geometry>
        <box size="${link_l} ${link_b} ${link_h}"/>
      </geometry>
    </visual>

    <collision name='arm_link_2_collision'>
      <origin rpy="0 0 0" xyz="${link_l+link_l/2} 0 0"/>
      <geometry>
        <box size="${link_l-joint_thickness} ${link_b-joint_thickness} ${link_h}"/>
      </geometry>
    </collision>
  </link>

  <joint name="arm_joint_2" type="revolute">
    <origin xyz="${link_l} 0 ${base_h+blink_h-1.5*link_h}"/>
    <axis xyz="0 -1 0"/>
    <parent link="arm_link_1"/>
    <child link="arm_link_2"/>
    <dynamics damping="0.7"/>
    <limit effort ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-01-19 02:21:35 -0600

gvdhoorn gravatar image
  <joint>
    <joint name="z_axis_rev" type="revolute"/>
    [..]
  </joint>

you have a joint inside a joint.

The outer joint also doesn't have any of the required attributes.

There is no name, nor type. Hence the error message:

Error: unnamed joint found at line 345 in /build/urdfdom-YMMa9X/urdfdom-1.0.0/urdf_parser/src/joint.cpp
edit flag offensive delete link more

Comments

ok thank you!

SHURIMA gravatar image SHURIMA  ( 2022-01-19 09:09:49 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-01-18 10:09:03 -0600

Seen: 131 times

Last updated: Jan 19 '22