ros_gz icon indicating copy to clipboard operation
ros_gz copied to clipboard

Performance issues with bridging gpu_lidar data

Open roni-kreinin opened this issue 1 year ago • 8 comments

Environment

  • OS Version: Ubuntu 22.04
  • ROS 2 Humble
  • Ignition Fortress
  • Source or binary build? Binary: 0.244.9

Description

The Create 3 sim uses a number of gpu_lidar sensors to simulate the IR intensity sensors as well as cliff detection sensors. The sensor data is bridged to ROS 2 with ros_gz_bridge and used by nodes. Performance of the simulation is reduced significantly as soon as the bridges for these sensors are added, and the topic frequency in ros2 is well below the desired update_rate specified in the urdf.

  • Expected behavior: LaserScan messages should be published at the set update_rate of the sensor.
  • Actual behavior: ros2 topic hz reports that topics are published at around 60% of the update rate. Additionally, the RTF in Gazebo drops significantly when the parameter_bridge nodes for the lidars are running.

Steps to reproduce

  1. Build create3_sim from source.
  2. ros2 launch irobot_create_ignition_bringup create_ignition.launch.py
  3. Check scan topic frequencies: ros2 topic hz /_internal/cliff_front_left/scan ros2 topic hz /_internal/ir_intensity_front_center_left/scan

For me the cliff sensors publish at around 47hz and the ir sensors at around 35hz. They both have update rates set to 62hz. RTF also jumps between 40-60%.

  1. Disable the ir and cliff sensor bridges by commenting out lines 196 and 197 in create3_ros_ignition_bridge.launch.py. Launch the sim again.

With the bridges disabled I now have a steady RTF of around 90%.

  1. Re-enable the sensor bridges and uncap update_rate by commenting out line 58 in common_properties.urdf.xacro. Launch the sim again.

With this configuration, my RTF sits at a very consistent 31-33% without much fluctuation. Additionally, both cliff and IR sensors report around 160hz on their respective ros2 topics.

To achieve the desired 62hz, I have to set the update rate of the sensors to around 100hz. Clearly my machine is capable of publishing 160hz, so I am not sure what is causing this loss of ~1/3 the desired frequency. Additionally, why does the ros_gz_bridge cause such significantly reduced Gazebo RTF performance?

roni-kreinin avatar Mar 07 '23 22:03 roni-kreinin