Skip to content

Commit 6b934fb

Browse files
authored
push to sdk 4.0.6 (#28)
* add new plane detection parameter * remove body 70 from ai models * add missing copy * update c lib * change default input to usb
1 parent 1817bd7 commit 6b934fb

File tree

16 files changed

+420
-74
lines changed

16 files changed

+420
-74
lines changed
Binary file not shown.
Binary file not shown.
-37 Bytes
Binary file not shown.
-7 Bytes
Binary file not shown.
6.48 KB
Binary file not shown.
36 Bytes
Binary file not shown.
36 Bytes
Binary file not shown.

Plugins/Stereolabs/Source/Stereolabs/Public/Core/StereolabsBaseTypes.h

+42-4
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,9 @@ enum class ESlAIModels : uint8
579579
AIM_HumanBody38FastDetection UMETA(DisplayName = "Human body 38 fast Detection"),
580580
AIM_HumanBody38MediumDetection UMETA(DisplayName = "Human body 38 medium Detection"),
581581
AIM_HumanBody38AccurateDetection UMETA(DisplayName = "Human body 38 accurate Detection"),
582-
AIM_HumanBody70FastDetection UMETA(DisplayName = "Human body 70 fast Detection"),
583-
AIM_HumanBody70MediumDetection UMETA(DisplayName = "Human body 70 medium Detection"),
584-
AIM_HumanBody70AccurateDetection UMETA(DisplayName = "Human body 70 accurate Detection"),
582+
//AIM_HumanBody70FastDetection UMETA(DisplayName = "Human body 70 fast Detection"),
583+
//AIM_HumanBody70MediumDetection UMETA(DisplayName = "Human body 70 medium Detection"),
584+
//AIM_HumanBody70AccurateDetection UMETA(DisplayName = "Human body 70 accurate Detection"),
585585
AIM_PersonHeadFastDetection UMETA(DisplayName = "Person head fast Detection"),
586586
AIM_PersonHeadAccurateDetection UMETA(DisplayName = "Person head accurate Detection"),
587587
AIM_REIDAssociation UMETA(DisplayName = "REID Association"),
@@ -1037,7 +1037,8 @@ struct STEREOLABS_API FSlCameraParameters
10371037
HFocal(0.0f),
10381038
VFocal(0.0f),
10391039
OpticalCenterX(0.0f),
1040-
OpticalCenterY(0.0f)
1040+
OpticalCenterY(0.0f),
1041+
FocalLengthMetric(0.0f)
10411042
{
10421043
}
10431044

@@ -1072,6 +1073,10 @@ struct STEREOLABS_API FSlCameraParameters
10721073
/** Vertical position of the optical center in pixels */
10731074
UPROPERTY(BlueprintReadOnly)
10741075
float OpticalCenterY;
1076+
1077+
/** Real focal length in millimeters */
1078+
UPROPERTY(BlueprintReadOnly)
1079+
float FocalLengthMetric;
10751080
};
10761081

10771082
/*
@@ -1365,6 +1370,39 @@ struct STEREOLABS_API FSlSpatialMappingParameters
13651370
bool bUseChunkOnly = false;
13661371
};
13671372

1373+
/**
1374+
\class PlaneDetectionParameters
1375+
\brief Sets the plane detection parameters.
1376+
1377+
The default constructor sets all parameters to their default settings.
1378+
*/
1379+
USTRUCT(BlueprintType, Category = "Stereolabs|Types")
1380+
struct STEREOLABS_API FSlPlaneDetectionParameters
1381+
{
1382+
GENERATED_BODY()
1383+
1384+
FSlPlaneDetectionParameters()
1385+
:
1386+
MaxDistanceThreshold(0.15f),
1387+
NormalSimilarityThreshold(15.0f)
1388+
{
1389+
}
1390+
1391+
/**
1392+
\brief controls the spread of plane by checking the position difference.
1393+
\n default: 0.15 meters
1394+
*/
1395+
UPROPERTY(BlueprintReadOnly)
1396+
float MaxDistanceThreshold;
1397+
1398+
/**
1399+
\brief controls the spread of plane by checking the angle difference.
1400+
\n default: 15 degree
1401+
*/
1402+
UPROPERTY(BlueprintReadOnly)
1403+
float NormalSimilarityThreshold;
1404+
};
1405+
13681406
/*
13691407
* SDK recording state
13701408
* see sl::RecordingState

Plugins/Stereolabs/Source/Stereolabs/Public/Core/StereolabsCoreGlobals.h

+24
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,7 @@ namespace sl
15891589
CameraParameters.VFocal = SlData.fy;
15901590
CameraParameters.OpticalCenterX = SlData.cx;
15911591
CameraParameters.OpticalCenterY = SlData.cy;
1592+
CameraParameters.FocalLengthMetric = SlData.focal_length_metric;
15921593

15931594
std::vector<double> Tmp;
15941595
Tmp.assign(SlData.disto, SlData.disto + 5);
@@ -1612,6 +1613,7 @@ namespace sl
16121613
CameraParameters.VFocal = SlData.fy;
16131614
CameraParameters.OpticalCenterX = SlData.cx;
16141615
CameraParameters.OpticalCenterY = SlData.cy;
1616+
CameraParameters.FocalLengthMetric = SlData.focal_length_metric;
16151617

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

2300+
/*
2301+
* Convert from FSlPlaneDetectionParameters to sl::PlaneDetectionParameters
2302+
*/
2303+
FORCEINLINE SL_PlaneDetectionParameters ToSlType(const FSlPlaneDetectionParameters& UnrealData)
2304+
{
2305+
struct SL_PlaneDetectionParameters PlaneDetectionParameters;
2306+
2307+
PlaneDetectionParameters.max_distance_threshold = UnrealData.MaxDistanceThreshold;
2308+
PlaneDetectionParameters.normal_similarity_threshold = UnrealData.NormalSimilarityThreshold;
2309+
2310+
return PlaneDetectionParameters;
2311+
}
2312+
22982313
/*
22992314
* Convert from sl::CameraParameters to FSlCameraParameters
23002315
*/
@@ -2309,11 +2324,20 @@ namespace sl
23092324
CameraParameters.cx = UnrealData.OpticalCenterX;
23102325
CameraParameters.cy = UnrealData.OpticalCenterY;
23112326

2327+
CameraParameters.focal_length_metric = UnrealData.FocalLengthMetric;
2328+
23122329
CameraParameters.disto[0] = UnrealData.Disto[0];
23132330
CameraParameters.disto[1] = UnrealData.Disto[1];
23142331
CameraParameters.disto[2] = UnrealData.Disto[2];
23152332
CameraParameters.disto[3] = UnrealData.Disto[3];
23162333
CameraParameters.disto[4] = UnrealData.Disto[4];
2334+
CameraParameters.disto[5] = UnrealData.Disto[5];
2335+
CameraParameters.disto[6] = UnrealData.Disto[6];
2336+
CameraParameters.disto[7] = UnrealData.Disto[7];
2337+
CameraParameters.disto[8] = UnrealData.Disto[8];
2338+
CameraParameters.disto[9] = UnrealData.Disto[9];
2339+
CameraParameters.disto[10] = UnrealData.Disto[10];
2340+
CameraParameters.disto[11] = UnrealData.Disto[11];
23172341

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

Binary file not shown.

0 commit comments

Comments
 (0)