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

The xacro files don't seem to work with each other. (ubuntu 20.04 noetic) R [closed]

asked 2023-03-10 05:50:28 -0500

jaeeunkim gravatar image

updated 2023-06-18 10:24:33 -0500

lucasw gravatar image

Hello, everyone!

An error occurred while configuring the robot arm as an xacro file. The current simple model looks like this:

<?xml version="1.0" ?>

<robot name="manipulator" xmlns:xacro="http://www.ros.org/wiki/xacro">

   <!-- Begin include -->
   <xacro:include filename="$(find manipulator_description)/urdf/links_joints.xacro" />
   <!-- END include -->

   <!--Begin robot description -->
   <link_n_box name="base_link"
               origin_rpy="0 0 0" origin_xyz="0 0 0"
               size="1 1 1" />

   <joint name="joint_01" type="revolute">
    <axis xyz="0 1 0"/>
    <limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
    <origin rpy="0 0 0" xyz="0 0 0.5"/>
    <parent link="base_link"/>
    <child link="link_01"/>    
  </joint>  

   <link name="link_01">
         <visual>
           <origin rpy="0 0 0" xyz="0 0 0.2" />
           <geometry>
               <cylinder radius="0.35" length="0.4"/>
           </geometry>
         </visual>
   </link>

  <joint name="joint_02" type="revolute">
    <axis xyz="0 1 0"/>
    <limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
    <origin rpy="0 0 0" xyz="0 0 0.4"/>
    <parent link="link_01"/>
    <child link="link_02"/>    
  </joint>   

   <link name="link_02">
         <visual>
           <origin rpy="0 0 0" xyz="0 0 0.4" />
           <geometry>
               <cylinder radius="0.15" length="0.8"/>
           </geometry>
         </visual>
   </link>   

  <joint name="joint_03" type="revolute">
    <axis xyz="0 1 0"/>
    <limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
    <origin rpy="0 0 0" xyz="0 0 0.8"/>
    <parent link="link_02"/>
    <child link="link_03"/>    
  </joint>   

   <link name="link_03">
         <visual>
           <origin rpy="0 0 0" xyz="0 0 0.4" />
           <geometry>
               <cylinder radius="0.15" length="0.8"/>
           </geometry>
         </visual>
   </link> 

  <joint name="joint_04" type="revolute">
    <axis xyz="0 1 0"/>
    <limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
    <origin rpy="0 0 0" xyz="0 0 0.8"/>
    <parent link="link_03"/>
    <child link="link_04"/>    
  </joint>   

   <link name="link_04">
         <visual>
           <origin rpy="0 0 0" xyz="0 0 0.4" />
           <geometry>
               <cylinder radius="0.15" length="0.8"/>
           </geometry>
         </visual>
   </link>

  <joint name="joint_05" type="revolute">
    <axis xyz="0 0 1"/>
    <limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
    <origin rpy="0 0 0" xyz="0 0 0.8"/>
    <parent link="link_04"/>
    <child link="link_05"/>    
      </joint>

       <link name="link_05">
             <visual>
               <origin rpy="0 0 0" xyz="0 0 0.125" />
               <geometry>
                   <cylinder radius="0.15" length="0.25"/>
               </geometry>
             </visual>
       </link>
       <!--END robot description -->

    </robot>

The macro files to be linked are as follows:

<?xml version="1.0" ?>
<robot name="manipulator" xmlns:xacro="http://www.ros.org/wiki/xacro ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by jaeeunkim
close date 2023-03-11 23:39:23.632985

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-03-10 15:15:35 -0500

Mike Scheutzow gravatar image

updated 2023-03-10 15:20:03 -0500

<link_n_box name="base_link" origin_rpy="0 0 0" origin_xyz="0 0 0" size="1 1 1" />

You are not using the correct synax to create an instance of a macro. The correct way is:

<xacro:link_n_box name=... />

Edit: I think this syntax change happened quite a few years ago.

edit flag offensive delete link more

Comments

It was a very basic part. Thank you. That was the best answer. Thank you very much.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

jaeeunkim gravatar image jaeeunkim  ( 2023-03-11 23:39:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-03-10 05:50:28 -0500

Seen: 52 times

Last updated: Mar 10 '23