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 |
![]() | |
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) |
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 |
![]() | |
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) |
![]() | |
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 | |
UBoundsVisualizerComponent * | BoundsComponent = nullptr |
![]() | |
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 |
FOverlapSensorParameters | Parameters |
AVehicle * | Vehicle = nullptr |
FString | VehicleName |
FString | VehicleID |
bool | IsVisible = false |
Additional Inherited Members | |
![]() | |
static void | HideComponentForAllCameras (UPrimitiveComponent *PrimitiveComponent) |
static TMap< FString, FColor > | GetSemanticColors () |
static TArray< TWeakObjectPtr< UPrimitiveComponent > > | GetComponentsToHide () |
![]() | |
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 () |
![]() | |
FSensorDestroy | OnSensorDestroy |
FString | AttachedToComponent |
FName | AttachedToBone |
![]() | |
template<typename InStructType > | |
static FString | StructToString (const InStructType &InStruct) |
![]() | |
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 28 of file OverlapSensor.h.
AOverlapSensor::AOverlapSensor | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 19 of file OverlapSensor.cpp.
References BoundsComponent.
|
overrideprivatevirtual |
Reimplemented from ASensor.
Definition at line 95 of file OverlapSensor.cpp.
References BoundsComponent, OnOverlapBegin(), and OnOverlapEnd().
|
private |
Definition at line 191 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 103 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 30 of file OverlapSensor.cpp.
References BoundsComponent, FOverlapSensorParameters::CreateROSTopic, ASensor::CreateROSTopic(), FOverlapSensorParameters::OwningActor, Parameters, FOverlapSensorParameters::RelativePosition, ROSMessage, SetOverlapBounds(), ASensor::SetSimulateSensor(), FOverlapSensorParameters::Size, SIZE_DIVISOR, Vehicle, VehicleID, and VehicleName.
Referenced by USensorFactory::SpawnOverlapSensor().
|
inline |
Definition at line 77 of file OverlapSensor.h.
|
protected |
Definition at line 165 of file OverlapSensor.cpp.
References BuildAndSendMessage().
Referenced by BeginPlay(), and EndPlay().
|
protected |
Definition at line 178 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 111 of file OverlapSensor.cpp.
References BoundsComponent, SimulatorLog::Log(), Parameters, FOverlapSensorParameters::Size, and SIZE_DIVISOR.
Referenced by UROSCommands::HandleChangeOverlapSensorBounds(), and Init().
void AOverlapSensor::SetOverlapRelativePosition | ( | const FVector & | Vector | ) |
Set this Overlap sensor relative position to parent.
Definition at line 138 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 151 of file OverlapSensor.cpp.
References BoundsComponent.
void AOverlapSensor::SetVisualizeOverlapArea | ( | bool | Visualize | ) |
Set this Overlap sensor bounds visulization on or off.
Definition at line 128 of file OverlapSensor.cpp.
References BoundsComponent, and IsVisible.
Referenced by UROSCommands::HandleVisualizeOverlapSensorsBounds(), and AVehicle::SetVisualizeVehicleOverlapArea().
|
private |
Definition at line 235 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 121 of file OverlapSensor.h.
Referenced by SetVisualizeOverlapArea().
|
private |
Definition at line 112 of file OverlapSensor.h.
Referenced by Init(), SetOverlapBounds(), and SetOverlapRelativePosition().
|
private |
Definition at line 110 of file OverlapSensor.h.
Referenced by BuildAndSendMessage(), and Init().
|
private |
Definition at line 115 of file OverlapSensor.h.
Referenced by BuildAndSendMessage(), AVehicle::GetActorInformation_Implementation(), and Init().
|
private |
Definition at line 119 of file OverlapSensor.h.
Referenced by BuildAndSendMessage(), and Init().
|
private |
Definition at line 117 of file OverlapSensor.h.
Referenced by BuildAndSendMessage(), and Init().