!pip3 install pyyaml
Requirement already satisfied: pyyaml in /usr/local/lib/python3.7/dist-packages (3.13)
from google.colab import drive
drive.mount('/content/drive')
Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount("/content/drive", force_remount=True).
# For parsing the yaml data
import yaml
import re

log_file = "/content/drive/MyDrive/SA/output_manual.txt"
re_pattern = '\[INFO\] \[[0-9]*[.][0-9]+, [0-9]*[.][0-9]+\]: '

with open(log_file,'r') as f:
  lines = f.read()
  lines = re.sub(re_pattern, "|", lines)

logs = []
for f in lines.split('|')[1:]:
  logs.append(yaml.safe_load(f.strip()))
len(logs)
2467
# carla.VehiclePhysicsControl
logs[0]
{'center_of_mass': {'x': 0.5999999642372131, 'y': 0.0, 'z': -0.5},
 'clutch_strength': 10.0,
 'damping_rate_full_throttle': 0.05000000074505806,
 'damping_rate_zero_throttle_clutch_disengaged': 0.3499999940395355,
 'damping_rate_zero_throttle_clutch_engaged': 2.0,
 'drag_coefficient': 0.30000001192092896,
 'gear_switch_time': 0.5,
 'id': 379,
 'mass': 200.0,
 'max_rpm': 12500.0,
 'moi': 1.0,
 'rolename': 'ego_vehicle',
 'type': 'vehicle.eteam.kerubless',
 'use_gear_autobox': True,
 'wheels': [{'damping_rate': 0.25,
   'max_brake_torque': 700.0,
   'max_handbrake_torque': 0.0,
   'max_steer_angle': 0.7853981852531433,
   'position': {'x': 0.8034082031250023,
    'y': 0.6081219482422,
    'z': -0.2865237975120544},
   'radius': 26.0,
   'tire_friction': 3.5},
  {'damping_rate': 0.25,
   'max_brake_torque': 700.0,
   'max_handbrake_torque': 0.0,
   'max_steer_angle': 0.7853981852531433,
   'position': {'x': 0.8034082031250023,
    'y': -0.6072686767578261,
    'z': -0.28652206182479856},
   'radius': 26.0,
   'tire_friction': 3.5},
  {'damping_rate': 0.25,
   'max_brake_torque': 700.0,
   'max_handbrake_torque': 1400.0,
   'max_steer_angle': 0.0,
   'position': {'x': -0.724609375,
    'y': 0.5681219482421795,
    'z': -0.28647407293319704},
   'radius': 26.0,
   'tire_friction': 3.5},
  {'damping_rate': 0.25,
   'max_brake_torque': 700.0,
   'max_handbrake_torque': 1400.0,
   'max_steer_angle': 0.0,
   'position': {'x': -0.724609375,
    'y': -0.5672882080078239,
    'z': -0.28647245168685914},
   'radius': 26.0,
   'tire_friction': 3.5}]}
# logs[1:]
logs[len(logs)//2]
{'acceleration': {'angular': {'x': 0.0, 'y': 0.0, 'z': 0.0},
  'linear': {'x': 0.012754201889038086,
   'y': -0.7609748840332031,
   'z': 0.004217866808176041}},
 'control': {'brake': 0.0,
  'gear': 5,
  'hand_brake': False,
  'header': {'frame_id': '', 'seq': 0, 'stamp': {'nsecs': 0, 'secs': 0}},
  'manual_gear_shift': False,
  'reverse': False,
  'steer': 0.0,
  'throttle': 1.0},
 'header': {'frame_id': 'map',
  'seq': 1425,
  'stamp': {'nsecs': 39182648, 'secs': 78}},
 'orientation': {'w': 0.6858765864140473,
  'x': -0.004533060922846557,
  'y': -0.004497546391040654,
  'z': -0.7276898595171877},
 'velocity': 14.221641540527344}