@@ -0,0 +1,1812 @@
+#!/usr/bin/env python%0A%0A###############################################################################%0A# Copyright 2018 The Apollo Authors. All Rights Reserved.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A###############################################################################%0A%22%22%22%0AThis program can extract raw gpsbin from rosbag directory into /tmp/gpsimu.bin.%0A%0Adump_gpsbin.py rosbag_input_directory%0A%0A%22%22%22%0A%0Aimport argparse%0Aimport glob%0Aimport os%0Aimport shutil%0A%0Aimport rosbag%0Aimport std_msgs%0Afrom std_msgs.msg import String%0A%0Ag_args = None%0A%0A%0Adef dump_bag(in_dir):%0A    %22%22%22out_bag = in_bag%22%22%22%0A    global g_args%0A    bag_files = glob.glob(in_dir + %22/*.bag%22)%0A    f = file(%22/tmp/gpsimu.bin%22, 'w')%0A    for bag_file in sorted(bag_files):%0A        print %22Processing %22, bag_file, %22 ...%22%0A        bag = rosbag.Bag(bag_file, 'r')%0A        for topic, msg, t in bag.read_messages():%0A            if topic == %22/apollo/sensor/gnss/raw_data%22:%0A                f.write(str(msg))%0A    f.close()%0A%0A%0Aif __name__ == %22__main__%22:%0A    parser = argparse.ArgumentParser(%0A        description=%0A        %22A tool to dump gpsimu raw data %22)%0A    parser.add_argument(%0A        %22in_dir%22, action=%22store%22, type=str, help=%22the input ros bag directory%22)%0A%0A    g_args = parser.parse_args()%0A%0A    dump_bag(g_args.in_dir)%0A    print %22/tmp/gpsimu.bin is generated%22%0A

add a tool to dump raw gps data.