@@ -0,0 +1,1868 @@
+#!/usr/bin/python%0A%22%22%22%0Aview_rosbag_radar.py: version 0.1.0%0A%0ATodo:%0Aconvert rosbag can_raw ESR track data to image%0A%0AHistory:%0A2016/10/02: Initial version to display raw radar data.%0A%22%22%22%0A%0Aimport argparse%0Aimport sys%0Aimport numpy as np%0Aimport pygame%0Aimport rosbag%0Aimport datetime%0Aimport struct%0A%0A#from keras.models import model_from_json%0A%0Aif __name__ == %22__main__%22:%0A  parser = argparse.ArgumentParser(description='Udacity SDC Micro Challenge Radar viewer')%0A  parser.add_argument('--dataset', type=str, default=%22dataset.bag%22, help='Dataset/ROS Bag name')%0A  parser.add_argument('--skip', type=int, default=%220%22, help='skip seconds')%0A  args = parser.parse_args()%0A%0A  dataset = args.dataset%0A  skip = args.skip%0A  startsec = 0%0A%0A  print %22reading rosbag %22, dataset%0A  bag = rosbag.Bag(dataset, 'r')%0A%0A#%0A# msg format:%0A#   header: %0A#     seq: 120556%0A#     stamp: %0A#       secs: 1476173337%0A#       nsecs: 165327047%0A#     frame_id: ''%0A#   count: 120556%0A#   id: 1899%0A#   len: 8%0A#   dat: %5B2, 0, 0, 0, 0, 0, 0, 0%5D%0A#   flag: 0%0A#   time: 1219812%0A%0A  for topic, msg, t in bag.read_messages(topics=%5B'/can_raw'%5D):%0A    if startsec == 0:%0A        startsec = t.to_sec()%0A        if skip %3C 24*60*60:%0A            skipping = t.to_sec() + skip%0A            print %22skipping %22, skip, %22 seconds from %22, startsec, %22 to %22, skipping, %22 ...%22%0A        else:%0A            skipping = skip%0A            print %22skipping to %22, skip, %22 from %22, startsec, %22 ...%22%0A    else:%0A        if t.to_sec() %3E skipping:%0A            if topic in %5B'/can_raw'%5D:%0A                sys.stdout.write(topic)%0A                sys.stdout.write(%22 seq:%25d %22 %25 msg.header.seq)%0A                sys.stdout.write(%22 id:0x%250.4x %22 %25 msg.id)%0A                sys.stdout.write(%22 msglen:%25d %22 %25 msg.len)%0A                for i in xrange(msg.len):%0A                    sys.stdout.write(%22 0x%250.2x %22 %25 struct.unpack('B', msg.dat%5Bi%5D)%5B0%5D)%0A                sys.stdout.write(%22%5Cn%22)%0A%0A

Add view_rosbag_radar.py