playing .bag bag files in RTAB problem, rtabmap does not start with data_recorder.launch

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

playing .bag bag files in RTAB problem, rtabmap does not start with data_recorder.launch

Gabe
This post was updated on .
Hi, I've been trying to run a .bag file on RTABMAP using data_recorder.launch as explained here, but my RTABMAP never seems to get readings from my published topics. This is what the output is when I run

rosbag play mybag.bag

 and

roslaunch rtabmap_ros data_recorder.launch subscribe_depth:=true subscribe_odometry:=true subscribe_laserScan:=false frame_id:=base_link publish_tf:=true odom_frame_id:=odom odom_topic:=/odometry/filtered scan_topic:=/jn0/base_scan rgb_topic:=/camera/rgb/image_rect_color rgb_info_topic:=/camera/rgb/camera_info depth_topic:=/camera/depth_registered/image_raw


immediately after:

core service [/rosout] found
process[data_recorder-1]: started with pid [29954]
[ INFO] [1465813485.130044308]: Starting node...
[ INFO] [1465813485.173504380]: rtabmap: frame_id = base_link
[ INFO] [1465813485.173554287]: rtabmap: odom_frame_id = odom
[ INFO] [1465813485.173571747]: rtabmap: map_frame_id = map
[ INFO] [1465813485.173586960]: rtabmap: queue_size = 10
[ INFO] [1465813485.173608543]: rtabmap: tf_delay = 0.050000
[ INFO] [1465813485.173625124]: rtabmap: depth_cameras = 1
[ INFO] [1465813485.193831529]: Setting RTAB-Map parameter "DbSqlite3/InMemory"="true"
[ INFO] [1465813485.248918688]: Setting RTAB-Map parameter "Kp/MaxFeatures"="-1"
[ INFO] [1465813485.279150794]: Setting RTAB-Map parameter "Mem/MapLabelsAdded"="false"
[ INFO] [1465813485.286715385]: Setting RTAB-Map parameter "Mem/RehearsalSimilarity"="1.0"
[ INFO] [1465813485.289248005]: Setting RTAB-Map parameter "Mem/STMSize"="1"
[ INFO] [1465813485.353546570]: Setting RTAB-Map parameter "RGBD/AngularUpdate"="0"
[ INFO] [1465813485.358049263]: Setting RTAB-Map parameter "RGBD/LinearUpdate"="0"
[ INFO] [1465813485.362721179]: Setting RTAB-Map parameter "RGBD/MaxLocalRetrieved"="0"
[ INFO] [1465813485.375289667]: Setting RTAB-Map parameter "RGBD/ProximityBySpace"="false"
[ INFO] [1465813485.392957368]: Setting RTAB-Map parameter "Rtabmap/DetectionRate"="0"
[ INFO] [1465813485.398259343]: Setting RTAB-Map parameter "Rtabmap/MaxRetrieved"="0"
[ INFO] [1465813485.398730454]: Setting RTAB-Map parameter "Rtabmap/MemoryThr"="2"
[ INFO] [1465813485.653905195]: RTAB-Map detection rate = 0.000000 Hz
[ INFO] [1465813485.653948564]: rtabmap: Using database from "/home/cear/.ros/output.db".
[ INFO] [1465813485.660246044]: rtabmap: Database version = "0.11.5".
[ INFO] [1465813485.910973367]:
/data_recorder subscribed to:
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info
[ INFO] [1465813485.911074065]: rtabmap 0.11.5 started...


And it stays like this forever. I run rqt to see if my topics are outputting anything, and I am able to see images, so my topics are outputting things. I just believe that RTABMAP isn't catching them. I have double checked that the topic names are correct, I used the rosbag record to record my
/camera/rgb/image_rect_color /camera/rgb/camera_info /camera/depth_registered/image_raw /tf /odometry/filtered
 topics.

Also, this is what I see when I type in rostopic list:

rostopic list
/camera/depth_registered/image_raw
/camera/rgb/camera_info
/camera/rgb/image_rect_color
/clock
/odometry/filtered
/rosout
/rosout_agg
/tf


And the only topic that does not output anything is the /clock topic, so would that maybe cause the problem?

EDIT: Just trued running rosbag play --clock mybag.bag and the data_recorder.launch still didn't work.


Please let me know if there is any solution to this problem. thanks :)

- Gabe
Reply | Threaded
Open this post in threaded view
|

Re: playing .bag bag files in RTAB problem, rtabmap does not start with data_recorder.launch

Gabe
FIXED:

I remade the .bag file while subscribed to more topics and for some reason it worked. Thanks :)
Reply | Threaded
Open this post in threaded view
|

Re: playing .bag bag files in RTAB problem, rtabmap does not start with data_recorder.launch

matlabbe
Administrator
Hi,

