what should be the fixed frame? if we select our base link of our robot then we get a werid output

asked 2017-03-17 01:20:00 -0500

ajayguhan gravatar image

we wrote the URDF and lauch file to visualize the robot in rviz but if we select our base link(or any link) we get weird output as below:

image description

before selecting fixed frame our model is fine as shown below:

image description

our URDF is:

<?xml version="1.0"?>
<robot name="cham_bot">

 <link name="z_axis">
    <visual>
        <geometry>
            <box size="0.2 0.2 6.5"/>

        </geometry>
        <origin rpy="0 0 0" xyz="0.25 0 7"/>
        <material name="green">
            <color rgba="1 0 0 1"/>

        </material>
    </visual>
    <collision>
        <geometry>
                <box size="0.2 0.2 6.5"/>
        </geometry>
            <origin rpy="0 0 0" xyz="0.25 0 7"/> 
    </collision> 
 </link>

 <link name="cross_slide">
    <visual>
        <geometry>
            <box size="0.05 1.7 1.5"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0.125 0 8"/>
        <material name="green">
            <color rgba="1 0 0 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
                <box size="0.05 1.7 1.5"/>
        </geometry>
            <origin rpy="0 0 0" xyz="0.125 0 8"/>
    </collision> 
 </link>

 <joint name="z_axis_to_cross_slide" type="prismatic">
    <parent link="z_axis"/>
    <child link="cross_slide"/>
    <limit effort="1000.0" lower="-0.38" upper="0" velocity="0.5"/> <!--specify exact values -->
    <origin xyz="-0.127 8 3.9"/>
    <axis xyz="0 0 1"/>
 </joint>

 <link name="beam">
    <visual>
        <geometry>
            <box size="0.2 8.5 0.6"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 0 8"/>
        <material name="yellow">
            <color rgba="1 1 0 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
                <box size="0.2 8.5 0.6"/>
        </geometry>
            <origin rpy="0 0 0" xyz="0 0 8"/>
    </collision> 
 </link>

 <joint name="cross_slide_to_beam" type="prismatic">
    <parent link="cross_slide"/>
    <child link="beam"/>
    <limit effort="1000.0" lower="-0.38" upper="0" velocity="0.5"/> <!--specify exact values -->
    <origin xyz="-0.125 8 3.9"/>
    <axis xyz="0 0 1"/>
 </joint>

 <link name="beam_bracket_1">
    <visual>
        <geometry>
            <box size="0.25 0.5 0.7"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 3.9 8"/>
        <material name="yellow">
            <color rgba="1 1 0 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
                <box size="0.25 0.5 0.7"/>
        </geometry>
            <origin rpy="0 0 0" xyz="0 3.9 8"/>
    </collision> 
 </link>

 <link name="beam_bracket_2">
    <visual>
        <geometry>
            <box size="0.25 0.5 0.7"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 -3.9 8"/>
        <material name="yellow">
            <color rgba="1 1 0 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
                <box size="0.25 0.5 0.7"/>
        </geometry>
            <origin rpy="0 0 0" xyz="0 -3.9 8"/>
    </collision> 
 </link>

 <joint name="beam_to_beam_bracket_1" type="fixed">
    <parent link="beam"/>
    <child link="beam_bracket_1"/>
    <origin xyz="0.10 8 -3.9"/>
    <axis xyz="0 0 0"/>
 </joint>

 <joint name="beam_to_beam_bracket_2" type="fixed">
    <parent link="beam"/>
    <child link="beam_bracket_2"/>
    <origin xyz="0.10 8 3.9"/>
    <axis xyz="0 0 0"/>
 </joint>

 <link name="beam_bracket_plate_1">
    <visual>
        <geometry>
            <box size="3.75 0.7 0.05"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 3.9 7.625"/>
        <material name="yellow">
            <color rgba="1 1 0 1"/>
        </material>
    </visual ...
(more)
edit retag flag offensive close merge delete

Comments

1

I'm not sure, but could it be that you have all your origins relative to a shared 'world origin'? In URDF, origins are relative to the parent frame in which they are defined. Might be something to check.

gvdhoorn gravatar image gvdhoorn  ( 2017-03-17 05:18:06 -0500 )edit

Each link has an associated tf frame, so adding a TF view in rviz will show you if your TF frames are in the right place and the models are mis-aligned with respect to those frames, or if the models are aligned correctly and the TF frames are in the wrong places.

ahendrix gravatar image ahendrix  ( 2017-03-17 11:53:55 -0500 )edit