Agrarsense
|
#include <PIDDrone.h>
Public Member Functions | |
APIDDrone () | |
virtual EVehicleTypes | GetVehicleType () const override |
virtual FTransform | GetInteractableWorldTransform_Implementation () const override |
void | SetDroneAction (EDroneAction mode) |
Set drone's action (roaming, manual) More... | |
EDroneAction | GetDroneAction () |
Get drone's action (roaming, manual) More... | |
FDroneParameters | GetDroneParameters () |
void | ChangeDroneParameters (const FDroneParameters &newParameters) |
void | SetDroneParameters (const FDroneParameters &InParameters) |
void | AddWayPoint (FVector waypoint) |
void | ClearWaypoints () |
void | FlySetFlightpath () |
Called in tick function for drone roaming through points. More... | |
void | SetManualControl (bool value) |
void | MoveDroneToPosition (const FTransform Transform) |
Override all drone roaming points and continue towards this position. More... | |
TArray< FTransform > | GenerateRoamingPoints (float radius, int roamingPoints) |
Generates a roadming points array for the drone in radius. More... | |
Public Member Functions inherited from AVehicle | |
AVehicle () | |
virtual EVehicleTypes | GetVehicleType () const |
virtual FString | GetTopicName () |
void | TogglePhysics (bool isOn) |
void | TeleportVehicleTo (FVector NewLocation, FRotator NewRotation) |
virtual void | TeleportVehicleTo_Implementation (FVector NewLocation, FRotator NewRotation) |
void | ResetCamera () |
void | ToggleLights (bool isOn) |
void | SetVisualizeVehicleOverlapArea (bool Visible) |
FString | ExportToJsonFile (const FString &FileName) |
void | SetVehicleIsInGarage (bool VehicleIsInGarage) |
bool | IsVehicleInGarage () const |
USensorsManagerComponent * | GetSensorsManager () const |
ACollisionSensor * | GetCollisionSensor () const |
ATransformSensor * | GetTransformSensor () const |
AOverlapSensor * | GetOverlapSensor () const |
FTransform | GetMovedFromGarageTransform () const |
void | SetCurrentTransformToMovedFromGarageTransform () |
virtual FText | GetInteractableName_Implementation () const override |
virtual FTransform | GetInteractableWorldTransform_Implementation () const override |
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 |
virtual void | PossessedBy (AController *NewController) override |
Public Member Functions inherited from IInteractable | |
FText | GetInteractableName () const |
FTransform | GetInteractableWorldTransform () const |
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) |
Public Attributes | |
bool | manualControl = false |
Public Attributes inherited from AVehicle | |
FText | InteractableName |
FVehicleGarageChangedDelegate | OnVehicleGarageChanged |
Protected Member Functions | |
FVector | GetCurrentWaypointTarget () |
void | SetDesiredLocationMesh (UStaticMeshComponent *meshcomponent) |
void | AssignRoamingPoints (TArray< FTransform > Points) |
void | SetDroneRotation (USkeletalMeshComponent *target, FRotator rotator) |
virtual void | BeginPlay () override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
Protected Attributes | |
FDroneParameters | DroneParameters |
Protected Attributes inherited from AVehicle | |
TObjectPtr< USensorsManagerComponent > | SensorsManager |
ACollisionSensor * | CollisionSensor = nullptr |
ATransformSensor * | TransformSensor = nullptr |
AOverlapSensor * | OverlapSensor = nullptr |
UNiagaraComponent * | NiagaraComponent = nullptr |
FString | ActorName |
FString | ActorID |
FTransform | OriginalCameraTransform |
Private Member Functions | |
virtual void | BeginPlay () override |
virtual void | Tick (float DeltaTime) override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
void | AutoPilot (float DeltaTime) |
bool | isRoaming () |
Private Attributes | |
EFlightMode | flightmode = EFlightMode::Roaming |
UWorld * | World = nullptr |
FVector | StartingPosition |
USkeletalMeshComponent * | mesh = nullptr |
UStaticMeshComponent * | desiredPositionMesh = nullptr |
bool | bRosConnected = false |
bool | waypointreached = false |
TArray< FVector > | WayPoints |
int | passedWaypoints = 0 |
Additional Inherited Members | |
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 () |
Definition at line 17 of file PIDDrone.h.
APIDDrone::APIDDrone | ( | ) |
Definition at line 18 of file PIDDrone.cpp.
References AVehicle::InteractableName.
|
inline |
Definition at line 81 of file PIDDrone.h.
References FDroneParameters::Points.
|
inlineprotected |
Definition at line 172 of file PIDDrone.h.
|
private |
Definition at line 198 of file PIDDrone.cpp.
References FlySetFlightpath(), and isRoaming().
Referenced by Tick().
|
overrideprivatevirtual |
Reimplemented from AVehicle.
Definition at line 24 of file PIDDrone.cpp.
References desiredPositionMesh, mesh, StartingPosition, and World.
|
inline |
Definition at line 69 of file PIDDrone.h.
Referenced by USimulatorJsonParser::ParseAndSetDroneParameters().
|
inline |
Definition at line 90 of file PIDDrone.h.
|
overrideprivatevirtual |
Reimplemented from AVehicle.
Definition at line 36 of file PIDDrone.cpp.
void APIDDrone::FlySetFlightpath | ( | ) |
Called in tick function for drone roaming through points.
Definition at line 51 of file PIDDrone.cpp.
References desiredPositionMesh, FDroneParameters::DroneAction, FDroneParameters::DroneEndAction, DroneParameters, GenerateRandomNew, GenerateRoamingPoints(), GetCurrentWaypointTarget(), mesh, passedWaypoints, FDroneParameters::Points, Roaming, Stationary, Stop, and waypointreached.
Referenced by AutoPilot().
TArray< FTransform > APIDDrone::GenerateRoamingPoints | ( | float | radius, |
int | roamingPoints | ||
) |
Generates a roadming points array for the drone in radius.
radius | radius of the roaming area |
Definition at line 174 of file PIDDrone.cpp.
Referenced by FlySetFlightpath().
|
protected |
Definition at line 128 of file PIDDrone.cpp.
References DroneParameters, passedWaypoints, and FDroneParameters::Points.
Referenced by FlySetFlightpath().
|
inline |
Get drone's action (roaming, manual)
Definition at line 57 of file PIDDrone.h.
|
inline |
Definition at line 63 of file PIDDrone.h.
Referenced by USimulatorJsonExporter::SetDroneParameters().
|
inlineoverridevirtual |
Reimplemented from AVehicle.
Definition at line 31 of file PIDDrone.h.
|
inlineoverridevirtual |
Get type of the Vehicle
Reimplemented from AVehicle.
Definition at line 29 of file PIDDrone.h.
References Drone.
|
inlineprivate |
void APIDDrone::MoveDroneToPosition | ( | const FTransform | Transform | ) |
Override all drone roaming points and continue towards this position.
Transform | drone move position |
Definition at line 115 of file PIDDrone.cpp.
References DroneParameters, FDroneParameters::Points, and Transform.
|
inlineprotected |
Definition at line 167 of file PIDDrone.h.
|
inline |
Set drone's action (roaming, manual)
Definition at line 47 of file PIDDrone.h.
|
inline |
Definition at line 75 of file PIDDrone.h.
|
protected |
Definition at line 139 of file PIDDrone.cpp.
|
inline |
Definition at line 102 of file PIDDrone.h.
|
overrideprivatevirtual |
Definition at line 41 of file PIDDrone.cpp.
References AutoPilot(), and AVehicle::IsVehicleInGarage().
|
private |
Definition at line 143 of file PIDDrone.h.
|
private |
Definition at line 141 of file PIDDrone.h.
Referenced by BeginPlay(), and FlySetFlightpath().
|
protected |
Definition at line 161 of file PIDDrone.h.
Referenced by FlySetFlightpath(), GetCurrentWaypointTarget(), and MoveDroneToPosition().
|
private |
Definition at line 133 of file PIDDrone.h.
bool APIDDrone::manualControl = false |
Definition at line 120 of file PIDDrone.h.
|
private |
Definition at line 140 of file PIDDrone.h.
Referenced by BeginPlay(), and FlySetFlightpath().
|
private |
Definition at line 157 of file PIDDrone.h.
Referenced by FlySetFlightpath(), and GetCurrentWaypointTarget().
|
private |
Definition at line 138 of file PIDDrone.h.
Referenced by BeginPlay().
|
private |
Definition at line 144 of file PIDDrone.h.
Referenced by FlySetFlightpath().
|
private |
Definition at line 147 of file PIDDrone.h.
|
private |
Definition at line 136 of file PIDDrone.h.
Referenced by BeginPlay().