|
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 () const |
| Get drone's action (roaming, manual) More... | |
| FDroneParameters | GetDroneParameters () const |
| void | ResetDroneEvent () |
| void | ChangeDroneParameters (const FDroneParameters &newParameters) |
| void | AddWayPoint (FVector Waypoint) |
| float | GetDroneDistanceToNextPoint () |
| float | GetDroneSpeed () const |
| void | ClearWaypoints () |
| void | SetFlightpath () |
| 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, int32 roamingPoints) |
| Generates a roadming points array for the drone in radius. More... | |
| float | GetYawRotationDifference (USkeletalMeshComponent *DroneSkeletalMesh, UStaticMeshComponent *DesiredLocation) |
| Get wanted waypoint target rotation. More... | |
| virtual void | SetCurrentTransformToMovedFromGarageTransform () override |
| void | SetShowForwardArrow (bool Show) |
| void | SetDrawDebugPoints (bool show) |
| bool | GetShowForwardArrow () const |
| USkeletalMeshComponent * | GetDroneSkeletalMesh () const |
Public Member Functions inherited from AVehicle | |
| AVehicle () | |
| virtual EVehicleTypes | GetVehicleType () const |
| void | TogglePhysics (bool isOn) |
| void | SetVehicleMeshVisibility (bool Visible) |
| 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 |
| virtual 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 |
| void | SetVehicleParameters (FWheeledVehicleParameters NewParameters) |
| FWheeledVehicleParameters | GetVehicleParameters () const |
| void | ApplyVehicleParameters (FWheeledVehicleParameters CurrentParameters) |
| 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 | |
| FDroneFinished | OnDroneFinished |
Public Attributes inherited from AVehicle | |
| FText | InteractableName |
| FVehicleGarageChangedDelegate | OnVehicleGarageChanged |
Protected Member Functions | |
| void | ROSBridgeStateChanged (EROSState ROSState) override |
| virtual void | BeginPlay () override |
| virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
| virtual void | ROSBridgeStateChanged (EROSState ROSState) |
Protected Attributes | |
| UTopic * | ROSTopic = nullptr |
| TSharedPtr< ROSMessages::std_msgs::Float32 > | ROSMessage |
Protected Attributes inherited from AVehicle | |
| FWheeledVehicleParameters | VehicleParameters |
| TObjectPtr< USensorsManagerComponent > | SensorsManager |
| ACollisionSensor * | CollisionSensor = nullptr |
| ATransformSensor * | TransformSensor = nullptr |
| AOverlapSensor * | OverlapSensor = nullptr |
| UNiagaraComponent * | NiagaraComponent = nullptr |
| TArray< UStaticMeshComponent * > | ExtraTransformSensorPositions |
| FString | ActorName |
| FString | ActorID |
| FTransform | OriginalCameraTransform |
| FTransform | MovedFromGarageTransform |
| bool | VehicleInGarage = false |
| TArray< ATransformSensor * > | ExtraTransformSensors |
Private Member Functions | |
| virtual void | BeginPlay () override |
| virtual void | Tick (float DeltaTime) override |
| virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
| void | CreateTopic () |
| void | DestroyTopic () |
| void | HandleDestroy () |
| void | AutoPilot (const float DeltaTime) |
| void | DrawDebugPoints () |
| void | AssignRoamingPoints (const TArray< FTransform > Points) |
| void | SetDroneRotation (USkeletalMeshComponent *target, FRotator rotator) |
| void | UpdateGroundHeight () |
| bool | IsRoaming () const |
| void | SetDesiredLocationMesh (UStaticMeshComponent *meshcomponent) |
| FVector | GetCurrentWaypointTarget () |
| FTransform | GetCurrentWaypointTarget_Transform () |
Private Attributes | |
| FDroneParameters | DroneParameters |
| EFlightMode | flightmode = EFlightMode::Roaming |
| UWorld * | World = nullptr |
| FVector | StartingPosition |
| USkeletalMeshComponent * | DroneSkeletalMesh = nullptr |
| UStaticMeshComponent * | PositionMesh = nullptr |
| AOverlapSensor * | InnerOverlapSensor = nullptr |
| TArray< FVector > | WayPoints |
| bool | waypointReached = false |
| bool | manualControl = false |
| bool | ShowForwardArrow = false |
| bool | drawDebugPoints = false |
| int32 | passedWaypoints = 0 |
| float | DroneHeightFromGround = 0.0f |
| float | distanceToNextPoint = 0.0f |
| TArray< FTransform > | dronePath |
| FTimerHandle | DestroyHandle |
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 25 of file PIDDrone.h.
| APIDDrone::APIDDrone | ( | ) |
Definition at line 30 of file PIDDrone.cpp.
References AVehicle::InteractableName.
|
inline |
Definition at line 86 of file PIDDrone.h.
References FDroneParameters::Points.
|
private |
Definition at line 397 of file PIDDrone.cpp.
References ClearWaypoints(), and WayPoints.
|
private |
Definition at line 228 of file PIDDrone.cpp.
References FDroneParameters::DroneAction, DroneParameters, SetFlightpath(), and Stationary.
Referenced by Tick().
|
overrideprivatevirtual |
Reimplemented from AVehicle.
Definition at line 112 of file PIDDrone.cpp.
References AVehicle::ActorID, FOverlapSensorParameters::AllChannels, ChangeDroneParameters(), CreateTopic(), DroneParameters, DroneSkeletalMesh, AVehicle::NiagaraComponent, AVehicle::OverlapSensor, FOverlapSensorParameters::OwningActor, FTransformSensorParameters::OwningActor, FSensorSpawnParameters::Parent, PositionMesh, FTransformSensorParameters::PrimitiveComponent, FOverlapSensorParameters::RelativePosition, ROSMessage, FTransformSensorParameters::SaveTransformDataToDisk, FSensorSpawnParameters::SensorIdentifier, FSensorSpawnParameters::SensorName, FSensorSpawnParameters::SimulateSensor, FOverlapSensorParameters::Size, USensorFactory::SpawnOverlapSensor(), USensorFactory::SpawnTransformSensor(), StartingPosition, FSensorSpawnParameters::Transform, AVehicle::TransformSensor, FTransformSensorParameters::UseOwningActorTransform, and World.
| void APIDDrone::ChangeDroneParameters | ( | const FDroneParameters & | newParameters | ) |
Definition at line 36 of file PIDDrone.cpp.
References AVehicle::ActorID, FOverlapSensorParameters::AllChannels, FDroneParameters::CollisionsEnabled, AVehicle::CollisionSensor, FDroneParameters::CreateInnerOverlapSensor, DroneParameters, DroneSkeletalMesh, FDroneParameters::InnerOverlapRadiusMeters, InnerOverlapSensor, FDroneParameters::OverlapRadiusMeters, AVehicle::OverlapSensor, FCollisionSensorParameters::OwningActor, FOverlapSensorParameters::OwningActor, FSensorSpawnParameters::Parent, FCollisionSensorParameters::PrimitiveComponent, FOverlapSensorParameters::RelativePosition, FSensorSpawnParameters::SensorIdentifier, FSensorSpawnParameters::SensorName, AOverlapSensor::SetOverlapBounds(), AOverlapSensor::SetVisualizeOverlapArea(), FSensorSpawnParameters::SimulateSensor, FOverlapSensorParameters::Size, USensorFactory::SpawnCollisionSensor(), USensorFactory::SpawnOverlapSensor(), FSensorSpawnParameters::Transform, FCollisionSensorParameters::UseActorCollision, and FDroneParameters::VisualizeOverlap.
Referenced by BeginPlay(), and USimulatorJsonParser::ParseAndSetDroneParameters().
|
inline |
Definition at line 118 of file PIDDrone.h.
Referenced by AssignRoamingPoints().
|
private |
Definition at line 545 of file PIDDrone.cpp.
References AVehicle::GetActorID_Implementation(), UAgrarsenseStatics::GetROSGameInstance(), and ROSTopic.
Referenced by BeginPlay(), and ROSBridgeStateChanged().
|
private |
Definition at line 585 of file PIDDrone.cpp.
References ROSTopic.
Referenced by EndPlay(), and ROSBridgeStateChanged().
|
private |
Definition at line 238 of file PIDDrone.cpp.
References DroneParameters, dronePath, DroneSkeletalMesh, FDroneParameters::Points, and World.
Referenced by Tick().
|
overrideprivatevirtual |
Reimplemented from AVehicle.
Definition at line 189 of file PIDDrone.cpp.
References DestroyTopic(), InnerOverlapSensor, ROSMessage, and AVehicle::TransformSensor.
| TArray< FTransform > APIDDrone::GenerateRoamingPoints | ( | float | radius, |
| int32 | roamingPoints | ||
| ) |
Generates a roadming points array for the drone in radius.
| radius | radius of the roaming area |
Definition at line 507 of file PIDDrone.cpp.
Referenced by SetFlightpath().
|
private |
Definition at line 382 of file PIDDrone.cpp.
References GetCurrentWaypointTarget_Transform().
Referenced by SetFlightpath().
|
private |
Definition at line 387 of file PIDDrone.cpp.
References DroneParameters, DroneSkeletalMesh, passedWaypoints, and FDroneParameters::Points.
Referenced by GetCurrentWaypointTarget().
|
inline |
Get drone's action (roaming, manual)
Definition at line 68 of file PIDDrone.h.
|
inline |
Definition at line 95 of file PIDDrone.h.
References Manual.
|
inline |
Definition at line 74 of file PIDDrone.h.
Referenced by USimulatorJsonExporter::SetDroneParameters().
|
inline |
Definition at line 189 of file PIDDrone.h.
|
inline |
Definition at line 107 of file PIDDrone.h.
|
inlineoverridevirtual |
Reimplemented from AVehicle.
Definition at line 39 of file PIDDrone.h.
|
inline |
Definition at line 183 of file PIDDrone.h.
|
inlineoverridevirtual |
Get type of the Vehicle
Reimplemented from AVehicle.
Definition at line 37 of file PIDDrone.h.
References Drone.
| float APIDDrone::GetYawRotationDifference | ( | USkeletalMeshComponent * | DroneSkeletalMesh, |
| UStaticMeshComponent * | DesiredLocation | ||
| ) |
Get wanted waypoint target rotation.
Definition at line 568 of file PIDDrone.cpp.
|
private |
Definition at line 268 of file PIDDrone.cpp.
References ASimulationLevelManager::CeaseManualControlOfVehicle(), Destroy, ASimulationLevelManager::GetManuallyControlledVehicle(), UAgrarsenseStatics::GetSimulationLevelManager(), passedWaypoints, and World.
Referenced by SetFlightpath().
|
inlineprivate |
Definition at line 230 of file PIDDrone.h.
References Roaming.
Referenced by SetFlightpath().
| void APIDDrone::MoveDroneToPosition | ( | const FTransform | Transform | ) |
Override all drone roaming points and continue towards this position.
| Transform | drone move position |
Definition at line 369 of file PIDDrone.cpp.
References DroneParameters, FDroneParameters::Points, and Transform.
| void APIDDrone::ResetDroneEvent | ( | ) |
|
overrideprotectedvirtual |
Reimplemented from AVehicle.
Definition at line 531 of file PIDDrone.cpp.
References Connected, CreateTopic(), DestroyTopic(), and Disconnected.
|
inlineoverridevirtual |
Reimplemented from AVehicle.
Definition at line 156 of file PIDDrone.h.
|
inlineprivate |
Definition at line 236 of file PIDDrone.h.
|
inline |
Definition at line 177 of file PIDDrone.h.
Referenced by USimulatorJsonParser::ParseAndSetDroneParameters().
|
inline |
Set drone's action (roaming, manual)
Definition at line 55 of file PIDDrone.h.
|
private |
Definition at line 407 of file PIDDrone.cpp.
| void APIDDrone::SetFlightpath | ( | ) |
Called in tick function for drone roaming through points.
Definition at line 288 of file PIDDrone.cpp.
References Destroy, DestroyHandle, distanceToNextPoint, FDroneParameters::DroneAction, FDroneParameters::DroneEndAction, DroneParameters, DroneSkeletalMesh, GenerateRandomNew, GenerateRoamingPoints(), GetCurrentWaypointTarget(), GoBackwards, HandleDestroy(), IsRoaming(), AVehicle::IsVehicleInGarage(), OnDroneFinished, passedWaypoints, FDroneParameters::Points, PositionMesh, RepeatFromBeginning, Roaming, Stationary, Stop, and waypointReached.
Referenced by AutoPilot().
|
inline |
Definition at line 130 of file PIDDrone.h.
|
inline |
Definition at line 172 of file PIDDrone.h.
Referenced by USimulatorJsonParser::ParseAndSetDroneParameters().
|
overrideprivatevirtual |
Definition at line 209 of file PIDDrone.cpp.
References AutoPilot(), DrawDebugPoints(), drawDebugPoints, AVehicle::IsVehicleInGarage(), and UpdateGroundHeight().
|
private |
Definition at line 437 of file PIDDrone.cpp.
References DroneHeightFromGround, DroneSkeletalMesh, ROSMessage, ROSTopic, and World.
Referenced by Tick().
|
private |
Definition at line 288 of file PIDDrone.h.
Referenced by SetFlightpath().
|
private |
Definition at line 284 of file PIDDrone.h.
Referenced by SetFlightpath().
|
private |
Definition at line 278 of file PIDDrone.h.
Referenced by Tick().
|
private |
Definition at line 282 of file PIDDrone.h.
Referenced by UpdateGroundHeight().
|
private |
Definition at line 247 of file PIDDrone.h.
Referenced by AutoPilot(), BeginPlay(), ChangeDroneParameters(), DrawDebugPoints(), GetCurrentWaypointTarget_Transform(), MoveDroneToPosition(), and SetFlightpath().
|
private |
Definition at line 286 of file PIDDrone.h.
Referenced by DrawDebugPoints().
|
private |
Definition at line 258 of file PIDDrone.h.
Referenced by BeginPlay(), ChangeDroneParameters(), DrawDebugPoints(), GetCurrentWaypointTarget_Transform(), SetFlightpath(), and UpdateGroundHeight().
|
private |
Definition at line 250 of file PIDDrone.h.
|
private |
Definition at line 264 of file PIDDrone.h.
Referenced by ChangeDroneParameters(), and EndPlay().
|
private |
Definition at line 274 of file PIDDrone.h.
| FDroneFinished APIDDrone::OnDroneFinished |
Definition at line 61 of file PIDDrone.h.
Referenced by SetFlightpath().
|
private |
Definition at line 280 of file PIDDrone.h.
Referenced by GetCurrentWaypointTarget_Transform(), HandleDestroy(), and SetFlightpath().
|
private |
Definition at line 261 of file PIDDrone.h.
Referenced by BeginPlay(), and SetFlightpath().
|
protected |
Definition at line 201 of file PIDDrone.h.
Referenced by BeginPlay(), EndPlay(), and UpdateGroundHeight().
|
protected |
Definition at line 199 of file PIDDrone.h.
Referenced by CreateTopic(), DestroyTopic(), and UpdateGroundHeight().
|
private |
Definition at line 276 of file PIDDrone.h.
|
private |
Definition at line 255 of file PIDDrone.h.
Referenced by BeginPlay().
|
private |
Definition at line 272 of file PIDDrone.h.
Referenced by SetFlightpath().
|
private |
Definition at line 267 of file PIDDrone.h.
Referenced by AssignRoamingPoints().
|
private |
Definition at line 253 of file PIDDrone.h.
Referenced by BeginPlay(), DrawDebugPoints(), HandleDestroy(), and UpdateGroundHeight().