#32 Small fixes
This commit is contained in:
parent
db27bbb94b
commit
ea6a711559
|
@ -13,7 +13,6 @@ from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
import shutil
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@ -21,6 +20,7 @@ import time
|
||||||
from carla.client import make_carla_client
|
from carla.client import make_carla_client
|
||||||
from carla.settings import CarlaSettings, Camera
|
from carla.settings import CarlaSettings, Camera
|
||||||
from carla.tcp import TCPConnectionError
|
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):
|
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,
|
speed=player_measurements.forward_speed,
|
||||||
other_lane=100 * player_measurements.intersection_otherlane,
|
other_lane=100 * player_measurements.intersection_otherlane,
|
||||||
offroad=100 * player_measurements.intersection_offroad)
|
offroad=100 * player_measurements.intersection_offroad)
|
||||||
empty_space = shutil.get_terminal_size((80, 20)).columns - len(message)
|
print_over_same_line(message)
|
||||||
sys.stdout.write('\r' + message + empty_space * ' ')
|
|
||||||
sys.stdout.flush()
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -140,6 +140,7 @@ class CarlaGame(object):
|
||||||
player_start = np.random.randint(number_of_player_starts)
|
player_start = np.random.randint(number_of_player_starts)
|
||||||
self.client.start_episode(player_start)
|
self.client.start_episode(player_start)
|
||||||
self._timer = Timer()
|
self._timer = Timer()
|
||||||
|
self._is_on_reverse = False
|
||||||
|
|
||||||
def _on_loop(self):
|
def _on_loop(self):
|
||||||
self._timer.tick()
|
self._timer.tick()
|
||||||
|
@ -220,7 +221,7 @@ class CarlaGame(object):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
argparser = argparse.ArgumentParser(description=__doc__)
|
argparser = argparse.ArgumentParser(description='CARLA Manual Control Client')
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
'-v', '--verbose',
|
'-v', '--verbose',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
|
|
Loading…
Reference in New Issue