Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Display Images on Cube Faces

Hi all, I'm using Aruco markers to localize my robot in its environment. I've set up models for each aruco marker, and use a PNG file as texture.

However, it seems there is a "bug" in the display. When looking forward to the aruco, the image is displayed correctly. (see first image). And when I go behind the marker, the image is inverted, like a central symmetry (see second image).

Why is that? Do I need to specify the texture for each face of the cube in the aruco model? If yes, how do I do that?

Thank you very much for your help !

First image image description

Second image image description

Display Images on Cube Faces

Hi all, I'm using Aruco markers to localize my robot in its environment. I've set up models for each aruco marker, and use a PNG file as texture.

However, it seems there is a "bug" in the display. When looking forward to the aruco, the image is displayed correctly. (see first image). And when I go behind the marker, the image is inverted, like a central symmetry (see second image).

Why is that? Do I need to specify the texture for each face of the cube in the aruco model? If yes, how do I do that?

Thank you very much for your help !

First image image description

Second image image description

EDIT Here is my material file

material ArucoVisualMarker0/Marker
{
    technique
    {
    pass
    {
        texture_unit
        {
            texture aruco_mark_0.png
        }
    }
    }
}

and here is my model.sdf file.

<?xml version='1.0'?>
<sdf version='1.5'>
    <model name='aruco_visual_marker_0'>
     <pose>0 0 0 0 0 0</pose>
         <link name='marker'>
     <pose frame=''>0 0 0 0 0 3.14</pose>
      <visual name='visual'>
          <geometry>
               <box>
                    <size>0.3 0.3 1e-05</size>
               </box>
          </geometry>
          <material>
              <script>
                  <uri>model://aruco_visual_marker_0/materials/scripts</uri>
                  <uri>model://aruco_visual_marker_0/materials/textures</uri>
                  <name>ArucoVisualMarker0/Marker</name>
              </script>
       <a mbient>1 1 1 1</ambient>
       <diffuse>1 1 1 1</diffuse>
       <specular>0 0 0 1</specular>
       <emissive>1 1 1 0</emissive>
       <shader type='vertex'>
         <normal_map>__default__</normal_map>
       </shader>
     </material>
     <pose frame=''>0 0 0 0 0 0</pose>
     <cast_shadows>1</cast_shadows>
     <transparency>0</transparency>
   </visual>
   <collision name='collision'>
     <laser_retro>0</laser_retro>
     <max_contacts>10</max_contacts>
     <pose frame=''>0 0 0 0 0 0</pose>
         <geometry>
           <box>
            <size>0.3 0.3 1e-05</size>
          </box>
        </geometry>
        </collision>
     </link>
     <static>1</static>
     <allow_auto_disable>1</allow_auto_disable>
   </model>
  </sdf>