Why is rtabmap noticeably faster than rtabmap_ros?

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

Why is rtabmap noticeably faster than rtabmap_ros?

jacksonkr

Running rtabmap by itself:

$ rtabmap

I set the camera to RBB-D Camera > Kinect > Freenect, open a new database, run. This is fast.

On the same machine after a fresh reboot I run rtabmap_ros:

$ roslaunch rtabmap_ros freenect_throttle.launch

AND in a separate terminal:

$ roslaunch rtabmap_ros rtabmap.launch rgb_topic:=/camera/data_throttled_image depth_topic:=/camera/data_throttled_image_depth camera_info_topic:=/camera/data_throttled_camera_info compressed:=true rtabmap_args:="--delete_db_on_start"

This works but it is slow. How can I get it to run smooth like rtabmap solo?

Here is a copy of freenect_throttle.launch for anyone who is interested

Reply | Threaded
Open this post in threaded view
|

Re: Why is rtabmap noticeably faster than rtabmap_ros?

matlabbe
Administrator
Hi,

In the standalone version, there is no memory copy (or serialization/deserialization like in ROS) between the camera, odometry, rtabmap and gui modules.

If freenect_throttle.launch and rtabmap.launch are running on the same computer, I would not use "compressed:=true" argument to avoid compression time. You can also use "data_skip" argument of freenect.launch to limit the framerate instead of using freenect_throttle.launch. Note that you are limiting the framerate to 5 Hz in freenect_throttle.launch. On your standalone example, it seems that you are starting the camera at highest framerate.

A better comparison would be with:
$ roslaunch freenect_launch freenect.launch depth_registration:=true
$ roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start"

To avoid serialization/deserialization of the image topics between the modules, we should create rgbd_odometry, rtabmap and rtabmapviz nodes as nodelets. I opened an issue for that.

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Why is rtabmap noticeably faster than rtabmap_ros?

jacksonkr
I tried that scenario and it looked promising but the the scanning was still half the speed of standalone rtabmap. I took some photos of the processes which are outlined below.

Potential solution: This is all happening on my bot so would it speed things up to disable visual processing and rely on another computer listening to /mapData to view the map? Currently I have a monitor hooked up to the bot (Jetson TK1) which is for debugging purposes only.

I should asked this before: Is it even a possibility to get rtabmap_ros and rtabmap to run at similar speed?

rtabmap_ros - Processes


rtabmap standalone - Processes


rtabmap_ros - Resources


rtabmap standalone - Resources
Reply | Threaded
Open this post in threaded view
|

Re: Why is rtabmap noticeably faster than rtabmap_ros?

matlabbe
Administrator
Hi,

you can have rtabmapviz running on a remote computer (subscribing to mapData topic). Note that mapData is sent every 1 second, so rtabmapviz would refresh at 1 Hz.

rtabmap_ros is split in three independent processes: rgbd_odometry, rtabmap and rtabmapviz. This is done for convenience, as if the robot has already odometry (so no need of rgbd_odometry), we may want to start only the rtabmap node on it (while rtabmapviz is on a remote computer). If you sum up CPU usage of these three processes + "nodelet" which is freenect, you get 69% CPU usage while standalone rtabmap (containing all these processes as threads) has 67% CPU usage.

Normally rtabmap standalone and rtabmap node should update the map at the same speed (1 Hz). I think the biggest difference your are seeing is the odometry framerate, that may be slower in rgbd_odometry node.

Beside serialization/deserialization of the messages, there is also the synchronization of the messages (rgb, depth and camera_info topics) that may add some overhead (which is not a problem in the standalone).

cheers

Reply | Threaded
Open this post in threaded view
|

Re: Why is rtabmap noticeably faster than rtabmap_ros?

jacksonkr
In my project I'll have several bots mapping the same area. All bots need to be publishing compiled map data and odometry. The idea being that the master will stitch together the individual maps and perform loop closure post-processing so that I can generate one large map, allowing me to scan a large area rather quickly and as accurately as possible.

Concerning my project, is there a better way I can handle performance on the individual bots? I merely want them to have rgbd odometry and take care of their own map data so they can send a compressed version back to the master. All of which needs to be as real time as possible. Is this even possible?
Reply | Threaded
Open this post in threaded view
|

Re: Why is rtabmap noticeably faster than rtabmap_ros?

matlabbe
Administrator
Hi,

It depends on how you define "real-time". This can be done online, but not at 30 Hz: each robot updates its map at 1 Hz and publishes mapData (with compressed data) at 1 Hz. Yes it can be possible at this rate (it would be around 100 KB/second needed by each robot). If you subscribe odometry only (/odom) without data used to compute odometry, it is negligible on the network. Example, each robot would publish:
[ ~0  KB/s] /odom (~5 to ~15Hz or more if they have powerful computers)
[~100 KB/s] /mapData (1Hz)

cheers