Created
March 24, 2017 10:38
-
-
Save mintar/cabd026f1ad488e19242ea07f2eec285 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import rosbag | |
import sys | |
inbag_name = sys.argv[1] | |
outbag_name = inbag_name.replace('.bag', '-fixed.bag') | |
with rosbag.Bag(outbag_name, 'w') as outbag: | |
for topic, msg, t in rosbag.Bag(inbag_name).read_messages(): | |
if topic == "/camera/depth_registered/points_drop" and msg.header.frame_id: | |
msg.header.frame_id = "/kinect_rgb_optical_frame" | |
outbag.write("/kinect/depth_registered/points_drop", msg, t) | |
else: | |
outbag.write(topic, msg, t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment