launch
jfr2018
extract_rgbd.py
Go to the documentation of this file.
1
import
rosbag
2
import
tf
3
import
sys
4
from
tf.msg
import
tfMessage
5
6
if
len(sys.argv) < 2:
7
print
'Usage: $ python extract_rgbd.py "2012-01-25-12-14-25"'
8
sys.exit(0)
9
10
bagName = sys.argv[1]
11
with
rosbag.Bag
(bagName +
'_rgbd.bag'
,
'w'
)
as
outbag:
12
print
'Processing '
+ bagName +
'.bag...'
13
for
topic, msg, t
in
rosbag.Bag
(bagName +
'.bag'
).read_messages():
14
if
topic ==
"/tf"
or
topic ==
"/camera/depth/image_raw"
or
topic ==
"/camera/rgb/camera_info"
or
topic ==
"/camera/rgb/image_raw"
:
15
outbag.write(topic, msg, t)
16
print
'Output: '
+ bagName +
'_out.bag'
rosbag::Bag
rtabmap_ros
Author(s): Mathieu Labbe
autogenerated on Tue Jan 24 2023 04:04:40