forked from plusone-robotics/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pointcloud.m
28 lines (26 loc) · 1.1 KB
/
pointcloud.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% Wraps librealsense2 pointcloud class
classdef pointcloud < realsense.options
methods
% Constructor
function this = pointcloud()
out = realsense.librealsense_mex('rs2::pointcloud', 'new');
this = [email protected](out);
end
% Destructor (uses base class destructor)
% Functions
function points = calculate(this, depth)
narginchk(2, 2)
validateattributes(depth, {'realsense.frame'}, {'scalar'}, '', 'depth', 2);
if ~depth.is('depth_frame')
error('Expected input number 2, depth, to be a depth_frame');
end
out = realsense.librealsense_mex('rs2::pointcloud', 'calculate', this.objectHandle, depth.objectHandle);
points = realsense.points(out);
end
function map_to(this, mapped)
narginchk(2, 2)
validateattributes(mapped, {'realsense.frame'}, {'scalar'}, '', 'mapped', 2);
realsense.librealsense_mex('rs2::pointcloud', 'map_to', this.objectHandle, mapped.objectHandle);
end
end
end