Merge pull request 'FT - Update Data Structure for Data transfer' (#63) from Noah_DataTransfer_1.0 into main
Reviewed-on: #63
This commit is contained in:
commit
5e47dd5c55
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -17,6 +17,7 @@
|
|||||||
#include "JsonObjectConverter.h"
|
#include "JsonObjectConverter.h"
|
||||||
#include "ReviewComments.h"
|
#include "ReviewComments.h"
|
||||||
#include "WebSocketsModule.h"
|
#include "WebSocketsModule.h"
|
||||||
|
#include "IWebSocket.h"
|
||||||
#include "Kismet/KismetStringLibrary.h"
|
#include "Kismet/KismetStringLibrary.h"
|
||||||
#include "Camera/CameraActor.h"
|
#include "Camera/CameraActor.h"
|
||||||
#include "Camera/CameraComponent.h"
|
#include "Camera/CameraComponent.h"
|
||||||
@ -55,7 +56,7 @@ void ULuckyDataTransferSubsystem::Deinitialize()
|
|||||||
|
|
||||||
void ULuckyDataTransferSubsystem::Internal_OpenWebsocket(const FString& URL, const FString& Protocol)
|
void ULuckyDataTransferSubsystem::Internal_OpenWebsocket(const FString& URL, const FString& Protocol)
|
||||||
{
|
{
|
||||||
const FString NewUrl = URL.IsEmpty() ? TEXT("ws://127.0.0.1:3000/ws") : URL;
|
const FString NewUrl = URL.IsEmpty() ? TEXT("ws://127.0.0.1:3000/world") : URL;
|
||||||
const FString NewProtocol = Protocol.IsEmpty() ? TEXT("ws") : Protocol;
|
const FString NewProtocol = Protocol.IsEmpty() ? TEXT("ws") : Protocol;
|
||||||
|
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Opening WebSocket URL: %s"), *NewUrl);
|
UE_LOG(LogTemp, Warning, TEXT("Opening WebSocket URL: %s"), *NewUrl);
|
||||||
@ -66,6 +67,9 @@ void ULuckyDataTransferSubsystem::Internal_OpenWebsocket(const FString& URL, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
Socket = FWebSocketsModule::Get().CreateWebSocket(NewUrl);
|
Socket = FWebSocketsModule::Get().CreateWebSocket(NewUrl);
|
||||||
|
|
||||||
|
if (Socket.IsValid()) UE_LOG(LogTemp, Warning, TEXT("socket Valid %s"), *NewUrl);
|
||||||
|
|
||||||
Socket->Connect();
|
Socket->Connect();
|
||||||
|
|
||||||
//Set up callbacks
|
//Set up callbacks
|
||||||
@ -80,8 +84,9 @@ void ULuckyDataTransferSubsystem::Callback_OnConnected()
|
|||||||
if (OnSocketReady.IsBound())
|
if (OnSocketReady.IsBound())
|
||||||
{
|
{
|
||||||
OnSocketReady.Broadcast(true);
|
OnSocketReady.Broadcast(true);
|
||||||
UE_LOG(LogTemp, VeryVerbose, TEXT("WebSocket connected successfully"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UE_LOG(LogTemp, Warning, TEXT("WebSocket connected successfully"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyDataTransferSubsystem::Callback_OnConnectionError(const FString& Error)
|
void ULuckyDataTransferSubsystem::Callback_OnConnectionError(const FString& Error)
|
||||||
@ -207,7 +212,7 @@ bool ULuckyDataTransferSubsystem::WriteImageToDisk(const FString& inPath, const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FString Path = inPath.IsEmpty() ? TEXT("C:/LuckyRobotsImages") : inPath;
|
FString Path = inPath.IsEmpty() ? TEXT("../Saved/LuckyRobotsData") : inPath; // swap this for const path
|
||||||
|
|
||||||
if (!SensorPawns.IsEmpty())
|
if (!SensorPawns.IsEmpty())
|
||||||
{
|
{
|
||||||
|
@ -58,6 +58,9 @@ public:
|
|||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
||||||
FString filePath = FString();
|
FString filePath = FString();
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
||||||
|
FString timeStamp = FString();
|
||||||
};
|
};
|
||||||
|
|
||||||
USTRUCT(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
@ -67,10 +70,14 @@ struct FObservationPayload
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
||||||
FString timeStamp = FString();
|
FString type = FString();
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
||||||
FString id = FString();
|
FString request_id = FString();
|
||||||
|
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
||||||
|
FString timeStamp = FString();
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
UPROPERTY(BlueprintReadWrite, Category = "Observation")
|
||||||
TMap<FString, float> ObservationState;
|
TMap<FString, float> ObservationState;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user