RealSenseInspector.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "PCH.h"
4 #include "RealSenseTypes.h"
5 #include "RuntimeMeshComponent.h"
6 #include "RealSenseInspector.generated.h"
7 
8 // DECLARE_RUNTIME_MESH_VERTEX(VertexName, NeedsPosition, NeedsNormal, NeedsTangent, NeedsColor, UVChannelCount, TangentsType, UVChannelType)
10 
11 UCLASS(ClassGroup="RealSense", BlueprintType)
12 class REALSENSE_API ARealSenseInspector : public AActor
13 {
14  GENERATED_UCLASS_BODY()
16  friend class FRealSenseInspectorCustomization;
17 
18 public:
19 
20  virtual ~ARealSenseInspector();
21 
22  UPROPERTY(Category="RealSense", BlueprintReadOnly)
23  class URealSenseContext* Context;
24 
25  UPROPERTY(Category="RealSense", BlueprintReadOnly)
26  class URealSenseDevice* ActiveDevice;
27 
28  UFUNCTION(Category="RealSense", BlueprintCallable)
29  virtual bool Start();
30 
31  UFUNCTION(Category="RealSense", BlueprintCallable)
32  virtual void Stop();
33 
34  // Device
35 
36  UPROPERTY(Category="Device", BlueprintReadWrite, EditAnywhere)
37  FString DeviceSerial;
38 
39  UPROPERTY(Category = "Device", BlueprintReadWrite, EditAnywhere)
40  ERealSensePipelineMode PipelineMode = ERealSensePipelineMode::CaptureOnly;
41 
42  UPROPERTY(Category = "Device", BlueprintReadWrite, EditAnywhere)
43  FString CaptureFile;
44 
45  UPROPERTY(Category="Device", BlueprintReadWrite, EditAnywhere)
46  bool bEnablePolling = false;
47 
48  UPROPERTY(Category="Device", BlueprintReadWrite, EditAnywhere, meta=(ClampMin="0.001", ClampMax="1", UIMin="0.001", UIMax="1"))
49  float PollFrameRate = 1.0f / 60.0f;
50 
51  UPROPERTY(Category="Device", BlueprintReadWrite, EditAnywhere, meta=(ClampMin="0.001", ClampMax="10", UIMin="0.001", UIMax="10"))
52  float WaitFrameTimeout = 1.0f;
53 
54  // Depth
55 
56  UPROPERTY(Category="DepthStream", BlueprintReadWrite, EditAnywhere)
57  FRealSenseStreamMode DepthConfig;
58 
59  UPROPERTY(Category="DepthStream", BlueprintReadWrite, EditAnywhere)
60  bool bEnableRawDepth = true;
61 
62  UPROPERTY(Category="DepthStream", BlueprintReadWrite, EditAnywhere)
63  bool bEnableColorizedDepth = true;
64 
65  UPROPERTY(Category = "DepthStream", BlueprintReadWrite, EditAnywhere)
66  bool bAlignDepthToColor = true;
67 
68  UPROPERTY(Category="DepthStream", BlueprintReadWrite, EditAnywhere)
69  bool bEqualizeHistogram = true;
70 
71  UPROPERTY(Category="DepthStream", BlueprintReadWrite, EditAnywhere, meta=(ClampMin="0", ClampMax="10", UIMin="0", UIMax="10"))
72  float DepthMin = 0;
73 
74  UPROPERTY(Category="DepthStream", BlueprintReadWrite, EditAnywhere, meta=(ClampMin="0.1", ClampMax="10", UIMin="0.1", UIMax="10"))
75  float DepthMax = 10;
76 
77  UPROPERTY(Category="DepthStream", BlueprintReadWrite, EditAnywhere)
78  ERealSenseDepthColormap DepthColormap;
79 
80  UPROPERTY(Category="DepthStream", BlueprintReadOnly)
81  float DepthScale = 0.001f;
82 
83  UPROPERTY(Category="DepthStream", BlueprintReadOnly)
84  UTexture2D* DepthRawTexture;
85 
86  UPROPERTY(Category="DepthStream", BlueprintReadOnly)
87  UTexture2D* DepthColorizedTexture;
88 
89  // Color
90 
91  UPROPERTY(Category="ColorStream", BlueprintReadWrite, EditAnywhere)
92  FRealSenseStreamMode ColorConfig;
93 
94  UPROPERTY(Category="ColorStream", BlueprintReadWrite, EditAnywhere)
95  bool bEnableColor = true;
96 
97  UPROPERTY(Category="ColorStream", BlueprintReadOnly)
98  UTexture2D* ColorTexture;
99 
100  // Infrared
101 
102  UPROPERTY(Category="InfraredStream", BlueprintReadWrite, EditAnywhere)
103  FRealSenseStreamMode InfraredConfig;
104 
105  UPROPERTY(Category="InfraredStream", BlueprintReadWrite, EditAnywhere)
106  bool bEnableInfrared = true;
107 
108  UPROPERTY(Category="InfraredStream", BlueprintReadOnly)
109  UTexture2D* InfraredTexture;
110 
111  // PointCloud
112 
113  UFUNCTION(Category="PointCloud", BlueprintCallable)
114  void SetPointCloudMaterial(int SectionId, UMaterialInterface* Material);
115 
116  UPROPERTY(Category="PointCloud", BlueprintReadWrite, EditAnywhere)
117  bool bEnablePcl = false;
118 
119  UPROPERTY(Category="PointCloud", BlueprintReadWrite, EditAnywhere, meta=(ClampMin="0.0", UIMin="0.0"))
120  float PclScale = 1.0f;
121 
122  UPROPERTY(Category="PointCloud", BlueprintReadWrite, EditAnywhere, meta=(ClampMin="0.0001", ClampMax="10", UIMin="0.0001", UIMax="10"))
123  float PclVoxelSize = 1.0f;
124 
125  UPROPERTY(Category="PointCloud", BlueprintReadWrite, EditAnywhere, meta=(ClampMin="0.0", ClampMax="1.0", UIMin="0.0", UIMax="1.0"))
126  float PclDensity = 0.2f;
127 
128  UPROPERTY(Category="PointCloud", BlueprintReadWrite, EditAnywhere, meta=(ClampMin="0.016", ClampMax="100.0", UIMin="0.016", UIMax="100.0"))
129  float PclRenderRate = 5;
130 
131  UPROPERTY(Category="PointCloud", BlueprintReadOnly)
132  class URuntimeMeshComponent* PclMesh;
133 
134  UPROPERTY(Category = "PointCloud", BlueprintReadOnly)
135  class UMaterialInterface* PclMaterial;
136 
137 protected:
138 
139  // AActor
140  virtual void Tick(float DeltaSeconds) override;
141 
142 private:
143 
144  void GetDeviceDefaultProfileConfig();
145  void ThreadProc();
146  void PollFrames();
147  void WaitFrames();
148  void ProcessFrameset(class rs2::frameset* Frameset);
149  void UpdatePointCloud();
150  void EnsureProfileSupported(class URealSenseDevice* Device, ERealSenseStreamType StreamType, ERealSenseFormatType Format, FRealSenseStreamMode Mode);
151 
152  FCriticalSection StateMx;
153  FCriticalSection PointCloudMx;
154 
155  TUniquePtr<class FDynamicTexture> DepthRawDtex;
156  TUniquePtr<class FDynamicTexture> DepthColorizedDtex;
157  TUniquePtr<class FDynamicTexture> ColorDtex;
158  TUniquePtr<class FDynamicTexture> InfraredDtex;
159 
160  TUniquePtr<class rs2::pipeline> RsPipeline;
161  TUniquePtr<class rs2::device> RsDevice;
162  TUniquePtr<class rs2::align> RsAlign;
163 
165  {
166  TArray<FPointCloudVertex> PclVertices;
167  TArray<int32> PclIndices;
168  };
169 
170  TUniquePtr<class rs2::pointcloud> RsPointCloud;
171  TUniquePtr<class rs2::points> RsPoints;
172  TMap< int32, TUniquePtr<FMeshSection> > PclMeshData;
173  int PclFramesetId = 0;
174  float PclRenderAccum = 0;
175  volatile int PclCalculateFlag = false;
176  volatile int PclReadyFlag = false;
177 
178  TUniquePtr<class FRealSenseInspectorWorker> Worker;
179  TUniquePtr<class FRunnableThread> Thread;
180  volatile int StartedFlag = false;
181  volatile int FramesetId = 0;
182 };
183 
184 class FRealSenseInspectorWorker : public FRunnable
185 {
186 public:
189  virtual bool Init() { return true; }
190  virtual uint32 Run() { Context->ThreadProc(); return 0; }
191  virtual void Stop() { Context->StartedFlag = false; }
192 
193 private:
195 };
Definition: cah-model.h:10
Mode
Definition: monitors.c:40
::sensor_msgs::PointCloud_< std::allocator< void > > PointCloud
Definition: PointCloud.h:60
ARealSenseInspector * Context
ERealSenseDepthColormap
TMap< int32, TUniquePtr< FMeshSection > > PclMeshData
GLdouble f
TUniquePtr< class rs2::pointcloud > RsPointCloud
ERealSensePipelineMode
ERealSenseFormatType
TUniquePtr< class FRunnableThread > Thread
TUniquePtr< class FRealSenseInspectorWorker > Worker
ERealSenseStreamType
FRealSenseInspectorWorker(ARealSenseInspector *Context)
TArray< FPointCloudVertex > PclVertices
#define DECLARE_RUNTIME_MESH_VERTEX(VertexName, NeedsPosition, NeedsNormal, NeedsTangent, NeedsColor, UVChannelCount, TangentsType, UVChannelType)
TUniquePtr< class rs2::points > RsPoints
auto device
Definition: pyrs_net.cpp:17


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:39