Go to the documentation of this file.
21 #include "CoreMinimal.h"
23 #include "GameFramework/Actor.h"
29 #include "Srvs/ROS2Attach.h"
31 #include "Srvs/ROS2DeleteEntity.h"
33 #include "Srvs/ROS2GetEntityState.h"
35 #include "Srvs/ROS2SetEntityState.h"
37 #include "Srvs/ROS2SpawnEntities.h"
39 #include "Srvs/ROS2SpawnEntity.h"
51 #include "SimulationState.generated.h"
100 : EntityTypeName(InEntityInfo.Key), EntityClass(InEntityInfo.Value)
206 void RegisterSpawnableBPEntities(
const TArray<FString>& InBPSpawnableClassNames);
221 virtual void InitEntities();
251 bool ServerCheckSetEntityStateRequest(
const FROSSetEntityStateReq& InRequest);
268 void ServerSetEntityState(
const FROSSetEntityStateReq& InRequest);
300 bool ServerCheckAttachRequest(
const FROSAttachReq& InRequest);
317 void ServerAttach(
const FROSAttachReq& InRequest);
349 bool ServerCheckSpawnRequest(
const FROSSpawnEntityReq& InRequest);
366 AActor* ServerSpawnEntity(
const FROSSpawnEntityReq& InRequest,
const int32 NetworkPlayerId);
398 bool ServerCheckDeleteRequest(
const FROSDeleteEntityReq& InRequest);
417 void ServerDeleteEntity(
const FROSDeleteEntityReq& InRequest);
449 void ServerAddEntity(AActor* InEntity);
464 void AddTaggedEntity(AActor* InEntity,
const FName& InTag);
483 void AddSpawnableEntityTypes(TMap<FString, TSubclassOf<AActor>> InSpawnableEntityTypes);
535 void OnRep_EntityList();
574 void GetSpawnableEntityInfoList();
589 void OnRep_SpawnableEntityInfoList();
624 bool VerifyIsServerCall(
const FString& InFunctionName);
644 AActor* ServerSpawnEntity(
const FROSSpawnEntityReq& InROSSpawnRequest,
646 const TSubclassOf<AActor>& InEntityClass,
648 const FTransform& InEntityTransform,
650 const int32& InNetworkPlayerId);
TArray< FRREntityInfo > SpawnableEntityInfoList
Replicatable Copy of SpawnableEntityTypes.
Definition: SimulationState.h:559
FROSGetEntityStateReq PrevGetEntityStateRequest
Cached the previous [GetEntityState] request for duplicated incoming request filtering.
Definition: SimulationState.h:234
Provide ROS 2 interface implementations to interact with UE4.
Definition: SimulationState.h:173
TMap< FString, std::string > EncodedStrings
Matches UE strings to original char buffers, for ros messages.
Definition: SimulationState.h:612
FTimerHandle FetchEntityListTimerHandle
Timer handle to fetch SpawnableEntityInfoList.
Definition: SimulationState.h:600
FString EntityTypeName
Definition: SimulationState.h:79
FRREntityInfo(const TPair< FString, TSubclassOf< AActor >> &InEntityInfo)
Definition: SimulationState.h:98
FROSAttachReq PrevAttachEntityRequest
Cached the previous [Attach] request for duplicated incoming request filtering.
Definition: SimulationState.h:330
FROSSpawnEntityReq PrevSpawnEntityRequest
Cached the previous [SpawnEntity] request for duplicated incoming request filtering.
Definition: SimulationState.h:379
TArray< AActor * > Actors
Definition: SimulationState.h:136
FRREntityInfo.
Definition: SimulationState.h:68
TMap< FString, TSubclassOf< AActor > > SpawnableEntityTypes
Spawnable entity types for SpawnEntity ROS 2 service.
Definition: SimulationState.h:548
TMap< FName, FRREntities > EntitiesWithTag
All existing entities with tags which can be manipulated by this class via ROS 2 services.
Definition: SimulationState.h:509
FRREntities has only TArray<AActor*> Actors.
Definition: SimulationState.h:125
FROSDeleteEntityReq PrevDeleteEntityRequest
Cached the previous [DeleteEntity] request for duplicated incoming request filtering.
Definition: SimulationState.h:430
TArray< AActor * > EntityList
Replicatable copy of Entities.
Definition: SimulationState.h:520
FROSSetEntityStateReq PrevSetEntityStateRequest
Cached the previous [SetEntityState] request for duplicated incoming request filtering.
Definition: SimulationState.h:281
FRREntityInfo()
Definition: SimulationState.h:92
Convertions between ROS and UE, i.e.
TSubclassOf< AActor > EntityClass
Definition: SimulationState.h:88
TMap< FString, AActor * > Entities
All existing entities which can be manipulated by this class via ROS 2 services.
Definition: SimulationState.h:496