Fixed SOArm100 data capture so it writes the data like in v1.

This commit is contained in:
Behron 2025-04-22 19:26:05 -06:00
parent 7bd4f12a95
commit 4dcd6a6993
25 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,8 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Lib/LuckyDataCaptureSubsystem.h"

View File

@ -162,6 +162,11 @@ FString ULuckyWorldFunctions::FVectorToJsonString(const FVector& Vector)
return TEXT("{}");
}
FString ULuckyWorldFunctions::GetRobotDataCapturePath()
{
return FPaths::ProjectDir() / TEXT("robotdata");
}
const ULuckyWorldSettings* ULuckyWorldFunctions::GetLuckyWorldSettings()
{
return ULuckyWorldSettings::GetLuckyWorldSettings();

View File

@ -0,0 +1,22 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/WorldSubsystem.h"
#include "LuckyDataCaptureSubsystem.generated.h"
/**
*
*/
UCLASS()
class LUCKYWORLD_API UDataCaptureSubsystem : public UWorldSubsystem
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable,Category = "LuckyRobots|DataCapture")
void WriteImageToDisk(UTextureRenderTarget2D* RenderTarget, int32 Count, const FString& Folder);
};

View File

@ -62,6 +62,12 @@ public:
*/
UFUNCTION(BlueprintPure,Category = "LuckyWorld|Utils", meta = (BlueprintAutocast, CompactNodeTitle = "->"))
static FString FVectorToJsonString(const FVector& Vector);
/**
* @return - The RobotData path.
*/
UFUNCTION(BlueprintPure,Category = "LuckyWorld|Utils")
static FString GetRobotDataCapturePath();
/**
* @return - Lucky World Settings.

View File

@ -0,0 +1,35 @@
{
"ActuatorData": [
{
"capture": 1,
"success": false,
"cameras": "{\"FrontCam\":\"FrontCam/1_RGB.jpg\",\"TopCam\":\"TopCam/1_RGB.jpg\"}"
},
{
"capture": 2,
"success": false,
"cameras": "{\"FrontCam\":\"FrontCam/2_RGB.jpg\",\"TopCam\":\"TopCam/2_RGB.jpg\"}"
},
{
"capture": 3,
"success": false,
"cameras": "{\"FrontCam\":\"FrontCam/3_RGB.jpg\",\"TopCam\":\"TopCam/3_RGB.jpg\"}"
},
{
"capture": 4,
"success": false,
"cameras": "{\"FrontCam\":\"FrontCam/4_RGB.jpg\",\"TopCam\":\"TopCam/4_RGB.jpg\"}"
},
{
"capture": 5,
"success": false,
"cameras": "{\"FrontCam\":\"FrontCam/5_RGB.jpg\",\"TopCam\":\"TopCam/5_RGB.jpg\"}"
},
{
"capture": 6,
"success": false,
"cameras": "{\"FrontCam\":\"FrontCam/6_RGB.jpg\",\"TopCam\":\"TopCam/6_RGB.jpg\"}"
}
],
"robotInfoList": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1,28 @@
{
"transforms": [
{
"index": 1,
"transform": "Translation: X=71.764 Y=-107.870 Z=51.549 Rotation: P=-0.000000 Y=-90.000000 R=0.000000 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 2,
"transform": "Translation: X=71.764 Y=-107.870 Z=51.549 Rotation: P=-0.000000 Y=-90.000000 R=0.000000 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 3,
"transform": "Translation: X=71.764 Y=-107.870 Z=51.549 Rotation: P=-0.000000 Y=-90.000000 R=0.000000 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 4,
"transform": "Translation: X=71.764 Y=-107.870 Z=51.549 Rotation: P=-0.000000 Y=-90.000000 R=0.000000 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 5,
"transform": "Translation: X=71.764 Y=-107.870 Z=51.549 Rotation: P=-0.000000 Y=-90.000000 R=0.000000 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 6,
"transform": "Translation: X=71.764 Y=-107.870 Z=51.549 Rotation: P=-0.000000 Y=-90.000000 R=0.000000 Scale: X=1.000 Y=1.000 Z=1.000"
}
]
}

BIN
robotdata/TopCam/1_RGB.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
robotdata/TopCam/2_RGB.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
robotdata/TopCam/3_RGB.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
robotdata/TopCam/4_RGB.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
robotdata/TopCam/5_RGB.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
robotdata/TopCam/6_RGB.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -0,0 +1,28 @@
{
"transforms": [
{
"index": 1,
"transform": "Translation: X=68.764 Y=-179.870 Z=153.549 Rotation: P=-90.000000 Y=-165.963757 R=75.963757 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 2,
"transform": "Translation: X=68.764 Y=-179.870 Z=153.549 Rotation: P=-90.000000 Y=-165.963757 R=75.963757 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 3,
"transform": "Translation: X=68.764 Y=-179.870 Z=153.549 Rotation: P=-90.000000 Y=-165.963757 R=75.963757 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 4,
"transform": "Translation: X=68.764 Y=-179.870 Z=153.549 Rotation: P=-90.000000 Y=-165.963757 R=75.963757 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 5,
"transform": "Translation: X=68.764 Y=-179.870 Z=153.549 Rotation: P=-90.000000 Y=-165.963757 R=75.963757 Scale: X=1.000 Y=1.000 Z=1.000"
},
{
"index": 6,
"transform": "Translation: X=68.764 Y=-179.870 Z=153.549 Rotation: P=-90.000000 Y=-165.963757 R=75.963757 Scale: X=1.000 Y=1.000 Z=1.000"
}
]
}