#32 Small fixes

This commit is contained in:
nsubiron 2017-11-18 18:34:42 +01:00
parent db27bbb94b
commit ea6a711559
2 changed files with 4 additions and 5 deletions

View File

@ -13,7 +13,6 @@ from __future__ import print_function
import argparse
import logging
import random
import shutil
import sys
import time
@ -21,6 +20,7 @@ import time
from carla.client import make_carla_client
from carla.settings import CarlaSettings, Camera
from carla.tcp import TCPConnectionError
from carla.util import print_over_same_line
def run_carla_client(host, port, autopilot_on, save_images_to_disk, image_filename_format, settings):
@ -140,9 +140,7 @@ def print_player_measurements(player_measurements):
speed=player_measurements.forward_speed,
other_lane=100 * player_measurements.intersection_otherlane,
offroad=100 * player_measurements.intersection_offroad)
empty_space = shutil.get_terminal_size((80, 20)).columns - len(message)
sys.stdout.write('\r' + message + empty_space * ' ')
sys.stdout.flush()
print_over_same_line(message)
def main():

View File

@ -140,6 +140,7 @@ class CarlaGame(object):
player_start = np.random.randint(number_of_player_starts)
self.client.start_episode(player_start)
self._timer = Timer()
self._is_on_reverse = False
def _on_loop(self):
self._timer.tick()
@ -220,7 +221,7 @@ class CarlaGame(object):
def main():
argparser = argparse.ArgumentParser(description=__doc__)
argparser = argparse.ArgumentParser(description='CARLA Manual Control Client')
argparser.add_argument(
'-v', '--verbose',
action='store_true',