diff --git a/config/unreal_simulator.yaml b/config/unreal_simulator.yaml index 3c3c841..0c19ed1 100644 --- a/config/unreal_simulator.yaml +++ b/config/unreal_simulator.yaml @@ -36,7 +36,11 @@ ueds_world_level_name_enum: 3 # {"sand_dust_storm", 7}, # {"snow", 8}, # {"snow_blizzards", 9} -weather_type: "snow_blizzards" +weather_type: "rain" + +daytime: + hour: 7 + minute: 30 ############ Only Forest Procedural Generation settings ############ diff --git a/src/unreal_simulator.cpp b/src/unreal_simulator.cpp index 32f264f..906948c 100644 --- a/src/unreal_simulator.cpp +++ b/src/unreal_simulator.cpp @@ -274,6 +274,7 @@ class UnrealSimulator : public nodelet::Nodelet { int ueds_forest_density_ = 5; int ueds_forest_hilly_level_ = 3; std::string weather_type_; + ueds_connector::Daytime daytime_; std::vector last_rgb_ue_stamp_; std::vector last_rgb_seg_ue_stamp_; @@ -325,6 +326,8 @@ void UnrealSimulator::onInit() { param_loader.loadParam("ueds_forest_density", ueds_forest_density_); param_loader.loadParam("ueds_forest_hilly_level", ueds_forest_hilly_level_); param_loader.loadParam("weather_type", weather_type_); + param_loader.loadParam("daytime/hour", daytime_.hour); + param_loader.loadParam("daytime/minute", daytime_.minute); param_loader.loadParam("simulation_rate", _simulation_rate_); param_loader.loadParam("realtime_factor", drs_params_.realtime_factor); @@ -503,6 +506,20 @@ void UnrealSimulator::onInit() { ROS_ERROR("[UnrealSimulator]: Graphical Settings was not set succesfully to '%d'", graphicsSettings); } + res = ueds_game_controller_->SetWeather(ueds_connector::WeatherType::Type2Id().at(weather_type_)); + if (res) { + ROS_INFO("[UnrealSimulator]: SetWeather successful."); + } else { + ROS_ERROR("[UnrealSimulator]: SetWeather error"); + } + + res = ueds_game_controller_->SetDatetime(daytime_.hour, daytime_.minute); + if (res) { + ROS_INFO("[UnrealSimulator]: SetDatetime successful."); + } else { + ROS_ERROR("[UnrealSimulator]: SetDatetime error"); + } + // | --------------------- These graphical settings influence only Forest Game World --------------------- | @@ -520,13 +537,6 @@ void UnrealSimulator::onInit() { ROS_ERROR("[UnrealSimulator]: Forest Hilly Level wasn't set succesfully to '%d'", ueds_forest_hilly_level_); } - res = ueds_game_controller_->SetWeather(ueds_connector::WeatherType::Type2Id().at(weather_type_)); - if (res) { - ROS_INFO("[UnrealSimulator]: SetWeather successful."); - } else { - ROS_INFO("[UnrealSimulator]: SetWeather error !!!"); - } - std::this_thread::sleep_for(std::chrono::seconds(1)); // | --------------------- Spawn the UAVs --------------------- | diff --git a/tmux/one_drone/config/simulator.yaml b/tmux/one_drone/config/simulator.yaml index 9c67a75..58a9297 100644 --- a/tmux/one_drone/config/simulator.yaml +++ b/tmux/one_drone/config/simulator.yaml @@ -3,8 +3,8 @@ uav_names: [ ] ueds_graphics_settings_enum: 2 -ueds_world_level_name_enum: 1 -ueds_forest_hilly_level: 4 +ueds_world_level_name_enum: 2 +ueds_forest_hilly_level: 2 uav1: frame: "x500"