-
-
Save nivir/98cceef5c836c0183b87a8a46cb9a75a to your computer and use it in GitHub Desktop.
This file contains hidden or 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