www.gusucode.com > robotics 案例源码程序 matlab代码 > robotics/InspectPointCloud2ImageExample.m

    %% Inspect Point Cloud Image
% Access and visualize the data inside a point cloud message.
%%
% Create sample ROS messages and inspect a point cloud image. |ptcloud| is
% a sample ROS |PointCloud2| message object.
exampleHelperROSLoadMessages
ptcloud
%%
% Get RGB info and _xyz_-coordinates from the point cloud using |readXYZ| and |readRGB|.
xyz = readXYZ(ptcloud);
rgb = readRGB(ptcloud);
%%
% Display the point cloud in a figure using |scatter3|.
scatter3(ptcloud)