New weather defaults (#1753)

* Add default weather preset
* Update content link
This commit is contained in:
Néstor Subirón 2019-06-17 18:07:32 +02:00 committed by GitHub
parent 10c5f6a482
commit 5d71e556f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 18 deletions

View File

@ -16,6 +16,7 @@
* API extension: waypoint's `junction_id` that returns de OpenDrive identifier of the current junction
* API extension: add gamma value as attribute to RGB camera
* API extension: add `world.get_actor(id)` to find a single actor by id
* API extension: add `carla.WeatherParameters.Default` for a default (tailor-made for each town) weather profile
* API change: deprecated waypoint's `is_intersection`, now is `is_junction`
* API update: solve the problem of RuntimeError: std::bad_cast described here: #1125 (comment)
* Removed deprecated code and content

View File

@ -368,6 +368,7 @@
Static presets
- `carla.WeatherParameters.Default`
- `carla.WeatherParameters.ClearNoon`
- `carla.WeatherParameters.CloudyNoon`
- `carla.WeatherParameters.WetNoon`

View File

@ -11,21 +11,22 @@ namespace rpc {
using WP = WeatherParameters;
// cloudyness precip. prec.dep. wind azimuth altitude
WP WP::ClearNoon = { 15.0f, 0.0f, 00.0f, 0.35f, 0.0f, 75.0f};
WP WP::CloudyNoon = { 80.0f, 0.0f, 00.0f, 0.35f, 0.0f, 75.0f};
WP WP::WetNoon = { 20.0f, 0.0f, 50.0f, 0.35f, 0.0f, 75.0f};
WP WP::WetCloudyNoon = { 80.0f, 0.0f, 50.0f, 0.35f, 0.0f, 75.0f};
WP WP::MidRainyNoon = { 80.0f, 30.0f, 50.0f, 0.40f, 0.0f, 75.0f};
WP WP::HardRainNoon = { 90.0f, 60.0f, 100.0f, 1.0f, 0.0f, 75.0f};
WP WP::SoftRainNoon = { 70.0f, 15.0f, 50.0f, 0.35f, 0.0f, 75.0f};
WP WP::ClearSunset = { 15.0f, 0.0f, 00.0f, 0.35f, 0.0f, 15.0f};
WP WP::CloudySunset = { 80.0f, 0.0f, 00.0f, 0.35f, 0.0f, 15.0f};
WP WP::WetSunset = { 20.0f, 0.0f, 50.0f, 0.35f, 0.0f, 15.0f};
WP WP::WetCloudySunset = { 90.0f, 0.0f, 50.0f, 0.35f, 0.0f, 15.0f};
WP WP::MidRainSunset = { 80.0f, 30.0f, 50.0f, 0.40f, 0.0f, 15.0f};
WP WP::HardRainSunset = { 80.0f, 60.0f, 100.0f, 1.0f, 0.0f, 15.0f};
WP WP::SoftRainSunset = { 90.0f, 15.0f, 50.0f, 0.35f, 0.0f, 15.0f};
// cloudyness precip. prec.dep. wind azimuth altitude
WP WP::Default = { -1.0f, -1.0f, -1.0f, -1.00f, -1.0f, -1.0f};
WP WP::ClearNoon = { 15.0f, 0.0f, 0.0f, 0.35f, 0.0f, 75.0f};
WP WP::CloudyNoon = { 80.0f, 0.0f, 0.0f, 0.35f, 0.0f, 75.0f};
WP WP::WetNoon = { 20.0f, 0.0f, 50.0f, 0.35f, 0.0f, 75.0f};
WP WP::WetCloudyNoon = { 80.0f, 0.0f, 50.0f, 0.35f, 0.0f, 75.0f};
WP WP::MidRainyNoon = { 80.0f, 30.0f, 50.0f, 0.40f, 0.0f, 75.0f};
WP WP::HardRainNoon = { 90.0f, 60.0f, 100.0f, 1.00f, 0.0f, 75.0f};
WP WP::SoftRainNoon = { 70.0f, 15.0f, 50.0f, 0.35f, 0.0f, 75.0f};
WP WP::ClearSunset = { 15.0f, 0.0f, 0.0f, 0.35f, 0.0f, 15.0f};
WP WP::CloudySunset = { 80.0f, 0.0f, 0.0f, 0.35f, 0.0f, 15.0f};
WP WP::WetSunset = { 20.0f, 0.0f, 50.0f, 0.35f, 0.0f, 15.0f};
WP WP::WetCloudySunset = { 90.0f, 0.0f, 50.0f, 0.35f, 0.0f, 15.0f};
WP WP::MidRainSunset = { 80.0f, 30.0f, 50.0f, 0.40f, 0.0f, 15.0f};
WP WP::HardRainSunset = { 80.0f, 60.0f, 100.0f, 1.00f, 0.0f, 15.0f};
WP WP::SoftRainSunset = { 90.0f, 15.0f, 50.0f, 0.35f, 0.0f, 15.0f};
} // namespace rpc
} // namespace carla

View File

@ -21,6 +21,7 @@ namespace rpc {
/// @name Weather presets
/// @{
static WeatherParameters Default;
static WeatherParameters ClearNoon;
static WeatherParameters CloudyNoon;
static WeatherParameters WetNoon;

View File

@ -47,6 +47,7 @@ void export_weather() {
.def(self_ns::str(self_ns::self))
;
cls.attr("Default") = cr::WeatherParameters::Default;
cls.attr("ClearNoon") = cr::WeatherParameters::ClearNoon;
cls.attr("CloudyNoon") = cr::WeatherParameters::CloudyNoon;
cls.attr("WetNoon") = cr::WeatherParameters::WetNoon;

View File

@ -7,6 +7,10 @@
#include "Carla.h"
#include "Carla/Game/CarlaGameModeBase.h"
#include <compiler/disable-ue4-macros.h>
#include <carla/rpc/WeatherParameters.h>
#include <compiler/enable-ue4-macros.h>
ACarlaGameModeBase::ACarlaGameModeBase(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
@ -71,8 +75,6 @@ void ACarlaGameModeBase::InitGame(
if (WeatherClass != nullptr) {
Episode->Weather = World->SpawnActor<AWeather>(WeatherClass);
// Apply default weather.
Episode->Weather->ApplyWeather(FWeatherParameters());
} else {
UE_LOG(LogCarla, Error, TEXT("Missing weather class!"));
}
@ -109,6 +111,11 @@ void ACarlaGameModeBase::BeginPlay()
Episode->InitializeAtBeginPlay();
GameInstance->NotifyBeginEpisode(*Episode);
if (Episode->Weather != nullptr)
{
Episode->Weather->ApplyWeather(carla::rpc::WeatherParameters::Default);
}
/// @todo Recorder should not tick here, FCarlaEngine should do it.
// check if replayer is waiting to autostart
if (Recorder)

View File

@ -28,4 +28,4 @@
# http://carla-assets-internal.s3.amazonaws.com/Content/PUT_FILE_ID_HERE.tar.gz
0.9.5: 20190404_c7b464a
Latest: 20190529_26b47ad
Latest: 20190614_e5efb8d