rosReadField
Read point cloud data from ROS or ROS 2 message structure based on field name
Since R2021a
Syntax
Description
preserves the organizational structure of the point cloud field data returned in the
fielddata
= rosReadField(pcloud
,fieldname
,"PreserveStructureOnRead",true)fielddata
output. For more information, see Preserving Point Cloud Structure.
fielddata = rosReadField(pcloud,fieldname,"Datatype","double")
reads the point field data in double precision during code generation. If you use
this syntax for MATLAB® execution, the function always reads the data in the precision
specified by the corresponding field in the input message structure,
pcloud
.
Input Arguments
Output Arguments
Tips
Point cloud data can be organized in either 1-D lists or in 2-D image styles. 2-D
image styles usually come from depth sensors or stereo cameras. The
rosReadField
function contains a
PreserveStructureOnRead
input Name,Value
argument that you can either set to true
or false
(default). If you set the argument to true
, the function preserves
the organizational structure of the point
cloud.
rgb = rosReadField(pcloud,"PreserveStructureOnRead",true)
When you preserve the structure, the output matrices are of size m-by-n-by-d, where m is the height, n is the width, and d is the number of return values for each point. Otherwise, all points are returned as a x-by-d list. This structure can be preserved only if the point cloud is organized.
Extended Capabilities
Version History
Introduced in R2021a