gazebosim / gz-sensors

Provides numerous sensor models designed to generate realistic data from simulation environments.
https://gazebosim.org
Apache License 2.0
63 stars 58 forks source link

Simulation runs faster than camera framerate #455

Closed EmmanuelMess closed 3 months ago

EmmanuelMess commented 3 months ago

I am running a gazebo plugin for simulating the Intel Realsense D435i. When I record a rosbag, the rate of frames is ridicoulously low (3.5Hz). By reducing the real_time_update_rate to 10 I can get something similar to 30Hz (what it should be), but I want to set the simulation so that everything runs as slow as needed to keep the framerate at some specified value.

Plugin code: https://github.com/m-tartari/realsense_gazebo_plugin/tree/49ab134fa517280bb8393e715173dc631ccc2557

Similar to https://github.com/gazebosim/gz-sensors/issues/332

EmmanuelMess commented 3 months ago

Workaround is to lower real_time_update_rate until the framerate reaches 30fps.

azeey commented 3 months ago

Based on your use of realsense_gazebo_plugin, it sounds like you're using Gazebo-classic. This repo is for the new Gazebo. Can you confirm?

EmmanuelMess commented 3 months ago

Based on your use of realsense_gazebo_plugin, it sounds like you're using Gazebo-classic. This repo is for the new Gazebo. Can you confirm?

I'm using gazebo classic. Where is the repo for that version?

azeey commented 3 months ago

https://github.com/gazebosim/gazebo-classic. I will mention that Gazebo-classic will be EOL in January, 2025 and there's minimal maintenance going on right now. I encourage you to switch to modern Gazebo (see https://gazebosim.org/docs/latest/migrating_gazebo_classic_ros2_packages/)