Agrarsense
|
#include <TransformSensor.h>
Public Member Functions | |
ATransformSensor (const FObjectInitializer &ObjectInitializer) | |
void | Init (AActor *TransformActor, 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 |
virtual void | CreateROSTopic () override |
virtual void | DestroyROSTopic () 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 | TickParallel (float DeltaTime) |
void | SendTransformDataToROS (const FVector &Translation, const FQuat &Rotation) |
void | SendGnssDataToROS (const FVector &ActorPosition) |
Private Attributes | |
TSharedPtr< ROSMessages::geometry_msgs::Transform > | TransformMessage |
TSharedPtr< ROSMessages::std_msgs::String > | GnssMessageString |
TWeakObjectPtr< AActor > | Target |
FVector | PreviousActorPosition = FVector(0.0f, 0.0f, 0.0f) |
FTickEntry | TickEntry |
UTopic * | GnssTopic = nullptr |
AGeoReferencingSystem * | GeoReferencingSystem = nullptr |
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" |
Definition at line 24 of file TransformSensor.h.
ATransformSensor::ATransformSensor | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 14 of file TransformSensor.cpp.
|
overrideprotectedvirtual |
Reimplemented from ASensor.
Definition at line 33 of file TransformSensor.cpp.
References ATickManager::AddTick(), BindTick(), PreviousActorPosition, TickEntry, and TickParallel().
|
overrideprotectedvirtual |
Creates ROS Topic for this sensor. Can be overriden by individual sensor if needed.
Reimplemented from ASensor.
Definition at line 54 of file TransformSensor.cpp.
References GeoReferencingSystem, ASensor::GetSensorIdentifier(), GnssTopic, and ASensor::ROSInstance.
Referenced by Init().
|
overrideprotectedvirtual |
Destroy created ROS Topic. Can be overriden by individual sensor if needed.
Reimplemented from ASensor.
Definition at line 83 of file TransformSensor.cpp.
References GnssTopic.
|
overrideprotectedvirtual |
Reimplemented from ASensor.
Definition at line 43 of file TransformSensor.cpp.
References GnssMessageString, ATickManager::RemoveTick(), Target, TickEntry, and TransformMessage.
|
inlineoverridevirtual |
Get type of the sensor
Reimplemented from ASensor.
Definition at line 38 of file TransformSensor.h.
References Transform.
void ATransformSensor::Init | ( | AActor * | TransformActor, |
bool | SimulateSensor = true |
||
) |
Definition at line 20 of file TransformSensor.cpp.
References CreateROSTopic(), GnssMessageString, ASensor::SetSimulateSensor(), Target, and TransformMessage.
Referenced by USensorFactory::SpawnTransformSensor().
|
private |
Definition at line 135 of file TransformSensor.cpp.
References GeoReferencingSystem, GnssMessageString, GnssTopic, and UCoordinateConversionUtilities::UnrealToGeographicCoordinates().
Referenced by TickParallel().
|
private |
Definition at line 124 of file TransformSensor.cpp.
References ASensor::GetROSTopic(), and TransformMessage.
Referenced by TickParallel().
|
private |
Definition at line 97 of file TransformSensor.cpp.
References ASensor::CanSimulateSensor(), ASensor::IsROSConnected(), PreviousActorPosition, SendGnssDataToROS(), SendTransformDataToROS(), and Target.
Referenced by BeginPlay().
|
private |
Definition at line 77 of file TransformSensor.h.
Referenced by CreateROSTopic(), and SendGnssDataToROS().
|
private |
Definition at line 63 of file TransformSensor.h.
Referenced by EndPlay(), Init(), and SendGnssDataToROS().
|
private |
Definition at line 74 of file TransformSensor.h.
Referenced by CreateROSTopic(), DestroyROSTopic(), and SendGnssDataToROS().
|
private |
Definition at line 68 of file TransformSensor.h.
Referenced by BeginPlay(), and TickParallel().
|
private |
Definition at line 65 of file TransformSensor.h.
Referenced by EndPlay(), Init(), and TickParallel().
|
private |
Definition at line 71 of file TransformSensor.h.
Referenced by BeginPlay(), and EndPlay().
|
private |
Definition at line 61 of file TransformSensor.h.
Referenced by EndPlay(), Init(), and SendTransformDataToROS().