Fixed gnss sensor

This commit is contained in:
Axel 2021-07-14 10:35:59 +02:00 committed by bernat
parent 2efbd4ec99
commit 54616a0240
1 changed files with 9 additions and 1 deletions

View File

@ -8,6 +8,7 @@
#include "Carla/Sensor/GnssSensor.h"
#include "Carla/Game/CarlaEpisode.h"
#include "Carla/Game/CarlaStatics.h"
#include "Carla/MapGen/LargeMapManager.h"
#include <compiler/disable-ue4-macros.h>
#include "carla/geom/Vector3D.h"
@ -34,7 +35,14 @@ void AGnssSensor::Set(const FActorDescription &ActorDescription)
void AGnssSensor::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
{
TRACE_CPUPROFILER_EVENT_SCOPE(AGnssSensor::PostPhysTick);
carla::geom::Location Location = GetActorLocation();
FVector ActorLocation = GetActorLocation();
ALargeMapManager * LargeMap = UCarlaStatics::GetLargeMapManager(GetWorld());
if (LargeMap)
{
ActorLocation = LargeMap->LocalToGlobalLocation(ActorLocation);
}
carla::geom::Location Location = ActorLocation;
carla::geom::GeoLocation CurrentLocation = CurrentGeoReference.Transform(Location);
// Compute the noise for the sensor