IRONSIDES icon indicating copy to clipboard operation
IRONSIDES copied to clipboard

Image frame rate drops in slam_node

Open thien94 opened this issue 7 years ago • 1 comments

Issue details

When I run slam_node, the frame rate of the image topic begins at 60fps as expected, then decreases to 30-50fps when I move the Ironsides around to test the SLAM. Even if I put the ironsides down to static position the frame rate would not recover.

My guess is that since the image publisher and SLAM algorithm are working in the same loop, the frame rate of the images get throttled down by the SLAM's speed. I confirmed this by comment out the runSlam function call and observed the frame rate of image topic /pirvs_slam/StereoImage/left and /right remains stable at 60fps, no matter the movement. https://github.com/TrifoRobotics/IRONSIDES/blob/5cac1a6f225d2f3dd6451ea2664c927583c2b06c/src/slam_node.cpp#L232

I also noticed that there are no camera_info topics being published, but that can be fixed easily.

Version

PerceptIn SDK 1.2.0.

Workaround

It would be best that we always have maximum frame rate for the image topics to be used for other application. The issue can be fixed by decoupling the image publisher and SLAM algo, but looking at your SDK document it seems to me that getData function and runSlam must be in the same while loop?

thien94 avatar Jul 29 '18 06:07 thien94

You are right, the slam can not handle 60 fps and it will drop frames. Since they are in the same loop, images are dropped as well. So the images we published in slam mode are the one we used for tracking.

GetData function and runSlam may not be in the same while loop. Since the function to handle data dropping is a low level interface in GetData(), we suggest to put them together. Otherwise you need to take care of data queue and data dropping by yourself.

wli009 avatar Jul 30 '18 18:07 wli009