<visual> element

Elements

  • <origin>

    • Attributes:

      • xyz (required)

        • x,y,z offset of visual element origin from link origin in the link reference frame

        rpy

        • roll,pitch,yaw orientation offset of the visual element origin in the link reference frame. Angles are (always) in radians.

    <geometry> (required)

    • Visual geometry. The <geometry> element may only contain one sub-element.

      Elements:

      • <box>

        <cylinder>

        <sphere>

        <mesh>

        • A trimesh element

          Attributes:

          • filename (required)

            • mesh object file used to represent a geometry. The local coordinate system of the mesh is given by the local coordinate system of the visual object encapsulating it.

            scale

            • Scales the mesh.

            size

            • Sets the size of the mesh axis-aligned-bounding-box.

        <material>

        • Materials/textures definition

          Attributes:

          • name (required)

            • name of the material element

          Elements:

          • <color>

            • color specification of the visual element

              Attributes:

              • rgb

                • RGB value of the visual element

                alpha

                • transparency of the visual element
          • <texture>

            • color of the visual element

              Attributes:

              • filename

                • optional RGB value of the visual element

Example

   1 <!-- specifies resource location of the mesh file -->
   2 <resource type="stl_meshes" location="/home/pr2/meshes"/>
   3 <link name="base_link">
   4   <visual>
   5         <!-- location defined with respect to the link origin in a local coordinate frame -->
   6         <!-- All angles always in radians, yaw about Z axis, pitch about the Y axis and roll about the X axis -->
   7         <origin xyz="0 0 0" rpy="0 0 0 " />
   8 
   9         <!-- using a trimesh for visualization -->
  10         <geometry>
  11           <!-- trimesh file with full path "/home/pr2/meshes/base.stlb" -->
  12           <!-- trimesh is specified in millimeters, scale it by 1/1000 to get size in meters -->
  13           <mesh filename="base.stlb" scale="0.001 0.001 0.001" />
  14         </geometry>
  15         <material name="my_color">
  16       <color rgb="255 255 255" alpha="0.5"/>
  17     </material>
  18   </visual>
  19 
  20   ... inertial/joint/collision ...
  21 
  22 </link>

As an option, the material element itself can be defined in place or elsewhere in the file. If the material element is defined elsewhere in the file, a reference to the material element with the correct name attribute must be present here.

Wiki: urdf/XML/visual (last edited 2009-09-30 08:23:22 by KenConley)