|
CARLA
|
A ray-cast based Radar sensor. More...
#include <Radar.h>
Inheritance diagram for ARadar:Classes | |
| struct | RayData |
Public Member Functions | |
| ARadar (const FObjectInitializer &ObjectInitializer) | |
| void | GetMirrorState (carla::multigpu::SensorState &State) const override |
| Multi-GPU: the runtime state this sensor starts its next tick from (noise generator, sweep angle, history). | |
| const FRadarData & | GetRadarData () const |
| void | Set (const FActorDescription &Description) override |
| void | SetHorizontalFOV (float NewHorizontalFOV) |
| void | SetMirrorState (const carla::multigpu::SensorState &State) override |
| void | SetPointsPerSecond (int NewPointsPerSecond) |
| void | SetRange (float NewRange) |
| void | SetVerticalFOV (float NewVerticalFOV) |
Public Member Functions inherited from ASensor | |
| bool | AreClientsListening () |
| ASensor (const FObjectInitializer &ObjectInitializer) | |
| void | ClearReadyToTick () |
| std::optional< FActorAttribute > | GetAttribute (const FString Name) |
| const UCarlaEpisode & | GetEpisode () const |
| URandomEngine * | GetRandomEngine () |
| float | GetReadyToTickDeltaSeconds () const |
| int32 | GetSeed () const |
| auto | GetToken () const |
| Return the token that allows subscribing to this sensor's stream. | |
| bool | IsReadyToTick () const |
| bool | IsStreamReady () |
| FDataStream | MoveDataStream () |
| virtual void | OnFirstClientConnected () |
| virtual void | OnLastClientDisconnected () |
| void | PostPhysTickInternal (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
| virtual void | PrePhysTick (float DeltaSeconds) |
| void | SetDataStream (FDataStream InStream) |
| Replace the FDataStream associated with this sensor. | |
| void | SetEpisode (const UCarlaEpisode &InEpisode) |
| void | SetPrimaryTick (float DeltaSeconds) |
| Multi-GPU secondary: tick in this engine frame, with the primary's delta. | |
| void | SetSavingDataToDisk (bool bSavingData) |
| void | SetSeed (int32 InSeed) |
| void | Tick (const float DeltaTime) final |
Static Public Member Functions | |
| static FActorDefinition | GetSensorDefinition () |
Static Public Member Functions inherited from ASensor | |
| static FSensorCaptureContext | MakeCaptureContext (const ASensor &Sensor) |
| Call on the game thread right after CaptureScene(). | |
Protected Member Functions | |
| void | BeginPlay () override |
| virtual void | PostPhysTick (UWorld *World, ELevelTick TickType, float DeltaTime) override |
Protected Member Functions inherited from ASensor | |
| void | EndPlay (EEndPlayReason::Type EndPlayReason) override |
| template<typename SensorType > | |
| FAsyncDataStream | GetDataStream (SensorType &&Self) |
| Return the FDataStream associated with this sensor. | |
| void | PostActorCreated () override |
Protected Attributes | |
| float | HorizontalFOV |
| int | PointsPerSecond |
| float | Range |
| float | VerticalFOV |
Protected Attributes inherited from ASensor | |
| bool | bIsActive = false |
| bool | bSavingDataToDisk = false |
| URandomEngine * | RandomEngine = nullptr |
| Random Engine used to provide noise for sensor output. | |
| int32 | Seed = 123456789 |
| Seed of the pseudo-random engine. | |
Private Types | |
| using | FRadarData = carla::sensor::data::RadarData |
Private Member Functions | |
| void | CalculateCurrentVelocity (const float DeltaTime) |
| float | CalculateRelativeVelocity (const FHitResult &OutHit, const FVector &RadarLocation) |
| void | SendLineTraces (float DeltaTime) |
Private Attributes | |
| FVector | CurrentVelocity |
| FVector | PrevLocation |
| Used to compute the velocity of the radar. | |
| FRadarData | RadarData |
| std::vector< RayData > | Rays |
| FCollisionQueryParams | TraceParams |
Additional Inherited Members | |
Static Protected Member Functions inherited from ASensor | |
| template<typename SensorType , typename ElementType > | |
| static void | SendDataToClient (SensorType &&Sensor, TArrayView< ElementType > SensorData, const FSensorCaptureContext &CaptureContext) |
|
private |
| ARadar::ARadar | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 29 of file Radar.cpp.
References ASensor::RandomEngine, and TraceParams.
|
overrideprotectedvirtual |
|
private |
Definition at line 116 of file Radar.cpp.
References CurrentVelocity, and PrevLocation.
Referenced by PostPhysTick().
|
private |
Definition at line 211 of file Radar.cpp.
References CurrentVelocity.
Referenced by SendLineTraces().
|
overridevirtual |
Multi-GPU: the runtime state this sensor starts its next tick from (noise generator, sweep angle, history).
Override only for sensors whose PostPhysTick runs whether or not anyone listens: the primary's sensor owns the state of a sensor computed by a secondary.
Reimplemented from ASensor.
Definition at line 225 of file Radar.cpp.
References UCarlaStatics::GetLargeMapManager(), URandomEngine::GetState(), ALargeMapManager::LocalToGlobalLocation(), PrevLocation, ASensor::RandomEngine, and State.
| const carla::sensor::data::RadarData & ARadar::GetRadarData | ( | ) | const |
|
static |
Definition at line 24 of file Radar.cpp.
References UActorBlueprintFunctionLibrary::MakeRadarDefinition().
|
overrideprotectedvirtual |
Reimplemented from ASensor.
Definition at line 80 of file Radar.cpp.
References CalculateCurrentVelocity(), carla::streaming::detail::token_type::get_stream_id(), ASensor::GetDataStream(), carla::ros2::ROS2::GetInstance(), ASensor::GetToken(), PostPhysTick(), RadarData, carla::sensor::data::RadarData::Reset(), and SendLineTraces().
Referenced by PostPhysTick().
|
private |
Definition at line 123 of file Radar.cpp.
References CalculateRelativeVelocity(), URandomEngine::GetUniformFloat(), URandomEngine::GetUniformFloatInRange(), HorizontalFOV, PointsPerSecond, RadarData, ASensor::RandomEngine, Range, Rays, SendLineTraces(), TraceParams, VerticalFOV, and carla::sensor::data::RadarData::WriteDetection().
Referenced by PostPhysTick(), and SendLineTraces().
|
overridevirtual |
Reimplemented from ASensor.
Definition at line 42 of file Radar.cpp.
References UActorBlueprintFunctionLibrary::SetRadar().
| void ARadar::SetHorizontalFOV | ( | float | NewHorizontalFOV | ) |
Definition at line 48 of file Radar.cpp.
References HorizontalFOV.
|
overridevirtual |
Reimplemented from ASensor.
Definition at line 237 of file Radar.cpp.
References UCarlaStatics::GetLargeMapManager(), ALargeMapManager::GlobalToLocalLocation(), PrevLocation, ASensor::RandomEngine, URandomEngine::SetState(), and State.
| void ARadar::SetPointsPerSecond | ( | int | NewPointsPerSecond | ) |
Definition at line 63 of file Radar.cpp.
References PointsPerSecond, RadarData, and carla::sensor::data::RadarData::SetResolution().
| void ARadar::SetVerticalFOV | ( | float | NewVerticalFOV | ) |
Definition at line 53 of file Radar.cpp.
References VerticalFOV.
|
private |
Definition at line 82 of file Radar.h.
Referenced by CalculateCurrentVelocity(), and CalculateRelativeVelocity().
|
protected |
Definition at line 62 of file Radar.h.
Referenced by SendLineTraces(), and SetHorizontalFOV().
|
protected |
Definition at line 68 of file Radar.h.
Referenced by SendLineTraces(), and SetPointsPerSecond().
|
private |
Used to compute the velocity of the radar.
Definition at line 85 of file Radar.h.
Referenced by BeginPlay(), CalculateCurrentVelocity(), GetMirrorState(), and SetMirrorState().
|
private |
Definition at line 78 of file Radar.h.
Referenced by GetRadarData(), PostPhysTick(), SendLineTraces(), and SetPointsPerSecond().
|
protected |
Definition at line 59 of file Radar.h.
Referenced by SendLineTraces(), and SetRange().
|
private |
Definition at line 96 of file Radar.h.
Referenced by SendLineTraces().
|
private |
Definition at line 80 of file Radar.h.
Referenced by ARadar(), and SendLineTraces().
|
protected |
Definition at line 65 of file Radar.h.
Referenced by SendLineTraces(), and SetVerticalFOV().