Changed weather presets and manual_control.py fixed (#2455)

* Added more weather attributes

* Upload client_test.py as weather in utils
Activate mesh distance fields

* weather.py --> Added wetness, changed "cloudyness" , fixed some functions
Weather.cpp --> Skip weather
Weather.h --> Added "SetWeather" Function

* Changed ASCII characters in weather.py

* Finished weather script without dynamic weather

* Added missing end of file line.

* Fixed the initial state of weather.py

* Updated changelog & fix dynamic weather altitude

* New default values for weather presets
Temporal fix in manual_control.py to refresh weather when it opens the pygame windows or it changes the camera (Tab)

* Fixed walkers spawn in manual_control

Co-authored-by: Marc Garcia Puig <marcgpuig@gmail.com>
Co-authored-by: doterop <daniel.oterop@gmail.com>
This commit is contained in:
Madecu 2020-02-25 12:18:37 +01:00 committed by GitHub
parent aa017da604
commit 36f6920fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -297,7 +297,8 @@ class KeyboardControl(object):
world.hud.notification("Press 'H' or '?' for help.", seconds=4.0)
def parse_events(self, client, world, clock):
current_lights = self._lights
if isinstance(self._control, carla.VehicleControl):
current_lights = self._lights
for event in pygame.event.get():
if event.type == pygame.QUIT:
return True
@ -378,6 +379,8 @@ class KeyboardControl(object):
world.player.set_autopilot(self._autopilot_enabled)
world.hud.notification(
'Autopilot %s' % ('On' if self._autopilot_enabled else 'Off'))
elif event.key == K_l and pygame.key.get_mods() & KMOD_CTRL:
current_lights ^= carla.VehicleLightState.Special1
elif event.key == K_l and pygame.key.get_mods() & KMOD_SHIFT:
current_lights ^= carla.VehicleLightState.HighBeam
elif event.key == K_l:

View File

@ -20,14 +20,14 @@ except IndexError:
import carla
SUN_PRESETS = {
'day': (90.0, 220.0),
'night': (-90.0, 220.0),
'sunset': (181.0, 100.0)}
'day': (60.0, 0.0),
'night': (-90.0, 0.0),
'sunset': (0.5, 180.0)}
WEATHER_PRESETS = {
'clear': [10.0, 0.0, 0.0, 5.0, 0.0, 50.0, 0.0],
'overcast': [80.0, 0.0, 0.0, 50.0, 0.0, 50.0, 10.0],
'rain': [100.0, 80.0, 90.0, 100.0, 20.0, 50.0, 100.0]}
'clear': [10.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0],
'overcast': [80.0, 0.0, 0.0, 50.0, 2.0, 0.0, 10.0],
'rain': [100.0, 80.0, 90.0, 100.0, 20.0, 0.0, 100.0]}
def apply_sun_presets(args, weather):