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

URDF is not displayed

asked 2019-05-06 03:28:49 -0500

EdwardNur gravatar image

I have a very simple URDF model of my robot and for some reason, I cannot display the model correctly: image description

Here is my definition of chassis.xacro:

<?xml version="1.0" ?>

<robot name="chassis" xmlns:xacro="http://ros.org/wiki/xacro">
    <xacro:property name="length" value="2" />
    <xacro:property name="width" value="1" />
    <xacro:property name="height" value="0.1" />
    <xacro:property name="mass" value="5" />
    <xacro:property name="radius" value="0.2" />
    <xacro:property name="wmass" value="0.2" />
    <xacro:property name="wwidth" value="0.2" />

    <!--xacro:macro name="chassis" params="position parent r1 r2 height"-->

    <xacro:include filename="$(find genius_description)/urdf/wheel.xacro"/>

        <link name="base_link">
            <visual>
                <origin xyz="0 0 0" rpy="0 0 0"/>
                <geometry>
                    <box size="${length} ${width} ${height}"/>
                </geometry>
            </visual>

            <collision>
                <origin xyz="0 0 0" rpy="0 0 0"/>
                <geometry>
                    <box size="${length} ${width} ${height}"/>
                </geometry>
            </collision>

            <inertial>
                <origin xyz="0 0 0" rpy="0 0 0"/>
                <mass value="${mass}"/>
                <inertia ixx="0 0 0" ixy="0 0 0" ixz="0 0 0"
                         iyy="0 0 0" iyz="0 0 0"
                         izz="0 0 0"/>
            </inertial>
        </link>

        <link name="base_footprint"/>

        <joint name="base_joint" type="fixed">
            <parent link="base_footprint"/>
            <child link="base_link"/>
            <origin xyz="0 0 0.2" rpy="0 0 0"/>
        </joint>

        <xacro:wheel position="tl"
               parent="base_link"
               X="0.5"
               Y="0.5"/>
        <xacro:wheel position="tr"
               parent="base_link"
               X="0.5"
               Y="-0.5"/>
        <xacro:wheel position="bl"
               parent="base_link"
               X="-0.5"
               Y="0.5"/>
        <xacro:wheel position="br"
               parent="base_link"
               X="-0.5"
               Y="-0.5"/>

</robot>

And wheel.xacro:

<?xml version="1.0" ?>

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


<xacro:macro name="wheel" params="position parent X Y">
    <!-- Wheel Link -->
    <link name="${position}_wheel">
        <visual>
            <origin xyz="0 0 0" rpy="${-pi/2} 0 0"/>
            <geometry>
                <cylinder length="${wwidth}" radius="${radius}"/>
            </geometry>
        </visual>

        <collision>
            <origin xyz="0 0 0" rpy="${-pi/2} 0 0"/>
            <geometry>
                <cylinder length="${wwidth}" radius="${radius}"/>
            </geometry>
        </collision>

        <inertial>
            <origin xyz="0 0 0" rpy="${-pi/2} 0 0"/>
            <mass value="${wmass}"/>
            <inertia ixx="${1/12*wmass*3*radius**2+1/12*wmass*wwidth**2}" ixy="0.0" ixz="0.0"
                     iyy="${1/12*wmass*3*radius**2+1/12*wmass*wwidth**2}" iyz="0.0" 
                     izz="${1/12*wmass*radius**2}"/>
        </inertial>
    </link>

    <!-- Wheel Joint -->
    <joint name="${position}_wheel_joint" type="continuous">
        <parent link="${parent}"/>
        <child link="${position}_wheel"/>
        <origin xyz="${X} ${Y} -${radius}" rpy="0 0 0"/>
        <axis xyz="0 1 0" rpy="0 0 0"/>
        <limit effort="64" velocity="2"/>
        <joint_properties damping="0.0" friction="0.0"/>
    </joint>


</xacro:macro>
</robot>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-05-06 03:52:35 -0500

gvdhoorn gravatar image

Please see whether this is #q312706 (and #q296227).

edit flag offensive delete link more

Comments

@gvdhoorn Yes it did, cheers

EdwardNur gravatar image EdwardNur  ( 2019-05-06 06:49:50 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-05-06 03:28:49 -0500

Seen: 465 times

Last updated: May 06 '19