|
Agrarsense
|
#include <OverlapSensor.h>


Public Member Functions | |
| AOverlapSensor (const FObjectInitializer &ObjectInitializer) | |
| void | Init (FOverlapSensorParameters InParameters) |
| virtual ESensorTypes | GetSensorType () const override |
| void | SetOverlapBounds (const FVector &NewSize) |
| void | SetVisualizeOverlapArea (bool Visualize) |
| void | SetOverlapRelativePosition (const FVector &Vector) |
| void | SetOverlapResponseToAllChannels (const ECollisionResponse Response) |
| bool | IsVisualizingOverlapArea () const |
| 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 |
| AVehicle * | IsAttachedToVehicle () const |
| void | SetSensorName (const FString newName) |
| FString | GetTopicName () |
| UTopic * | GetROSTopic () const |
| void | SetSimulateSensor (bool SimulateSensor) |
| bool | CanSimulateSensor () const |
| ASensorModel * | GetSensorModel () const |
| void | SetSensorModel (ASensorModel *NewSensorModel) |
| FORCEINLINE 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 |
| void | SetParentActorPtr (AActor *ParentActorPtr) |
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) |
Protected Member Functions | |
| void | OnOverlapBegin (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult) |
| void | OnOverlapEnd (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex) |
| FORCEINLINE bool | IsValidOverlap (const AActor *OtherActor, const UPrimitiveComponent *OtherComp) const |
Protected Member Functions inherited from ASensor | |
| virtual void | BeginPlay () override |
| virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
| FString | CreateTimeStampString () const |
| virtual void | CreateROSTopic () |
| virtual void | DestroyROSTopic () |
| virtual void | CreateDataSavePath () |
| bool | IsLogFileCreated () |
| virtual void | CreateLogFile () |
| void | WriteToLogFile (const FString &Message) |
Protected Attributes | |
| UBoundsVisualizerComponent * | BoundsComponent = nullptr |
Protected Attributes inherited from ASensor | |
| UTopic * | ROSTopic = nullptr |
| bool | SendDataToROS = true |
| ULogFile * | LogFile = nullptr |
| AActor * | ParentActor = nullptr |
| FString | FileSavePath |
| UROSIntegrationGameInstance * | ROSInstance = nullptr |
Private Member Functions | |
| virtual void | BeginPlay () override |
| virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
| void | BuildAndSendMessage (const FString &Prefix, AActor *Actor, UPrimitiveComponent *Comp, int32 Index) |
| void | CreateDataSavePath () override |
| void | CreateLogFile () override |
| FString | TryGetID (AActor *Actor) |
Private Attributes | |
| TSharedPtr< ROSMessages::std_msgs::String > | ROSMessage |
| FOverlapSensorParameters | Parameters |
| AVehicle * | Vehicle = nullptr |
| FString | VehicleName |
| FString | VehicleID |
| bool | IsVisible = false |
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 |
Static Protected Member Functions inherited from ASensor | |
| template<typename InStructType > | |
| static FString | StructToString (const InStructType &InStruct) |
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" |
Overlap sensor is a sensor that detects overlap starts and ends with objects in the simulation. Allowed overlapped components: StaticMeshComponent, InstancedStaticMeshComponent and SkeletalMeshComponent. All other components are ignored.
Definition at line 28 of file OverlapSensor.h.
| AOverlapSensor::AOverlapSensor | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 20 of file OverlapSensor.cpp.
References BoundsComponent.
|
overrideprivatevirtual |
Reimplemented from ASensor.
Definition at line 106 of file OverlapSensor.cpp.
References BoundsComponent, OnOverlapBegin(), and OnOverlapEnd().
|
private |
Definition at line 203 of file OverlapSensor.cpp.
References ASensor::CreateTimeStampString(), ASensor::GetROSTopic(), ASensor::IsROSConnected(), ROSMessage, TryGetID(), Vehicle, and ASensor::WriteToLogFile().
Referenced by OnOverlapBegin(), and OnOverlapEnd().
|
overrideprivatevirtual |
Creates data save path for this sensor. Can be overriden if needed.
Reimplemented from ASensor.
Definition at line 289 of file OverlapSensor.cpp.
References ASensor::FileSavePath, ASensor::GetActorID_Implementation(), UAgrarsensePaths::GetDataFolder(), and ASensor::IsAttachedToVehicle().
Referenced by CreateLogFile().
|
overrideprivatevirtual |
Create Text file for this sensor if it has not been created already. Text file will be created to ROOT/Data/Run/Logs directory. Filename will be SensorName_ID_UnixTimestamp.txt Can be overriden by individual sensor if needed.
Reimplemented from ASensor.
Definition at line 308 of file OverlapSensor.cpp.
References ULogFile::Create(), CreateDataSavePath(), FLogFileSettings::FileCreationOptions, FLogFileSettings::FilePath, ASensor::FileSavePath, FLogFileSettings::FileWriteOptions, ASensor::IsAttachedToVehicle(), FLogFileSettings::KeepFileOpen, ASensor::LogFile, FLogFileSettings::OverrideFilePath, Overwrite, Queue, FLogFileSettings::QueueLength, and FLogFileSettings::Timestamp.
Referenced by Init().
|
overrideprivatevirtual |
Reimplemented from ASensor.
Definition at line 114 of file OverlapSensor.cpp.
References BoundsComponent, OnOverlapBegin(), and OnOverlapEnd().
|
inlineoverridevirtual |
Get this sensor parameters as string
Reimplemented from ASensor.
Definition at line 82 of file OverlapSensor.h.
|
inlineoverridevirtual |
Get type of the sensor
Reimplemented from ASensor.
Definition at line 43 of file OverlapSensor.h.
References Overlap.
| void AOverlapSensor::Init | ( | FOverlapSensorParameters | InParameters | ) |
Definition at line 31 of file OverlapSensor.cpp.
References FOverlapSensorParameters::AllChannels, BoundsComponent, CreateLogFile(), FOverlapSensorParameters::CreateROSTopic, ASensor::CreateROSTopic(), FOverlapSensorParameters::OwningActor, Parameters, FOverlapSensorParameters::RelativePosition, ROSMessage, SetOverlapBounds(), ASensor::SetSimulateSensor(), FOverlapSensorParameters::Size, Vehicle, VehicleID, and VehicleName.
Referenced by USensorFactory::SpawnOverlapSensor().
|
protected |
Definition at line 191 of file OverlapSensor.cpp.
Referenced by OnOverlapBegin(), and OnOverlapEnd().
|
inline |
Definition at line 77 of file OverlapSensor.h.
|
protected |
Definition at line 175 of file OverlapSensor.cpp.
References BuildAndSendMessage(), and IsValidOverlap().
Referenced by BeginPlay(), and EndPlay().
|
protected |
Definition at line 183 of file OverlapSensor.cpp.
References BuildAndSendMessage(), and IsValidOverlap().
Referenced by BeginPlay(), and EndPlay().
| void AOverlapSensor::SetOverlapBounds | ( | const FVector & | NewSize | ) |
Set this Overlap sensor Overlap bounds.
Definition at line 122 of file OverlapSensor.cpp.
References BoundsComponent, SimulatorLog::Log(), Parameters, and FOverlapSensorParameters::Size.
Referenced by APIDDrone::ChangeDroneParameters(), UROSCommands::HandleChangeOverlapSensorBounds(), Init(), and AVehicle::SetVehicleParameters().
| void AOverlapSensor::SetOverlapRelativePosition | ( | const FVector & | Vector | ) |
Set this Overlap sensor relative position to parent.
Definition at line 148 of file OverlapSensor.cpp.
References BoundsComponent, SimulatorLog::Log(), Parameters, and FOverlapSensorParameters::RelativePosition.
Referenced by UROSCommands::HandleChangeOverlapSensorPosition().
| void AOverlapSensor::SetOverlapResponseToAllChannels | ( | const ECollisionResponse | Response | ) |
Set this sensor overlap response.
| Response | The desired collision response. ECR_Overlap: Allows all overlaps to be recognized. ECR_Ignore: Allows only Walker overlaps to be recognized. Other than ECR_Overlap or ECR_Ignore is ignored. |
Definition at line 161 of file OverlapSensor.cpp.
References BoundsComponent.
| void AOverlapSensor::SetVisualizeOverlapArea | ( | bool | Visualize | ) |
Set this Overlap sensor bounds visulization on or off.
Definition at line 138 of file OverlapSensor.cpp.
References BoundsComponent, and IsVisible.
Referenced by APIDDrone::ChangeDroneParameters(), UROSCommands::HandleVisualizeOverlapSensorsBounds(), AVehicle::SetVehicleParameters(), and AVehicle::SetVisualizeVehicleOverlapArea().
|
private |
Definition at line 343 of file OverlapSensor.cpp.
Referenced by BuildAndSendMessage().
|
protected |
Definition at line 98 of file OverlapSensor.h.
Referenced by AOverlapSensor(), BeginPlay(), EndPlay(), Init(), SetOverlapBounds(), SetOverlapRelativePosition(), SetOverlapResponseToAllChannels(), and SetVisualizeOverlapArea().
|
private |
Definition at line 125 of file OverlapSensor.h.
Referenced by SetVisualizeOverlapArea().
|
private |
Definition at line 116 of file OverlapSensor.h.
Referenced by Init(), SetOverlapBounds(), and SetOverlapRelativePosition().
|
private |
Definition at line 114 of file OverlapSensor.h.
Referenced by BuildAndSendMessage(), and Init().
|
private |
Definition at line 119 of file OverlapSensor.h.
Referenced by BuildAndSendMessage(), AVehicle::GetActorInformation_Implementation(), and Init().
|
private |
Definition at line 123 of file OverlapSensor.h.
Referenced by Init().
|
private |
Definition at line 121 of file OverlapSensor.h.
Referenced by Init().