how to add a laser by use erratic_description package

asked 2016-03-18 22:25:33 -0600

littlestar gravatar image

updated 2016-03-19 10:45:12 -0600

I use the book example to try, but it always wrong. The code is

<robot xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor" xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller" xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" name="robot1_xacro">

<include filename="$(find erratic_description)/urdf/erratic_hokuyo_laser.xacro" />

    <!-- BASE LASER ATTACHMENT -->
    <erratic_hokuyo_laser parent="base_link">
            <origin xyz="0.18 0 0.11" rpy="0 0 0" />
    </erratic_hokuyo_laser>


<xacro:property name="length_wheel" value="0.05" />
<xacro:property name="radius_wheel" value="0.05" />
<xacro:macro name="default_inertial" params="mass">
           <inertial>
                   <mass value="${mass}" />
                   <inertia ixx="1.0" ixy="0.0" ixz="0.0"
                            iyy="1.0" iyz="0.0"
                            izz="1.0" />
           </inertial>
</xacro:macro>

<link name="base_footprint">
    <visual>
        <geometry>
                <box size="0.001 0.001 0.001"/>
            </geometry>
        <origin rpy="0 0 0" xyz="0 0 0"/>
    </visual>
    <xacro:default_inertial mass="0.0001"/>
</link>

<gazebo reference="base_footprint">
    <material>Gazebo/Green</material>
    <turnGravityOff>false</turnGravityOff>
</gazebo>

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


<link name="base_link">
    <visual>
        <geometry>
                <box size="0.2 .3 .1"/>
            </geometry>
        <origin rpy="0 0 1.54" xyz="0 0 0.05"/>
        <material name="white">
            <color rgba="1 1 1 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
                <box size="0.2 .3 0.1"/>
        </geometry>
    </collision>
    <xacro:default_inertial mass="10"/>
</link>

<link name="wheel_1">
    <visual>
            <geometry>
                <cylinder length="${length_wheel}" radius="${radius_wheel}"/>
            </geometry>
        <!-- <origin rpy="0 1.5 0" xyz="0.1 0.1 0"/> -->
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name="black">
            <color rgba="0 0 0 1"/>
        </material>
    </visual>
    <collision>
        <geometry>
                <cylinder length="${length_wheel}" radius="${radius_wheel}"/>
        </geometry>
    </collision>
    <xacro:default_inertial mass="1"/>
</link>

<link name="wheel_2">
    <visual>
            <geometry>
                <cylinder length="${length_wheel}" radius="${radius_wheel}"/>
            </geometry>
        <!-- <origin rpy="0 1.5 0" xyz="-0.1 0.1 0"/> -->
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name="black"/>
    </visual>
    <collision>
        <geometry>
                <cylinder length="${length_wheel}" radius="${radius_wheel}"/>
        </geometry>
    </collision>
    <xacro:default_inertial mass="1"/>

</link>

<link name="wheel_3">
    <visual>
            <geometry>
                <cylinder length="${length_wheel}" radius="${radius_wheel}"/>
            </geometry>
        <!-- <origin rpy="0 1.5 0" xyz="0.1 -0.1 0"/> -->

        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name="black"/>
    </visual>
    <collision>
        <geometry>
                <cylinder length="${length_wheel}" radius="${radius_wheel}"/>
        </geometry>
    </collision>
    <xacro:default_inertial mass="1"/>
</link>

<link name="wheel_4">
    <visual>
            <geometry>
                <cylinder length="${length_wheel}" radius="${radius_wheel}"/>
            </geometry>
    <!--    <origin rpy="0 1.5 0" xyz="-0.1 -0.1 0"/> -->
        <origin rpy="0 0 0" xyz="0 0 0" />
        <material name="black"/>
    </visual>
    <collision>
        <geometry>
                <cylinder length="${length_wheel}" radius="${radius_wheel}"/>
        </geometry>
    </collision>
    <xacro:default_inertial mass="1"/>

</link>

<joint name="base_to_wheel1" type="continuous"> <parent link="base_link"/> <child link="wheel_1"/> <origin rpy="1.5707 0 0" xyz="0.1 0.15 0"/> <axis xyz="0 0 1"/> </joint>

<joint name="base_to_wheel2" type="continuous"> <axis xyz="0 0 1"/> <anchor xyz="0 0 0"/> <limit effort="100" velocity="100"/> <parent link="base_link"/> <child link="wheel_2"/> <origin rpy="1.5707 0 0" xyz ... (more)

edit retag flag offensive close merge delete