osrf / vrx

Virtual RobotX (VRX) resources.
Apache License 2.0
421 stars 189 forks source link

Low real time factor and sky rendering issue #717

Open lijianwen1997 opened 1 year ago

lijianwen1997 commented 1 year ago

Describe the bug I cloned the latest VRX repo and ran the simultor with default settings. However, the real time factor was very low (38%). If I increase the step size to 0.05, it can increase to 78% but I don't think it is the right way to solve the problem. Plus the sky is not rendered properly. I tried both nvidia-driver-470 and nvidia-driver-530 but it did not help. It will be great if you can let me know how to increase the real time rate and fix the rendering issue.

To Reproduce

  1. Run ros2 launch vrx_gz competition.launch.py

System Configuration:

Screenshots

Screenshot from 2023-08-11 17-38-46

Additional notes We also reproduced this low RTF and redenring issue on a Laptop with i7-8565 CPU and UHD 620 GPU.

M1chaelM commented 1 year ago

We usually see these symptoms when the system is unable to access the GPU (so it makes sense that you would see this on the laptop). Are you using Docker or running directly on hardware?

Assuming you are running directly on hardware:

lijianwen1997 commented 1 year ago

Thanks very much for your help! I am running directly on hardware. I changed the driver to 470 but it did not fix the issues. The output of nvidia-smi when vrx is running is as below: Screenshot from 2023-08-14 16-05-49

What's more, I saw ruby 3.0 has been stopped unexpectedly. Not sure if that caused the issues. Screenshot from 2023-08-14 16-06-08

lijianwen1997 commented 1 year ago

https://gazebosim.org/docs/garden/troubleshooting#prime-select-command-line-tool

I visited gazebo troubleshoot page and configured Gazebo to always use Nvidia and it fixed the sky rendering issue! The RTF increased to 60%.

Please let me know if you have any suggestions to increase the RTF.

Screenshot from 2023-08-14 16-35-12

caguero commented 1 year ago

@tejalbarnwal was kind enough to test a few things:

https://github.com/osrf/vrx/blob/main/vrx_urdf/wamv_gazebo/urdf/wamv_gazebo.urdf.xacro#L162-L166

tejalbarnwal commented 1 year ago
Hey, I tested out disabling the 3D lidar and the camera sensors, and I found the following outcomes: Test Condition RTF
With Lidar and Cameras 0.82
Without Lidar approximately 0.82
Without cameras and disabled Lidar visualization 0.95
Without cameras and enabled Lidar visualization fluctuating between 0.82 and 0.96(average around 0.89)
Without cameras and Lidar 0.995

It appears that the cameras may be the primary cause of the reduced RTF. I plan to assess a basic URDF with minimal joints and plugins later tonight.