How to record rosbag for rtabmap by using kinect2

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

How to record rosbag for rtabmap by using kinect2

polarbear
Hi,
i am trying to use rosbag to record date so that i can just walk around the room one time to do many times test.
Those topic are what i try to record,but it don`t work when i play bag.
Could you give me some suggests?Thanks~
I drive kinetc2 by libfreenect2.And i do 'rosparam set use_sim_time true' too when play bag.

/kinect2/qhd/camera_info
 /kinect2/qhd/image_color_rect
/kinect2/qhd/image_depth_rect
/kinect2/qhd/points
/tf
Reply | Threaded
Open this post in threaded view
|

Re: How to record rosbag for rtabmap by using kinect2

matlabbe
Administrator
Hi,

following kinect2 instructions from this ros wiki tutorial, here is an example.

Record bag:
$ roslaunch kinect2_bridge kinect2_bridge.launch publish_tf:=true
$ rosrun tf static_transform_publisher 0 0 0 -1.5707963267948966 0 -1.5707963267948966 camera_link kinect2_link 100
$ rosbag record -O kinect2 /tf /kinect2/qhd/image_color_rect /kinect2/qhd/image_depth_rect /kinect2/qhd/camera_info

Play bag:
$ roscore
$ rosparam set use_sim_time true
$ roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" rgb_topic:=/kinect2/qhd/image_color_rect depth_topic:=/kinect2/qhd/image_depth_rect camera_info_topic:=/kinect2/qhd/camera_info
$ rosbag play --clock kinect2.bag

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

Re: How to record rosbag for rtabmap by using kinect2

yalan2017
Hi
Can i use this bag file for localization with autonomous robot? i have already created  a map with kinect v2 , but i wonder whether i can use this map for localization or not, with online mapping i can use for localization but i have problem while my robot rotate fast suddenly i lost my odometry (shows that red page which means odometry lost ) this issue caused my autonomous robot lost . I only use kinect v2 with out any wheel odemerty and imu...
Thank you in advance
Reply | Threaded
Open this post in threaded view
|

Re: How to record rosbag for rtabmap by using kinect2

matlabbe
Administrator
Yes, the map can be used in localization. The problem here is the visual odometry that gets lost when not seeing enough visual features to track. This is a common problem for indoor robots having limited field of view, they cannot navigate in featureless areas with only visual odometry.

You can try tips from section Odometry Auto-Reset of the parameter tuning tutorial. This will make odometry to restart tracking from where it got lost.

More info about red screens here.

cheers,
Mathieu

Reply | Threaded
Open this post in threaded view
|

Re: How to record rosbag for rtabmap by using kinect2

polarbear
In reply to this post by matlabbe
Thanks!
 I’m truly grateful for your help
Reply | Threaded
Open this post in threaded view
|

Re: How to record rosbag for rtabmap by using kinect2

yalan2017
Thank you for your reply.
Cheers