Fixed gnss sensor
This commit is contained in:
parent
2efbd4ec99
commit
54616a0240
|
@ -8,6 +8,7 @@
|
||||||
#include "Carla/Sensor/GnssSensor.h"
|
#include "Carla/Sensor/GnssSensor.h"
|
||||||
#include "Carla/Game/CarlaEpisode.h"
|
#include "Carla/Game/CarlaEpisode.h"
|
||||||
#include "Carla/Game/CarlaStatics.h"
|
#include "Carla/Game/CarlaStatics.h"
|
||||||
|
#include "Carla/MapGen/LargeMapManager.h"
|
||||||
|
|
||||||
#include <compiler/disable-ue4-macros.h>
|
#include <compiler/disable-ue4-macros.h>
|
||||||
#include "carla/geom/Vector3D.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)
|
void AGnssSensor::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
|
||||||
{
|
{
|
||||||
TRACE_CPUPROFILER_EVENT_SCOPE(AGnssSensor::PostPhysTick);
|
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);
|
carla::geom::GeoLocation CurrentLocation = CurrentGeoReference.Transform(Location);
|
||||||
|
|
||||||
// Compute the noise for the sensor
|
// Compute the noise for the sensor
|
||||||
|
|
Loading…
Reference in New Issue