Display Images on Cube Faces

asked 2018-05-01 02:44:52 -0500

GuillaumeHauss gravatar image

updated 2018-05-01 12:20:45 -0500

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
            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'>
                    <size>0.3 0.3 1e-05</size>
       <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'>
     <pose frame=''>0 0 0 0 0 0</pose>
   <collision name='collision'>
     <pose frame=''>0 0 0 0 0 0</pose>
            <size>0.3 0.3 1e-05</size>
edit retag flag offensive close merge delete


Would you mind posting the model/materials for the aruco marker? Is this using an ogre material, or a material from a collada file, or something else?

sloretz gravatar imagesloretz ( 2018-05-01 11:58:43 -0500 )edit

If using an Ogre material, I think that having the plane along the XZ (or YZ) plane instead of the XY plane as shown on the screenshots may solve the issue. Take a look at the `Textured shapes` model for an example.

chapulina gravatar imagechapulina ( 2018-05-01 12:16:52 -0500 )edit