From 3b86f58e6848b130e5dfae8ba9a1432d83b0d045 Mon Sep 17 00:00:00 2001 From: LuisPoveda Date: Tue, 21 Feb 2023 13:01:48 +0100 Subject: [PATCH] Avoid sensors to go dormant if they are far from vehicle. --- .../Plugins/Carla/Source/Carla/MapGen/LargeMapManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/LargeMapManager.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/LargeMapManager.cpp index 584ca9524..5e5cb4f87 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/LargeMapManager.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/LargeMapManager.cpp @@ -777,7 +777,7 @@ void ALargeMapManager::CheckActiveActors() float DistanceSquared = (RelativeLocation - HeroLocation).SizeSquared(); - if (DistanceSquared > ActorStreamingDistanceSquared) + if (DistanceSquared > ActorStreamingDistanceSquared && View->GetActorType() != FCarlaActor::ActorType::Sensor) { // Save to temporal container. Later will be converted to dormant ActiveToDormantActors.Add(Id); @@ -1076,7 +1076,7 @@ void ALargeMapManager::PrintMapInfo() int LastMsgIndex = TilesDistMsgIndex; GEngine->AddOnScreenDebugMessage(LastMsgIndex++, MsgTime, FColor::White, FString::Printf(TEXT("\nActor Global Position: %s km"), *(FDVector(CurrentActorPosition) / (1000.0 * 100.0)).ToString()) ); - + FIntVector CurrentTile = GetTileVectorID(CurrentActorPosition); GEngine->AddOnScreenDebugMessage(LastMsgIndex++, MsgTime, FColor::White, FString::Printf(TEXT("\nActor Current Tile: %d_%d"), CurrentTile.X, CurrentTile.Y ));