From 881e957216fe1aa9e0762146fda42d72a11c6b18 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 29 Jan 2019 20:43:37 +0100 Subject: [PATCH] Optimizations --- Docs/cameras_and_sensors.md | 2 ++ .../Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp | 2 +- .../Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Docs/cameras_and_sensors.md b/Docs/cameras_and_sensors.md index f54c0e914..f6f0cd394 100644 --- a/Docs/cameras_and_sensors.md +++ b/Docs/cameras_and_sensors.md @@ -317,6 +317,8 @@ This sensor, when attached to an actor, reports if there is obstacles ahead. | `hit_radius` | float | 0.5 | Radius of the trace | | `only_dynamics` | bool | false | If true, the trace will only look for dynamic objects | | `debug_linetrace` | bool | false | If true, the trace will be visible | +| `sensor_tick` | float | 0.0 | Seconds between sensor captures (ticks) | + This sensor produces [`carla.ObstacleDetectionSensorEvent`](python_api.md#carlaobstacledetectionsensoreventdata) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp index c4b16abe4..43e44c81e 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp @@ -447,7 +447,7 @@ void UActorBlueprintFunctionLibrary::MakeObstacleDetectorDefinitions( FActorDefinition &Definition) { Definition = MakeGenericSensorDefinition(TEXT("other"), TEXT("obstacle")); - + AddVariationsForSensor(Definition); // Distance. FActorVariation distance; distance.Id = TEXT("distance"); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp index 55a1898c8..d35db568b 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp @@ -33,11 +33,11 @@ void AObstacleDetectionSensor::Set(const FActorDescription &Description) Distance = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToFloat( "distance", Description.Variations, - Distance) * 100; + Distance) * 100.0f; HitRadius = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToFloat( "hit_radius", Description.Variations, - HitRadius) * 100; + HitRadius) * 100.0f; bOnlyDynamics = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToBool( "only_dynamics", Description.Variations,