frankaemika / franka_ros

ROS integration for Franka research robots
https://frankaemika.github.io
Apache License 2.0
339 stars 307 forks source link

Pick & Place `franka_gazebo` example gazebo lights and shadows broken #361

Closed rickstaa closed 10 months ago

rickstaa commented 10 months ago

It looks like the lights in the []() pick & place example. This problem is even present in the figures used in the documentation. As explained in https://github.com/gazebosim/gazebo-classic/issues/2623, this issue is caused by a bug in Gazebo11 on non-Nvidia GPUs. If you experience this problem with an Nvidia GPU, it is because Gazebo is not using it. I pasted the solution given in https://github.com/gazebosim/gazebo-classic/issues/2623#issuecomment-1090147833 below for future reference.

before

image

after

image

@Maverobot, @gollth, I wanted to send you a pull request to update the image used in your documentation but could not find the documentation repository.

Solution

This issue only occurs on non-Nvidia GPUs. If you have an Nvidia GPU and are still affected by this issue (like me), >that means that Gazebo is not using your Nvidia GPU! The problem is not purely aesthetic, because you will also be >affected by all the other Gazebo bugs on non-Nvidia GPUs (like sporadic incorrect laser scans and so on). Here is how to >solve it. You have two options:

Option 1: Always enable NVidia

sudo prime-select nvidia

Then reboot.

The problem with Option 1 (for me) is that it often makes my external screen blink off sporadically. Also it constantly uses the GPU, >so the GPU fan is very loud, and it drains the battery quickly. So I went with option 2.

Option 2: Render offload for OpenGL applications

This means that your X screen and all normal applications are handled by the Intel GPU, but all OpenGL applications that you start from >the terminal (including Gazebo) are rendered on the Nvidia GPU.

sudo prime-select on-demand

Then add the following lines to your ~/.bashrc:

# activate offload rendering for OpenGL applications
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia

Then reboot.

Resources:

Originally posted by @mintar in https://github.com/gazebosim/gazebo-classic/issues/2623#issuecomment-1090147833

rickstaa commented 10 months ago

I will close this since I only created this to have it as a reference might people experience this problem in the future.