Agrarsense
|
#include <CollisionSensor.h>
Public Member Functions | |
ACollisionSensor (const FObjectInitializer &ObjectInitializer) | |
void | Init (AActor *NewOwner, bool SimulateSensor=true) |
virtual ESensorTypes | GetSensorType () 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 | |
virtual void | BeginPlay () override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
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) |
Private Member Functions | |
void | SendCollisionData (const FString &CollisionDataString) |
void | OnCollisionEvent (AActor *Actor, AActor *OtherActor, FVector NormalImpulse, const FHitResult &Hit) |
Private Attributes | |
TWeakObjectPtr< AActor > | CurrentOwner |
TSharedPtr< ROSMessages::std_msgs::String > | CollisionMessage |
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) |
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" |
Collision sensor for vehicles.
Definition at line 39 of file CollisionSensor.h.
ACollisionSensor::ACollisionSensor | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 11 of file CollisionSensor.cpp.
|
overrideprotectedvirtual |
Reimplemented from ASensor.
Definition at line 30 of file CollisionSensor.cpp.
|
overrideprotectedvirtual |
Reimplemented from ASensor.
Definition at line 35 of file CollisionSensor.cpp.
References CollisionMessage, CurrentOwner, and OnCollisionEvent().
|
inlineoverridevirtual |
Get type of the sensor
Reimplemented from ASensor.
Definition at line 59 of file CollisionSensor.h.
References Collision.
void ACollisionSensor::Init | ( | AActor * | NewOwner, |
bool | SimulateSensor = true |
||
) |
Initialize collision sensor.
NewOwner | The new owner actor to be set. |
SimulateSensor | Whether to simulate the sensor (default is true). |
Definition at line 16 of file CollisionSensor.cpp.
References CollisionMessage, ASensor::CreateROSTopic(), CurrentOwner, OnCollisionEvent(), and ASensor::SetSimulateSensor().
Referenced by USensorFactory::SpawnCollisionSensor().
|
private |
Definition at line 48 of file CollisionSensor.cpp.
References ASensor::CanSimulateSensor(), SimulatorLog::Log(), SendCollisionData(), CollisionData::ToString(), CollisionData::ToStringHumanReadable(), and ASensor::WriteToLogFile().
|
private |
Definition at line 73 of file CollisionSensor.cpp.
References CollisionMessage, ASensor::GetROSTopic(), and ASensor::IsROSConnected().
Referenced by OnCollisionEvent().
|
private |
Definition at line 80 of file CollisionSensor.h.
Referenced by EndPlay(), Init(), and SendCollisionData().
|
private |
Definition at line 78 of file CollisionSensor.h.