Main Content

ROS Write Point Cloud, ROS 2 Write Point Cloud

Write point cloud data to a ROS or ROS 2 message

Since R2022a

  • ROS Write Point Cloud Block

Libraries:
ROS Toolbox / ROS
ROS Toolbox / ROS 2

Description

The Write Point Cloud block writes point cloud data to a ROS or ROS 2 point cloud message. You can specify the appropriate color encoding for the point cloud image and write the corresponding color and alpha values to the output message. You can also write intensity values to the output message. Use the ROS Publish or ROS 2 Publish block to publish the output image message to an active topic on the network.

Examples

Ports

Input

expand all

x-, y-, and z- coordinates of each point in the point cloud data, specified as either an N-by-3 matrix or h-by-w-by-3 array. N is the number of points in the point cloud. h and w are the height and width of the image, in pixels.

Data Types: single

RGB values for each point of the point cloud data, specified as either an N-by-3 matrix or h-by-w-by-3 array. N is the number of points in the point cloud. h and w are the height and width of the image in pixels. The RGB values specify the red, green, and blue color intensities in the range of [0,1].

Dependencies

The selected color field must support rgb values.

Data Types: double

Alpha channel for image, specified as an N-by-1 vector or h-by-w matrix. Each element has a value in the range [0,1] that indicates the opacity of the corresponding pixel, with a value of 0 being completely transparent.

Dependencies

The selected color field must support alpha channel.

Data Types: double

Intensity values for each point in the point cloud data, specified as either an N-by-3 matrix or h-by-w-by-3 array. N is the number of points in the point cloud. h and w are the height and width of the image, in pixels.

Dependencies

You must select the Write to Intensity Field parameter.

Data Types: single | double

Output

expand all

ROS or ROS 2 point cloud message, returned as a nonvirtual bus. You can use the ROS Publish or ROS 2 Publish block to publish the message to an active ROS or ROS 2 network respectively.

Data Types: bus

Parameters

expand all

Color field of the point cloud image, specified as one of the supported options. Choose the appropriate option to specify color and alpha values corresponding to the point cloud image.

Select whether to write intensity values to the output message.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2022a