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 |
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) |
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) |
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) |
Protected Attributes | |
UBoxComponent * | BoxComponent = nullptr |
USphereComponent * | SphereComponent = nullptr |
UBoundsVisualizerComponent * | VisualizerComponent = nullptr |
Protected Attributes inherited from ASensor | |
UTopic * | ROSTopic = nullptr |
bool | SendDataToROS = true |
ULogFile * | LogFile = 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) |
FString | TryGetID (AActor *Actor) |
Private Attributes | |
TSharedPtr< ROSMessages::std_msgs::String > | ROSMessage |
ETriggerShape | OverlapShape = ETriggerShape::Sphere |
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 with certain objects in the simulation. This can be useful for development purposes, such as determining when a Walker/Vehicle enters the "safe zone" of another Vehicle. Note that this sensor does not simulate any real-world sensor.
Definition at line 30 of file OverlapSensor.h.
AOverlapSensor::AOverlapSensor | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 19 of file OverlapSensor.cpp.
References BoxComponent, SphereComponent, and VisualizerComponent.
|
overrideprivatevirtual |
Reimplemented from ASensor.
Definition at line 136 of file OverlapSensor.cpp.
References Box, BoxComponent, OnOverlapBegin(), OnOverlapEnd(), OverlapShape, Sphere, and SphereComponent.
|
private |
Definition at line 290 of file OverlapSensor.cpp.
References ASensor::GetROSTopic(), ASensor::IsROSConnected(), SimulatorLog::Log(), ROSMessage, TryGetID(), Vehicle, VehicleID, VehicleName, and ASensor::WriteToLogFile().
Referenced by OnOverlapBegin(), and OnOverlapEnd().
|
overrideprivatevirtual |
Reimplemented from ASensor.
Definition at line 152 of file OverlapSensor.cpp.
References Box, BoxComponent, OnOverlapBegin(), OnOverlapEnd(), OverlapShape, Sphere, and SphereComponent.
|
inlineoverridevirtual |
Get this sensor parameters as string
Reimplemented from ASensor.
Definition at line 84 of file OverlapSensor.h.
|
inlineoverridevirtual |
Get type of the sensor
Reimplemented from ASensor.
Definition at line 45 of file OverlapSensor.h.
References Overlap.
void AOverlapSensor::Init | ( | FOverlapSensorParameters | InParameters | ) |
Definition at line 37 of file OverlapSensor.cpp.
References Box, BoxComponent, FOverlapSensorParameters::CreateROSTopic, ASensor::CreateROSTopic(), AVehicle::GetActorID_Implementation(), AVehicle::GetActorName_Implementation(), OverlapShape, FOverlapSensorParameters::OwningActor, Parameters, FOverlapSensorParameters::RelativePosition, ROSMessage, SetOverlapBounds(), ASensor::SetSimulateSensor(), FOverlapSensorParameters::Size, SIZE_DIVISOR, Sphere, SphereComponent, FOverlapSensorParameters::TriggerShape, Vehicle, VehicleID, VehicleName, and VisualizerComponent.
Referenced by USensorFactory::SpawnOverlapSensor().
|
inline |
Definition at line 79 of file OverlapSensor.h.
|
protected |
Definition at line 264 of file OverlapSensor.cpp.
References BuildAndSendMessage().
Referenced by BeginPlay(), and EndPlay().
|
protected |
Definition at line 277 of file OverlapSensor.cpp.
References BuildAndSendMessage().
Referenced by BeginPlay(), and EndPlay().
void AOverlapSensor::SetOverlapBounds | ( | const FVector & | NewSize | ) |
Set this Overlap sensor Overlap bounds.
Definition at line 168 of file OverlapSensor.cpp.
References Box, BoxComponent, ASensor::GetActorID_Implementation(), SimulatorLog::Log(), OverlapShape, Parameters, FOverlapSensorParameters::Size, SIZE_DIVISOR, Sphere, SphereComponent, and VisualizerComponent.
Referenced by UROSCommands::HandleChangeOverlapSensorBounds(), and Init().
void AOverlapSensor::SetOverlapRelativePosition | ( | const FVector & | Vector | ) |
Set this Overlap sensor relative position to parent.
Definition at line 222 of file OverlapSensor.cpp.
References BoxComponent, SimulatorLog::Log(), Parameters, FOverlapSensorParameters::RelativePosition, SphereComponent, and VisualizerComponent.
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 245 of file OverlapSensor.cpp.
References BoxComponent, and SphereComponent.
void AOverlapSensor::SetVisualizeOverlapArea | ( | bool | Visualize | ) |
Set this Overlap sensor bounds visulization on or off.
Definition at line 192 of file OverlapSensor.cpp.
References Box, BoxComponent, IsVisible, OverlapShape, Sphere, SphereComponent, and VisualizerComponent.
Referenced by UROSCommands::HandleVisualizeOverlapSensorsBounds(), and AVehicle::SetVisualizeVehicleOverlapArea().
|
private |
Definition at line 325 of file OverlapSensor.cpp.
Referenced by BuildAndSendMessage().
|
protected |
Definition at line 100 of file OverlapSensor.h.
Referenced by AOverlapSensor(), BeginPlay(), EndPlay(), Init(), SetOverlapBounds(), SetOverlapRelativePosition(), SetOverlapResponseToAllChannels(), and SetVisualizeOverlapArea().
|
private |
Definition at line 131 of file OverlapSensor.h.
Referenced by SetVisualizeOverlapArea().
|
private |
Definition at line 120 of file OverlapSensor.h.
Referenced by BeginPlay(), EndPlay(), Init(), SetOverlapBounds(), and SetVisualizeOverlapArea().
|
private |
Definition at line 122 of file OverlapSensor.h.
Referenced by Init(), SetOverlapBounds(), and SetOverlapRelativePosition().
|
private |
Definition at line 118 of file OverlapSensor.h.
Referenced by BuildAndSendMessage(), and Init().
|
protected |
Definition at line 103 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 BuildAndSendMessage(), AVehicle::GetActorInformation_Implementation(), and Init().
|
private |
Definition at line 129 of file OverlapSensor.h.
Referenced by BuildAndSendMessage(), and Init().
|
private |
Definition at line 127 of file OverlapSensor.h.
Referenced by BuildAndSendMessage(), and Init().
|
protected |
Definition at line 106 of file OverlapSensor.h.
Referenced by AOverlapSensor(), Init(), SetOverlapBounds(), SetOverlapRelativePosition(), and SetVisualizeOverlapArea().