Skip to content

Commit e78ccc6

Browse files
authored
Rain particles and Update.sh fixes (carla-simulator#2814)
* Fixed camera weather changes * Updated changelog * Fixed Update.sh when root path contains and space
1 parent 0124a47 commit e78ccc6

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## Latest
22

3-
* Added API function **add_angular_impulse** to add angular impulse to any actor
3+
* Added API function `add_angular_impulse()` to add angular impulse to any actor
4+
* Fixed rain drop spawn issues when spawning camera sensors
5+
* Fixed Update.sh from failing when the root folder contains a space on it
46

57
## CARLA 0.9.9
68

@@ -21,7 +23,7 @@
2123
* API extensions:
2224
- Added new methods to `Map`: `get_all_landmarks`, `get_all_landmarks_from_id` and `get_all_landmarks_of_type`
2325
* Added synchronization of traffic lights in sumo co-simulation
24-
* Added light manager to control the lights of the map.
26+
* Added light manager to control the lights of the map
2527

2628
## CARLA 0.9.8
2729

Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,10 @@ void ASceneCaptureSensor::BeginPlay()
461461
SceneCaptureSensor_local_ns::ConfigureShowFlags(CaptureComponent2D->ShowFlags,
462462
bEnablePostProcessingEffects);
463463

464+
// This ensures the camera is always spawning the rain drops in case the
465+
// weather was previously set to has rain
466+
GetEpisode().GetWeather()->NotifyWeather();
467+
464468
Super::BeginPlay();
465469
}
466470

Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Weather/Weather.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ void AWeather::ApplyWeather(const FWeatherParameters &InWeather)
3535
RefreshWeather(Weather);
3636
}
3737

38+
void AWeather::NotifyWeather()
39+
{
40+
// Call the blueprint that actually changes the weather.
41+
RefreshWeather(Weather);
42+
}
43+
3844
void AWeather::SetWeather(const FWeatherParameters &InWeather)
3945
{
4046
Weather = InWeather;

Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Weather/Weather.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ class CARLA_API AWeather : public AActor
2121

2222
AWeather(const FObjectInitializer& ObjectInitializer);
2323

24-
/* Update the weather parameters and notifies it to the blueprint's event
25-
*/
24+
/// Update the weather parameters and notifies it to the blueprint's event
2625
UFUNCTION(BlueprintCallable)
2726
void ApplyWeather(const FWeatherParameters &WeatherParameters);
2827

29-
/* Update the weather parameters without notifing it to the blueprint's event
30-
*/
28+
/// Notifing the weather to the blueprint's event
29+
void NotifyWeather();
30+
31+
/// Update the weather parameters without notifing it to the blueprint's event
3132
UFUNCTION(BlueprintCallable)
3233
void SetWeather(const FWeatherParameters &WeatherParameters);
3334

34-
/* Returns the current WeatherParameters
35-
*/
35+
/// Returns the current WeatherParameters
3636
UFUNCTION(BlueprintCallable)
3737
const FWeatherParameters &GetCurrentWeather() const
3838
{

Update.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ done
4444
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4545
pushd "$SCRIPT_DIR" >/dev/null
4646

47-
CONTENT_FOLDER=$SCRIPT_DIR/Unreal/CarlaUE4/Content/Carla
47+
CONTENT_FOLDER="${SCRIPT_DIR}/Unreal/CarlaUE4/Content/Carla"
4848

4949
CONTENT_ID=$(tac $SCRIPT_DIR/Util/ContentVersions.txt | egrep -m 1 . | rev | cut -d' ' -f1 | rev)
5050
CONTENT_LINK=http://carla-assets.s3.amazonaws.com/${CONTENT_ID}.tar.gz
5151

52-
VERSION_FILE=${CONTENT_FOLDER}/.version
52+
VERSION_FILE="${CONTENT_FOLDER}/.version"
5353

5454
function download_content {
5555
if [[ -d "$CONTENT_FOLDER" ]]; then
5656
echo "Backing up existing Content..."
5757
mv -v "$CONTENT_FOLDER" "${CONTENT_FOLDER}_$(date +%Y%m%d%H%M%S)"
5858
fi
59-
mkdir -p $CONTENT_FOLDER
59+
mkdir -p "$CONTENT_FOLDER"
6060
mkdir -p Content
6161
if hash aria2c 2>/dev/null; then
6262
echo -e "${CONTENT_LINK}\n\tout=Content.tar.gz" > .aria2c.input
@@ -67,7 +67,7 @@ function download_content {
6767
fi
6868
tar -xvzf Content.tar.gz -C Content
6969
rm Content.tar.gz
70-
mv Content/* $CONTENT_FOLDER
70+
mv Content/* "$CONTENT_FOLDER"
7171
rm -rf Content
7272
echo "$CONTENT_ID" > "$VERSION_FILE"
7373
echo "Content updated successfully."

0 commit comments

Comments
 (0)