On this page

multiArrayLayout QML Value Type

This was originally provided as an example message. More...

Import Statement: import QtRos2.StdMsgs
Status: Deprecated since Foxy

This type is deprecated since QtRos2.StdMsgs Foxy. We strongly advise against using it in new code.

Properties

Detailed Description

It is recommended to create your own semantically meaningful message. However if you would like to continue using this please use the equivalent in example_msgs.

The multiarray declares a generic multi-dimensional array of a particular data type. Dimensions are ordered from outer most to inner most.

Accessors should ALWAYS be written in terms of dimension stride and specified outer-most dimension first.

multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]

A standard, 3-channel 640x480 image with interleaved color channels would be specified as:

dim[0].label = "height" dim[0].size = 480 dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image) dim[1].label = "width" dim[1].size = 640 dim[1].stride = 3*640 = 1920 dim[2].label = "channel" dim[2].size = 3 dim[2].stride = 3

multiarray(i,j,k) refers to the ith row, jth column, and kth channel.

multiArrayLayout is a structured value type usable in QML. It maps directly to the std_msgs::msg::MultiArrayLayout ROS 2 message type.

Construct a multiArrayLayout in QML by assigning a JavaScript object whose keys are its component properties, or by setting those properties individually.

See also MultiArrayLayoutPublisher and MultiArrayLayoutSubscriber.

Property Documentation

dataOffset : uint32_t

dim : list<multiArrayDimension>

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.