20 : Super(ObjectInitializer)
22 PrimaryActorTick.bCanEverTick =
true;
23 RandomEngine = CreateDefaultSubobject<URandomEngine>(TEXT(
"RandomEngine"));
33 Super::Set(ActorDescription);
41 FVector ActorLocation = GetActorLocation();
63 #if defined(WITH_ROS2)
65 if (ROS2->IsEnabled())
67 TRACE_CPUPROFILER_EVENT_SCOPE_STR(
"ROS2 Send");
69 AActor* ParentActor = GetAttachParentActor();
72 FTransform LocalTransformRelativeToParent = GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform());
73 ROS2->ProcessDataFromGNSS(DataStream.GetSensorType(), StreamId, LocalTransformRelativeToParent,
carla::geom::GeoLocation{LatitudeValue, LongitudeValue, AltitudeValue},
this);
77 ROS2->ProcessDataFromGNSS(DataStream.GetSensorType(), StreamId, DataStream.GetSensorTransform(),
carla::geom::GeoLocation{LatitudeValue, LongitudeValue, AltitudeValue},
this);
82 TRACE_CPUPROFILER_EVENT_SCOPE_STR(
"AGnssSensor Stream Send");
float GetLongitudeDeviation() const
float GetAltitudeBias() const
void SetLatitudeDeviation(float Value)
float GetAltitudeDeviation() const
void SetLongitudeBias(float Value)
virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
void GetMirrorState(carla::multigpu::SensorState &State) const override
Multi-GPU: the runtime state this sensor starts its next tick from (noise generator,...
void SetLongitudeDeviation(float Value)
void SetAltitudeDeviation(float Value)
double GetAltitudeValue() const
float GetLatitudeDeviation() const
float GetLongitudeBias() const
void Set(const FActorDescription &ActorDescription)
carla::geom::GeoProjection CurrentGeoProjection
float GetLatitudeBias() const
void SetAltitudeBias(float Value)
void SetLatitudeBias(float Value)
double GetLongitudeValue() const
virtual void BeginPlay() override
static FActorDefinition GetSensorDefinition()
void SetMirrorState(const carla::multigpu::SensorState &State) override
AGnssSensor(const FObjectInitializer &ObjectInitializer)
double GetLatitudeValue() const
FVector LocalToGlobalLocation(const FVector &InLocation) const
auto GetToken() const
Return the token that allows subscribing to this sensor's stream.
FAsyncDataStream GetDataStream(SensorType &&Self)
Return the FDataStream associated with this sensor.
URandomEngine * RandomEngine
Random Engine used to provide noise for sensor output.
static void SetGnss(const FActorDescription &Description, AGnssSensor *Gnss)
static FActorDefinition MakeGnssDefinition()
const carla::geom::GeoProjection & GetGeoProjection() const
Return the geo projection of the map loaded.
static ALargeMapManager * GetLargeMapManager(const UObject *WorldContextObject)
static UCarlaEpisode * GetCurrentEpisode(const UObject *WorldContextObject)
uint32 GetState() const
The engine's state, to continue its exact sequence elsewhere (a Multi-GPU secondary's mirror of a sen...
float GetNormalDistribution(float Mean, float StandardDeviation)
void SetState(uint32 State)
Continue from State, as GetState returned it; an impossible value is ignored.
static std::shared_ptr< ROS2 > GetInstance()
Serializes a stream endpoint.
const auto & get_stream_id() const
A definition of a Carla Actor with all the variation and attributes.
A description of a Carla Actor with all its variation.
GeoLocation TransformToGeoLocation(const Location &location) const
Transform the given geo location to a location.
One record of frame data packet 27: the runtime state a sensor of the primary starts this frame's tic...