High Frame Drop issue with RTabMap

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

High Frame Drop issue with RTabMap

FeriBolour
Hey Guys,
I am currently using RTabMap with an Intel D435i and I am using the ROS Wrapper for Intel RealSense Devices.

I am currently running the opensource_tracking launch file for my project. (Based on the tutorials given by Intel)
$ roslaunch realsense2_camera opensource_tracking.launch

I have been trying to 3D-Map an environment with high density and quality. I've been facing an issue and I've been wondering if anyone could help me with finding the cause of this problem.

I record all the data such as raw images and transforms into a rosbag file while running my experiments with RTabMap. After running several experiments, I realized that the number of raw images (frames) is far lower than what they're supposed to be. For example, if I run an experiment for 90 seconds on 30fps and 480p, I assumed that I should be able to extract around 2700 frames but I'm only able to extract around 740 frames from the .bag file. I've also been recording the process at the same time using the  'video_recorder' from 'image_view' and I would slightly get better results. For example for the same 90 seconds video, I'm getting a 42 seconds video from video recorder.
This is the rosbag info for this example:
''''
path:        TEST1_2D_bothIMU.bag
version:     2.0
duration:    1:35s (95s)
start:       Feb 28 2021 12:27:01.72 (1614536821.72)
end:         Feb 28 2021 12:28:37.46 (1614536917.46)
size:        3.1 GB
messages:    109064
compression: none [2583/2583 chunks]
types:       sensor_msgs/CameraInfo [c9a58c1b0b154e0e6da7578cb991d214]
             sensor_msgs/Image      [060021388200f6f0f447d0fcd9c64743]
             sensor_msgs/Imu        [6a62c6daae103f4ff57a132d6f95cec2]
             tf2_msgs/TFMessage     [94810edda583a504dfda3829e70d7eec]
topics:      /camera/aligned_depth_to_color/camera_info    1492 msgs    : sensor_msgs/CameraInfo
             /camera/color/camera_info                     2579 msgs    : sensor_msgs/CameraInfo
             /camera/color/image_raw                       2579 msgs    : sensor_msgs/Image    
             /camera/imu                                  37026 msgs    : sensor_msgs/Imu      
             /tf                                          63895 msgs    : tf2_msgs/TFMessage     (4 connections)
             /tf_static                                       1 msg     : tf2_msgs/TFMessage    
             camera/aligned_depth_to_color/image_raw       1492 msgs    : sensor_msgs/Image

real 0m1.929s
user 0m1.172s
sys 0m0.308s
''''
As soon you can see the number msgs for image_raw and camera_info are indeed around 2700 but the number of images I can actually extract is only 740, using this tutorial,
https://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data

My first question is: Is my assumption that I should be able to extract all the 2700 frames correct? Or is RTabMap dropping/ignoring this high amount of frames on purpose? Because I'm getting fairly decent point clouds with high density while moving the camera at a very slow pace.

At first, we thought this might be a hardware problem, so we switched from Jetson Xavier NX to a Jetson Xavier AGX with almost twice the amount of power of NX. But we're still getting the same results with high frame-drop rates.

My second question is: What could be the source of this problem and how could we solve it?

Thank You,
Farshad
Reply | Threaded
Open this post in threaded view
|

Re: High Frame Drop issue with RTabMap

matlabbe
Administrator

Not sure to understand what rtabmap does in extracting images from the rosbag, which should be independent as seen in the link you shared. Maybe your computer cannot save the images on hard drvie fast enough that they are received from the rosbag. You could increase queue_size of the callbacks in the video recorder or reduce speed of the playback of the rosbag.

On rtabmap side, it processes images at 1 Hz by default, so for 95s, there would be 95 images in the database.