You can catch the
rtabmap_ros/Info topic sent from rtabmap node and get the statistics in it.
$ rostopic echo /rtabmap/info
A node recording the timings could use this:
#include <rtabmap/core/Statistics.h>
#include <rtabmap_ros/Info.h>
#include <rtabmap_ros/MsgConversion.h>
void infoCallback(const rtabmap_ros::InfoConstPtr & infoMsg)
{
rtabmap::Statistics stat;
rtabmap_ros::infoFromROS(*infoMsg, stat);
// Get total time:
float totalTime = stat.data().at(Statistics::kTimingTotal()); // in ms
}
For the rtabmap_ros odometry, there is the
rtabmap_ros/OdomInfo topic:
$ rostopic echo /rtabmap/odom_info/time