When replaying a bag with TF inside, don't forget to set "use_sim_time" to true after roscore is started and use "--clock" argument when playing the bag:
$ roscore
$ rosparam set use_sim_time true
$ roslaunch rtabmap_ros data_recorder.launch subscribe_odometry:=true odom_topic:=/odometry/filtered
$ rosbag play --clock my_bag.bag

cheers
Reply | Threaded
Open this post in threaded view
|

Re: playing .bag bag files in RTAB problem, rtabmap does not start with data_recorder.launch

lukefirewalker
Hi,

I have exactly the same problem. I've recorded topics:
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info
while running
  roslaunch openni2_launch openni2.launch depth_registration:=true

Then I tried to convert data to .db as you explained (using data_recorder.launch) but I see exactly same messages as OP, and after replaying bag, when I try to view database in rtabmap_DatabaseViewer, it looks like it's empty. RTAB_map standalone also doesn't want to use that database as a source displaying "RTAB-Map cannot run with an uncalibrated camera. Do you want to calibrate the camera now?". When I click yes it says: "Cannot calibrate database source!"

I tried everything proposed in this topic and nothing seems to work. Please help. Thanks in advance.

- Luke
Reply | Threaded
Open this post in threaded view
|

Re: playing .bag bag files in RTAB problem, rtabmap does not start with data_recorder.launch

matlabbe
Administrator
Hi,

I just fixed a small issue with data_recorder.launch. Either download/update to new version, or if you are using 0.11.8 binaries, launch it with "stereo_approx_sync:=true":
$ roslaunch openni2_launch openni2.launch depth_registration:=true
$ roslaunch rtabmap_ros data_recorder.launch stereo_approx_sync:=true

Make sure you see "rtabmap (X): Rate=....." log messages after "rtabmap 0.11.8 started..." indicating that rtabmap is recording:
/data_recorder subscribed to (approx sync):
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info
[ INFO] [1472927279.672705258]: rtabmap 0.11.8 started...
[ INFO] [1472927280.232221818]: rtabmap (1): Rate=0.00s, Limit=0.000s, RTAB-Map=0.0060s, Maps update=0.0001s pub=0.0001s (local map=0, WM=1)
[ INFO] [1472927280.265272217]: rtabmap (2): Rate=0.00s, Limit=0.000s, RTAB-Map=0.0101s, Maps update=0.0001s pub=0.0000s (local map=0, WM=2)
[ INFO] [1472927280.296826358]: rtabmap (3): Rate=0.00s, Limit=0.000s, RTAB-Map=0.0086s, Maps update=0.0001s pub=0.0000s (local map=0, WM=2)
[ INFO] [1472927280.333368809]: rtabmap (4): Rate=0.00s, Limit=0.000s, RTAB-Map=0.0080s, Maps update=0.0001s pub=0.0000s (local map=0, WM=2)
...
 
The calibration message is wrong, it should not be shown if the database is empty. I fixed this too. The warning you will have if the databse is empty is: "No more images... The camera has reached the end of the stream."

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

Re: playing .bag bag files in RTAB problem, rtabmap does not start with data_recorder.launch

lukefirewalker
Thank you for your fast response.

I updated rtabmap_ros package and now data_recorder works correctly for me.

But now other problem has arisen: when I record .db with data_recorder.launch I would like to later use it in RTAB-Map as a source to generate .ply file. But standalone app version now does not match the package version (standalone 0.11.8, package 0.11.10) and I can't use .db created by data_recorder.launch in standalone. I get following error message in console:

[ERROR] (2016-09-05 10:58:33.327) DBDriverSqlite3.cpp:380::connectDatabaseQuery() Opened database version (0.11.10) is more recent than rtabmap installed version (0.11.8). Please update rtabmap to new version!

But RTAB-Map is up to date. (That's the message I get when I try to pull origin master from git)

So my question is: Is there any way to make rtabmap.launch use my database as source?
Reply | Threaded
Open this post in threaded view
|

Re: playing .bag bag files in RTAB problem, rtabmap does not start with data_recorder.launch

matlabbe
Administrator
Hi,

It is strange that rtabmap_ros is on 0.11.10 and rtabmap is on 0.11.8 (as rtabmap_ros 0.11.10 requires rtabmap 0.11.10 to actually build)!? Master branch of rtabmap at this time is 0.11.10. You may have a "rtabmap" version 0.11.10 built somewhere, see where you installed it (on the "$ make install").

To play a database under ROS, you may use the not documented rtabmap_ros/data_player node:
$ roslaunch rtabmap_ros rtabmap.launch
$ rosrun rtabmap_ros data_player _database:=~/.ros/output.db _frame_id:=/camera_link rgb/image:=/camera/rgb/image_rect_color depth_registered/image:=/camera/depth_registered/image_raw rgb/camera_info:=/camera/rgb/camera_info

Well, if you stay under ROS, you would have more options with a rosbag (format is more general too).

cheers