%% Get and Plot a 3-D Point Cloud
% Connect to a ROS network. Subscribe to a point cloud message topic.

rosinit('192.168.17.129')
sub = rossubscriber('/camera/depth/points');
pause(1)

%
% Get the latest point cloud message. Plot the point cloud.

pcloud = sub.LatestMessage;
scatter3(pcloud)

%
% Plot all points as black dots.

scatter3(sub.LatestMessage,'MarkerEdgeColor',[0 0 0]);

% Copyright 2019 The MathWorks, Inc.