Stereo Glasses


Introduction

This tutorial describes how to setup a machine and Gazebo for use with stereo glasses, such as those provided by Nvidia 3D Vision.

This tutorial assumes that you will be using Ubuntu.

Performance Note: Stencil shadows, as opposed to the default shadow maps, are used when stereo rendering is enabled. Stencil shadows utilize the CPU, which could affect your performance. Reducing the number of light sources in your world will help minimize the impact of the stencil shadows.

Hardware requirements

  1. A 3D ready monitor. This monitor should have a 120Hz refresh rate.

  2. An Nvida Quadro K4000 or better.

    Warning: Many Nvidia cards say they support 3D stereo. Such a statement may only be true when using Windows drivers. Make sure there is a 3pin VESA connector on the card, otherwise the card will not work in Linux.

    1. You can check your current graphics card with:

      lspci | grep VGA
      
  3. A complete Nvidia 3D Vision kit: glasses, emitter, sync cable, and usb cable.

Connections

  1. Make sure you are using either a display port or dual-dvi cable. This is needed to support the high refresh rates.

  2. Make sure the IR emitter is connected via both the USB and 3-pin VESA cables.

  3. Make sure the glasses are charged.

Sofware requirements

  1. Ubuntu 14.04 (Trusty).

  2. Nvidia drivers.

    sudo apt-get install nvidia-current
    
  3. Install libogre3d-1.9-dev.

    sudo apt-get install libogre3d-1.9-dev
    
  4. Install nvidia settings.

    sudo apt-get install nvidia-settings
    
  5. Gazebo compiled from source. You may use the Gazebo6 debians when they are made available on July 27, 2015.

  6. If you are using the Unity desktop environment, stereo probably won't work. Install Gnome Classic:

    sudo apt-get install gnome-session-fallback
    

Logout and click on the icon next to your username. Select "GNOME Classic (Metacity)" and log in.

Setup Nvidia Stereo

  1. Start nvidia-settings manager.

    nvidia-settings
    
  2. Set the refresh rate to 120Hz. Do not use auto.

  3. Set the resolution to be a fixed value. Do not use auto.

  4. Select the Save to X Configuration File and follow instructions to save to /etc/X11/xorg.conf.

  5. Add stereo option to xorg.conf.

    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.original
    cd /tmp
    nvidia-xconfig -c xorg.conf -o xorg.conf --stereo=10
    sudo cp xorg.conf /etc/X11/xorg.conf
    

    Note: The --stereo=10 is for NVIDIA 3D VISION. Use 11 for NVIDIA 3D VISION PRO. For other settings see man nvidia-settings.

  6. At this point your xorg.conf file should look similar to:

    Section "ServerLayout"
        Identifier     "Layout0"
        Screen      0  "Screen0" 0 0
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "Mouse0" "CorePointer"
    EndSection
    
    Section "InputDevice"
        Identifier     "Mouse0"
        Driver         "mouse"
        Option         "Protocol" "auto"
        Option         "Device" "/dev/psaux"
        Option         "Emulate3Buttons" "no"
        Option         "ZAxisMapping" "4 5"
    EndSection
    
    Section "InputDevice"
        Identifier     "Keyboard0"
        Driver         "kbd"
    EndSection
    
    Section "Monitor"
        Identifier     "Monitor0"
        VendorName     "Unknown"
        ModelName      "Ancor Communications Inc VG248"
        HorizSync       30.0 - 160.0
        VertRefresh     50.0 - 150.0
        Option         "DPMS"
    EndSection
    
    Section "Device"
        Identifier     "Device0"
        Driver         "nvidia"
        VendorName     "NVIDIA Corporation"
        BoardName      "Quadro K4000"
    EndSection
    
    Section "Screen"
        Identifier     "Screen0"
        Device         "Device0"
        Monitor        "Monitor0"
        DefaultDepth    24
        Option         "metamodes" "nvidia-auto-select +0+0; 1920x1080_100 +0+0"
        Option         "SLI" "Off"
        Option         "MultiGPU" "Off"
        Option         "BaseMosaic" "off"
        Option         "Stereo" "10"
        SubSection     "Display"
            Depth       24
        EndSubSection
    EndSection
    
  7. Restart X by logging out and logging back in.

Verify Stereo

  1. The Nvidia logo on the emitter should glow green. If red, then go back through the previous steps to make sure everything was done correctly.

  2. Open nvidia-settings.

    nvidia-settings
    
  3. Click on X Screen 0.

  4. The Stereo Mode setting should say NVIDIA 3D Vision Stereo.

  5. Install mesa-utils.

    sudo apt-get install mesa-utils
    
  6. Run glxgears in stereo.

    glxgears -stereo
    
  7. You should see blurry gears that look 3D when you put on the glasses.

Setup Gazebo

  1. Edit ~/.gazebo/gui.ini.

    gedit ~/.gazebo/gui.ini
    
  2. Add the following lines, if not already present.

    [rendering]
    stereo=1
    

    Note: You can disable stereo by using stereo=0, or removing the stereo line.

  3. Run Gazebo.

    gazebo worlds/shapes.world