How analysis the performance of Gazebo Plugin?

asked 2019-05-20 02:29:55 -0500

mkro0616 gravatar image

Hi all. I'm developing the 'MagnetPlugin'(GAZEBO's ModelPlugin) which apply magnetic force to magnet link (positive or negative-pole) of the GAZEBO models. This 'MagnetPlugin' get positions of all another 'magnet' and calculate magnet force in the 'BeforePhysicsUpdate' event listener. ( that is O(n^2) algorithm ) I wonder how many this plugin's calculating logic uses the CPU resource.

I tried valgrind (callgrind) for profiling GAZEBO, I profiled GAZEBO by adding 'launch-prefix = "valgrind --tool=callgrind ..." as the option of the Gazebo client node in the ROS launch file, and it seemed that I could not analyze the command called from MagnetPlugin because it was a shared library added at runtime. How can I profile my logic being invoked from the MagnetPlugin?

edit retag flag offensive close merge delete