Skip to content

Commit

Permalink
push to sdk 4.0.6 (#28)
Browse files Browse the repository at this point in the history
* add new plane detection parameter

* remove body 70 from ai models

* add missing copy

* update c lib

* change default input to usb
  • Loading branch information
Bvallon-sl authored Aug 10, 2023
1 parent 1817bd7 commit 6b934fb
Show file tree
Hide file tree
Showing 16 changed files with 420 additions and 74 deletions.
Binary file modified Content/ZED/Blueprints/BodyTracking/ABP_ZED_Manny.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Content/ZED/Levels/L_BodyTrackingMulti.umap
Binary file not shown.
Binary file modified Content/ZED/Levels/L_BodyTrackingSingle.umap
Binary file not shown.
Binary file modified Content/ZED/Levels/L_CameraTracking.umap
Binary file not shown.
Binary file modified Content/ZED/Levels/L_DynamicCrosshairOnMouse.umap
Binary file not shown.
Binary file modified Content/ZED/Levels/L_PlaneDetection.umap
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,9 @@ enum class ESlAIModels : uint8
AIM_HumanBody38FastDetection UMETA(DisplayName = "Human body 38 fast Detection"),
AIM_HumanBody38MediumDetection UMETA(DisplayName = "Human body 38 medium Detection"),
AIM_HumanBody38AccurateDetection UMETA(DisplayName = "Human body 38 accurate Detection"),
AIM_HumanBody70FastDetection UMETA(DisplayName = "Human body 70 fast Detection"),
AIM_HumanBody70MediumDetection UMETA(DisplayName = "Human body 70 medium Detection"),
AIM_HumanBody70AccurateDetection UMETA(DisplayName = "Human body 70 accurate Detection"),
//AIM_HumanBody70FastDetection UMETA(DisplayName = "Human body 70 fast Detection"),
//AIM_HumanBody70MediumDetection UMETA(DisplayName = "Human body 70 medium Detection"),
//AIM_HumanBody70AccurateDetection UMETA(DisplayName = "Human body 70 accurate Detection"),
AIM_PersonHeadFastDetection UMETA(DisplayName = "Person head fast Detection"),
AIM_PersonHeadAccurateDetection UMETA(DisplayName = "Person head accurate Detection"),
AIM_REIDAssociation UMETA(DisplayName = "REID Association"),
Expand Down Expand Up @@ -1037,7 +1037,8 @@ struct STEREOLABS_API FSlCameraParameters
HFocal(0.0f),
VFocal(0.0f),
OpticalCenterX(0.0f),
OpticalCenterY(0.0f)
OpticalCenterY(0.0f),
FocalLengthMetric(0.0f)
{
}

Expand Down Expand Up @@ -1072,6 +1073,10 @@ struct STEREOLABS_API FSlCameraParameters
/** Vertical position of the optical center in pixels */
UPROPERTY(BlueprintReadOnly)
float OpticalCenterY;

/** Real focal length in millimeters */
UPROPERTY(BlueprintReadOnly)
float FocalLengthMetric;
};

/*
Expand Down Expand Up @@ -1365,6 +1370,39 @@ struct STEREOLABS_API FSlSpatialMappingParameters
bool bUseChunkOnly = false;
};

/**
\class PlaneDetectionParameters
\brief Sets the plane detection parameters.
The default constructor sets all parameters to their default settings.
*/
USTRUCT(BlueprintType, Category = "Stereolabs|Types")
struct STEREOLABS_API FSlPlaneDetectionParameters
{
GENERATED_BODY()

FSlPlaneDetectionParameters()
:
MaxDistanceThreshold(0.15f),
NormalSimilarityThreshold(15.0f)
{
}

/**
\brief controls the spread of plane by checking the position difference.
\n default: 0.15 meters
*/
UPROPERTY(BlueprintReadOnly)
float MaxDistanceThreshold;

/**
\brief controls the spread of plane by checking the angle difference.
\n default: 15 degree
*/
UPROPERTY(BlueprintReadOnly)
float NormalSimilarityThreshold;
};

/*
* SDK recording state
* see sl::RecordingState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,7 @@ namespace sl
CameraParameters.VFocal = SlData.fy;
CameraParameters.OpticalCenterX = SlData.cx;
CameraParameters.OpticalCenterY = SlData.cy;
CameraParameters.FocalLengthMetric = SlData.focal_length_metric;

std::vector<double> Tmp;
Tmp.assign(SlData.disto, SlData.disto + 5);
Expand All @@ -1612,6 +1613,7 @@ namespace sl
CameraParameters.VFocal = SlData.fy;
CameraParameters.OpticalCenterX = SlData.cx;
CameraParameters.OpticalCenterY = SlData.cy;
CameraParameters.FocalLengthMetric = SlData.focal_length_metric;

std::vector<double> Tmp;
Tmp.assign(SlData.disto, SlData.disto + 5);
Expand Down Expand Up @@ -2295,6 +2297,19 @@ namespace sl
return sl::MeshFilterParameters(sl::unreal::ToSlType(UnrealData.FilterIntensity));
}

/*
* Convert from FSlPlaneDetectionParameters to sl::PlaneDetectionParameters
*/
FORCEINLINE SL_PlaneDetectionParameters ToSlType(const FSlPlaneDetectionParameters& UnrealData)
{
struct SL_PlaneDetectionParameters PlaneDetectionParameters;

PlaneDetectionParameters.max_distance_threshold = UnrealData.MaxDistanceThreshold;
PlaneDetectionParameters.normal_similarity_threshold = UnrealData.NormalSimilarityThreshold;

return PlaneDetectionParameters;
}

/*
* Convert from sl::CameraParameters to FSlCameraParameters
*/
Expand All @@ -2309,11 +2324,20 @@ namespace sl
CameraParameters.cx = UnrealData.OpticalCenterX;
CameraParameters.cy = UnrealData.OpticalCenterY;

CameraParameters.focal_length_metric = UnrealData.FocalLengthMetric;

CameraParameters.disto[0] = UnrealData.Disto[0];
CameraParameters.disto[1] = UnrealData.Disto[1];
CameraParameters.disto[2] = UnrealData.Disto[2];
CameraParameters.disto[3] = UnrealData.Disto[3];
CameraParameters.disto[4] = UnrealData.Disto[4];
CameraParameters.disto[5] = UnrealData.Disto[5];
CameraParameters.disto[6] = UnrealData.Disto[6];
CameraParameters.disto[7] = UnrealData.Disto[7];
CameraParameters.disto[8] = UnrealData.Disto[8];
CameraParameters.disto[9] = UnrealData.Disto[9];
CameraParameters.disto[10] = UnrealData.Disto[10];
CameraParameters.disto[11] = UnrealData.Disto[11];

CameraParameters.image_size = sl::unreal::ToSlType2(UnrealData.Resolution);

Expand Down
Binary file not shown.
Loading

0 comments on commit 6b934fb

Please sign in to comment.