Agrarsense
|
#include <Radar.h>
Classes | |
struct | FRadarDetection |
struct | RadarData |
struct | RayData |
Public Member Functions | |
ARadar (const FObjectInitializer &ObjectInitializer) | |
void | Init (FRadarParameters parameters, bool SimulateSensor=true) |
virtual ESensorTypes | GetSensorType () const override |
void | ChangeRadarParameters (FRadarParameters Parameters) |
void | SetVisualizeParticles (bool Visualize) |
FRadarParameters | GetRadarParameters () |
virtual FString | GetParametersAsString () const override |
Public Member Functions inherited from ASensor | |
ASensor (const FObjectInitializer &ObjectInitializer) | |
FString | ExportToJsonFile (const FString &FileName) |
virtual ESensorTypes | GetSensorType () const |
FString | GetSensorIdentifier () const |
void | SetSensorIdentifier (const FString newIdentifier) |
FString | GetSensorName () const |
virtual FString | GetParametersAsString () const |
void | SetSensorName (const FString newName) |
virtual FString | GetTopicName () |
UTopic * | GetROSTopic () const |
void | SetSimulateSensor (bool SimulateSensor) |
bool | CanSimulateSensor () const |
ASensorModel * | GetSensorModel () const |
void | SetSensorModel (ASensorModel *NewSensorModel) |
bool | IsROSConnected () const |
UROSIntegrationGameInstance * | GetROSGameInstance () const |
virtual FString | GetActorID_Implementation () const override |
virtual FString | GetActorName_Implementation () const override |
virtual FString | GetActorInformation_Implementation () const override |
virtual void | SetActorName_Implementation (const FString &NewActorName) override |
virtual void | SetActorIDAndName_Implementation (const FString &NewActorName, const FString &NewID) override |
Public Member Functions inherited from IActorInformation | |
FString | GetActorID () const |
FString | GetActorName () const |
FString | GetActorInformation () const |
void | SetActorName (const FString &NewActorName) |
void | SetActorIDAndName (const FString &NewActorName, const FString &NewID) |
Private Member Functions | |
void | BeginPlay () override |
virtual void | Tick (float DeltaTime) override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
void | SendRadarData () |
void | SetRadarParameters (FRadarParameters Parameters) |
void | CalculateCurrentVelocity (const float DeltaTime) |
void | SimulateRadar (float DeltaTime) |
float | CalculateRelativeVelocity (const FHitResult &OutHit, const FVector &RadarLocation, const FVector ActorVelocity) |
Private Attributes | |
UNiagaraComponent * | NiagaraComponent |
bool | VisualizeParticles = false |
TArray< FVector > | HitLocations |
FRadarParameters | RadarParameters |
FRadarParameters | TempRadarParameters |
FVector | CurrentVelocity |
FVector | PrevLocation |
std::vector< RayData > | Rays |
std::vector< FRadarDetection > | detections |
UWorld * | World = nullptr |
bool | RadarParametersChanged = false |
TSharedPtr< ROSMessages::sensor_msgs::PointCloud2 > | RadarMessage |
Additional Inherited Members | |
Static Public Member Functions inherited from ASensor | |
static void | HideComponentForAllCameras (UPrimitiveComponent *PrimitiveComponent) |
static TMap< FString, FColor > | GetSemanticColors () |
static TArray< TWeakObjectPtr< UPrimitiveComponent > > | GetComponentsToHide () |
Static Public Member Functions inherited from IActorInformation | |
static void | SetAndValidateActorIDAndName (FString &ActorName, FString &ActorID, TWeakObjectPtr< AActor > Actor) |
static bool | DestroyActorByID (const FString &ID) |
static AActor * | GetActorByID (const FString &ID) |
template<typename T > | |
static TArray< T * > | GetActorsWithInterface () |
static void | PrintAllIds () |
Public Attributes inherited from ASensor | |
FSensorDestroy | OnSensorDestroy |
FString | AttachedToComponent |
FName | AttachedToBone |
Protected Member Functions inherited from ASensor | |
virtual void | BeginPlay () override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
virtual void | CreateROSTopic () |
virtual void | DestroyROSTopic () |
virtual void | CreateDataSavePath () |
bool | IsLogFileCreated () |
virtual void | CreateLogFile () |
void | WriteToLogFile (const FString &Message) |
Static Protected Member Functions inherited from ASensor | |
template<typename InStructType > | |
static FString | StructToString (const InStructType &InStruct) |
Protected Attributes inherited from ASensor | |
UTopic * | ROSTopic = nullptr |
bool | SendDataToROS = true |
ULogFile * | LogFile = nullptr |
FString | FileSavePath |
UROSIntegrationGameInstance * | ROSInstance = nullptr |
Static Protected Attributes inherited from ASensor | |
static FPrimitiveAdded | OnPrimitiveAdded |
static const FName | NiagaraPointsInt = "User.PointCount" |
static const FName | NiagaraHitPoints = "User.HitPoints" |
static const FName | NiagaraHitColors = "User.HitColors" |
static const FName | NiagaraPointsFloat = "User.Test" |
ARadar::ARadar | ( | const FObjectInitializer & | ObjectInitializer | ) |
|
overrideprivatevirtual |
Reimplemented from ASensor.
Definition at line 55 of file Radar.cpp.
References PrevLocation, RadarMessage, and World.
|
private |
Definition at line 188 of file Radar.cpp.
References CurrentVelocity, and PrevLocation.
Referenced by SimulateRadar().
|
private |
Definition at line 340 of file Radar.cpp.
References CurrentVelocity.
Referenced by SimulateRadar().
void ARadar::ChangeRadarParameters | ( | FRadarParameters | Parameters | ) |
Change Radar parameters at the end of this frame
FRadarParameters | struct |
Definition at line 152 of file Radar.cpp.
References ASensor::CanSimulateSensor(), RadarParametersChanged, SetRadarParameters(), and TempRadarParameters.
|
overrideprivatevirtual |
Reimplemented from ASensor.
Definition at line 111 of file Radar.cpp.
References detections, HitLocations, NiagaraComponent, RadarMessage, Rays, and World.
|
inlineoverridevirtual |
Get current LidarParameters struct fields as one string.
Reimplemented from ASensor.
|
inline |
Get current Radar parameters
Definition at line 64 of file Radar.h.
Referenced by USimulatorJsonExporter::ExportSensorToJSON().
|
inlineoverridevirtual |
void ARadar::Init | ( | FRadarParameters | parameters, |
bool | SimulateSensor = true |
||
) |
Initialize new Radar sensor
parameters | FRadarParameters struct |
Definition at line 22 of file Radar.cpp.
References ASensor::CreateROSTopic(), ASensor::HideComponentForAllCameras(), NiagaraComponent, SetRadarParameters(), ASensor::SetSimulateSensor(), and World.
Referenced by USensorFactory::SpawnRadar().
|
private |
Definition at line 353 of file Radar.cpp.
References detections, ASensor::GetROSTopic(), RadarMessage, ASensor::SendDataToROS, and ARadar::RadarData::velocity.
Referenced by SimulateRadar().
|
private |
Definition at line 176 of file Radar.cpp.
References detections, FRadarParameters::PointsPerSecond, RadarParameters, FRadarParameters::SendDataToRos, ASensor::SendDataToROS, VisualizeParticles, and FRadarParameters::VisualizeRadarHits.
Referenced by ChangeRadarParameters(), Init(), and Tick().
void ARadar::SetVisualizeParticles | ( | bool | Visualize | ) |
Set visualize this radar particles with Niagara particle system
visualize | boolean |
Definition at line 167 of file Radar.cpp.
References NiagaraComponent, and VisualizeParticles.
|
private |
Definition at line 195 of file Radar.cpp.
References CalculateCurrentVelocity(), CalculateRelativeVelocity(), detections, HitLocations, FRadarParameters::HorizontalFOV, NiagaraComponent, ASensor::NiagaraHitPoints, ASensor::NiagaraPointsFloat, ASensor::NiagaraPointsInt, FRadarParameters::PointsPerSecond, RadarParameters, FRadarParameters::Range, Rays, SendRadarData(), SimulateRadar(), FRadarParameters::VerticalFOV, VisualizeParticles, and World.
Referenced by SimulateRadar(), and Tick().
|
overrideprivatevirtual |
Definition at line 134 of file Radar.cpp.
References ASensor::CanSimulateSensor(), RadarParametersChanged, SetRadarParameters(), SimulateRadar(), TempRadarParameters, and Tick().
Referenced by Tick().
|
private |
Definition at line 107 of file Radar.h.
Referenced by CalculateCurrentVelocity(), and CalculateRelativeVelocity().
|
private |
Definition at line 132 of file Radar.h.
Referenced by EndPlay(), SendRadarData(), SetRadarParameters(), and SimulateRadar().
|
private |
Definition at line 93 of file Radar.h.
Referenced by EndPlay(), and SimulateRadar().
|
private |
Definition at line 88 of file Radar.h.
Referenced by EndPlay(), Init(), SetVisualizeParticles(), and SimulateRadar().
|
private |
Definition at line 110 of file Radar.h.
Referenced by BeginPlay(), and CalculateCurrentVelocity().
|
private |
Definition at line 149 of file Radar.h.
Referenced by BeginPlay(), EndPlay(), and SendRadarData().
|
private |
Definition at line 95 of file Radar.h.
Referenced by SetRadarParameters(), and SimulateRadar().
|
private |
Definition at line 136 of file Radar.h.
Referenced by ChangeRadarParameters(), and Tick().
|
private |
Definition at line 131 of file Radar.h.
Referenced by EndPlay(), and SimulateRadar().
|
private |
Definition at line 97 of file Radar.h.
Referenced by ChangeRadarParameters(), and Tick().
|
private |
Definition at line 90 of file Radar.h.
Referenced by SetRadarParameters(), SetVisualizeParticles(), and SimulateRadar().
|
private |
Definition at line 134 of file Radar.h.
Referenced by BeginPlay(), EndPlay(), Init(), and SimulateRadar().