RTAB-Map processing time

classic Classic list List threaded Threaded
5 messages Options
mi
Reply | Threaded
Open this post in threaded view
|

RTAB-Map processing time

mi
Hi.

I'm checking the parameter "RtabmapROS/TimeTotal/ms", but I'm not sure if I understood it, and if it is what I'm looking for...

I'd like to know the time from the moment Rtabmap receives the 5 synchronized inputs (in my case odom, stereo images, and their configs parameters) until the moment it is ready to publish the required info, in my case, a 2D occupancy grid map.
Does this parameter is related to this? If not, there is any way to take it?

I appreciated any help.
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map processing time

matlabbe
Administrator
Yes, https://github.com/introlab/rtabmap_ros/blob/ada3e7082ca87daa869adc2d1a6bf6666647fd24/src/CoreWrapper.cpp#L2247

From when the callback is called to after publishing the resulting topics. Well, it doesn't include the time for message conversion before sending data to rtabmap library. I didn't measure it, but I think it should be negligible.

cheers,
Mathieu
mi
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map processing time

mi
Thanks for replying, Mathieu!
Sorry for the noob question, but I'm having difficulty to understand if this time already includes the disparity time for the stereo images. I'd appreciated it if you could point out where in this "CoreWrapper::process" function the disparity calculation is called.
I'm asking because I changed the "Stereo/DenseStrategy" from StereoBM to StereoSGBM, which is more expensive, but not sure if there was any difference regarding the processing time. I'll keep investigating. Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map processing time

matlabbe
Administrator
You should launch rtabmap node with "stereo_to_depth" set to true to use dense disparity. You could then add timers or log around there. As I say previously, the msg conversion time was not included in total rtabmap ros time stat. I updated the code to include that processing time under new RtabmapROS/TimeMsgConversion/ms stat.

With stereo_to_depth set to false, dense disparity would be also computed when creating the local grid if Grid/FromDepth is true. You could see a change in computation time with statistics TimingMem/Occupancy_grid if you use SGBM instead of BM.

cheers,
Mathieu
mi
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map processing time

mi
Thanks for replying!
Once I set "stereo_to_depth" to true, the grid map stoped from being created, so it is now set to false. But, as you said, to build the 2D grid, the disparity function is called anyway. Using "boost::stacktrace::stacktrace()" inside rtabmap::util2d::disparityFromStereoImages  I traced the function and realized that it is called here. Finally, I could define well the timers I need.

Btw, I also replicated your modifications regarding  RtabmapROS/TimeMsgConversion/ms in the ROS2 branch. Let me know if a PR is welcome.

Thank you for your help!