Optimize CaptureSetting, GoalTask, etc.

This commit is contained in:
martinluckyrobots
2025-04-02 13:40:55 +08:00
parent 1ee9f9f209
commit 4b116bf9da
5 changed files with 311 additions and 9 deletions

View File

@ -75,7 +75,27 @@ enum class EGoalType : uint8
{
GrabAndPull UMETA(DisplayName = "Grab and Pull"),
GrabAndRotate UMETA(DisplayName = "Grab and Rotate"),
GrabAndOpen UMETA(DisplayName = "Grab and Open"),
PickAndPlace UMETA(DisplayName = "Pick and Place"),
Pick UMETA(DisplayName = "Pick"),
GrabAndInsert UMETA(DisplayName = "Grab and Insert"),
Find UMETA(DisplayName = "Find"),
Point UMETA(DisplayName = "Point"),
PointWithLaserPointer UMETA(DisplayName = "Point with Laser Pointer"),
RotateHand UMETA(DisplayName = "Rotate Hand"),
SliceDice UMETA(DisplayName = "Slice/Dice"),
Wipe UMETA(DisplayName = "Wipe"),
FoldUnfold UMETA(DisplayName = "Fold/Unfold"),
ArrangeOrganize UMETA(DisplayName = "Arrange/Organize"),
PressButton UMETA(DisplayName = "Press Button"),
PourDispense UMETA(DisplayName = "Pour/Dispense"),
NavigateSimpleEnvironments UMETA(DisplayName = "Navigate Simple Environments"),
NavigateComplexTerrain UMETA(DisplayName = "Navigate Complex Terrain"),
ClimbStairsOrRamps UMETA(DisplayName = "Climb Stairs or Ramps"),
BalanceStabilize UMETA(DisplayName = "Balance/Stabilize"),
DockingAndCharging UMETA(DisplayName = "Docking and Charging"),
ChangeGripper UMETA(DisplayName = "Change Gripper"),
Place UMETA(DisplayName = "Place")
};
USTRUCT(BlueprintType)
@ -131,6 +151,32 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<ERobotsCategories> RobotTypeList;
bool operator==(const FLevelData& Other) const
{
return ID == Other.ID &&
LevelEnum == Other.LevelEnum &&
LevelType == Other.LevelType &&
LevelObject == Other.LevelObject &&
LevelImage == Other.LevelImage &&
bActive == Other.bActive &&
RobotTypeList == Other.RobotTypeList;
}
FLevelData& operator=(const FLevelData& Other)
{
if (this != &Other)
{
ID = Other.ID;
LevelEnum = Other.LevelEnum;
LevelType = Other.LevelType;
LevelObject = Other.LevelObject;
LevelImage = Other.LevelImage;
bActive = Other.bActive;
RobotTypeList = Other.RobotTypeList;
}
return *this;
}
};
USTRUCT(BlueprintType)
@ -148,7 +194,7 @@ public:
FTransform TargetLocation;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
AActor* TargetActor;
TSoftObjectPtr<UObject> TargetActor;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bIsComplate;
@ -161,6 +207,34 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bActive;
bool operator==(const FGoalsTaskData& Other) const
{
return GoalType == Other.GoalType &&
bIsStart == Other.bIsStart &&
TargetLocation.Equals(Other.TargetLocation, 0.01f) &&
TargetActor == Other.TargetActor &&
bIsComplate == Other.bIsComplate &&
DropOffLocation.Equals(Other.DropOffLocation, 0.01f) &&
ObjectName == Other.ObjectName &&
bActive == Other.bActive;
}
FGoalsTaskData& operator=(const FGoalsTaskData& Other)
{
if (this != &Other)
{
GoalType = Other.GoalType;
bIsStart = Other.bIsStart;
TargetLocation = Other.TargetLocation;
TargetActor = Other.TargetActor;
bIsComplate = Other.bIsComplate;
DropOffLocation = Other.DropOffLocation;
ObjectName = Other.ObjectName;
bActive = Other.bActive;
}
return *this;
}
};
USTRUCT(BlueprintType)
@ -169,13 +243,13 @@ struct FCaptureSettingsData : public FTableRowBase
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText FolderName;
FText FolderName = FText::FromString("robotdata");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText FileName;
FText FileName = FText::FromString("FILE");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText WritesPerSec;
FText WritesPerSec = FText::FromString("1");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
@ -203,20 +277,84 @@ public:
bool bPeople;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText NumberOfPeople;
FText NumberOfPeople = FText::FromString("1");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bObjects;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText NumberOfObjects;
FText NumberOfObjects = FText::FromString("1");
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<UStaticMeshComponent*> RandomMeshes;
TArray<TSoftObjectPtr<UStaticMeshComponent>> RandomMeshes;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bInfiniteCapture;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText NumberOfCaptures;
FText NumberOfCaptures = FText::FromString("1");
bool operator==(const FCaptureSettingsData& Other) const
{
return FolderName.EqualTo(Other.FolderName) &&
FileName.EqualTo(Other.FileName) &&
WritesPerSec.EqualTo(Other.WritesPerSec) &&
IsScenario == Other.IsScenario &&
TaskList == Other.TaskList &&
bLight == Other.bLight &&
bMaterials == Other.bMaterials &&
bRobotPosition == Other.bRobotPosition &&
bPets == Other.bPets &&
NumberOfPets.EqualTo(Other.NumberOfPets) &&
bPeople == Other.bPeople &&
NumberOfPeople.EqualTo(Other.NumberOfPeople) &&
bObjects == Other.bObjects &&
NumberOfObjects.EqualTo(Other.NumberOfObjects) &&
RandomMeshes == Other.RandomMeshes &&
bInfiniteCapture == Other.bInfiniteCapture &&
NumberOfCaptures.EqualTo(Other.NumberOfCaptures);
}
FCaptureSettingsData& operator=(const FCaptureSettingsData& Other)
{
if (this != &Other)
{
FolderName = Other.FolderName;
FileName = Other.FileName;
WritesPerSec = Other.WritesPerSec;
IsScenario = Other.IsScenario;
TaskList = Other.TaskList;
bLight = Other.bLight;
bMaterials = Other.bMaterials;
bRobotPosition = Other.bRobotPosition;
bPets = Other.bPets;
NumberOfPets = Other.NumberOfPets;
bPeople = Other.bPeople;
NumberOfPeople = Other.NumberOfPeople;
bObjects = Other.bObjects;
NumberOfObjects = Other.NumberOfObjects;
RandomMeshes = Other.RandomMeshes;
bInfiniteCapture = Other.bInfiniteCapture;
NumberOfCaptures = Other.NumberOfCaptures;
}
return *this;
}
};
USTRUCT(BlueprintType)
struct FAllGoalListData : public FTableRowBase
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
EGoalType GoalType;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString Example;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TSubclassOf<UUserWidget> Widget;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bIsActive;
};