User Manual
- 9 -
\n",event->MeasureData.full_depth_data->distance_average);
break
;
case
SIMPLE_DEPTH_PACKET
:
break
;
case
NULL_PACKET
:
break
;
default
:
printf
("system error\n");
break
;
}
}
return
0;
}
③Observer initialization ,code is as follow:
/*Observer initialization*/
AsyncIObserver_t My_Observer; /*Define observer */
/*An observer subscribes to an event as a data receive event*/
My_Observer.AsyncEvent =
ISubject_Event_DataRecvd
;
My_Observer.NotifyEnable = true; /*observer enable*/
/*Set the observer id,which currently supports only a single observer*/
My_Observer.ObserverID = 0;
④Add asynchronous observer, code is as follow:
/*Adding asynchronous observers,Only valid in asynchronous or continuous
measurement mode*/
HPS3D_AddObserver(&
User_Func
,&handle,&My_Observer);
6. The configuration of steps 1-5 can measure the data normally. The default data is the complete
depth map data packet (including depth data). There are four types of returned packets: simple
ROI packets (without depth data), complete ROI packets (with depth data), simple depth packets
(without depth data), and complete deep packets (with depth data). It can also be converted to
point cloud packets (only full ROI packets and full depth packets are available for point cloud format
conversion).
Note: Depth data is stored in a one-dimensional array, stored in order, if you need, please traverse.
(1) The default is the complete depth map data packet (including depth data) output. To configure
simple packet output, you need to call the function HPS3D_SetPacketType to set it. code show as
below:
/*set measure packet*/
handle.PacketType =
PACKET_SIMPLE
;/*set simple packet*/
HPS3D_SetPacketType(&handle);
(2) If it is to be configured as a ROI packet (simple and complete package with (1) configuration),
just set the ROI area and enable the ROI. If you need to set the threshold to configure itself, the
code is as follows:
ROIConfTypeDef roi_conf;
/*set ROI config*/
roi_conf.roi_id = 0;










