Re: How can i find time taken in generate map

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/How-can-i-find-time-taken-in-generate-map-tp309p317.html

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