# Revision history [back]

Yes it's possible.

Have a look at the ROS2 field types https://index.ros.org/doc/ros2/Concepts/About-ROS-Interfaces/#field-types

What you need to do is to define a custom message, such as a ImageStatic.msg

The fields of this message can be the same of the standard Image.msg However, you will change the data field to be a static array.

For example, if your images are monochrome with a resolution of 320 x 240

uint8[76800] data


Where 76800 is the size of your array (320 x 240 = 76800)

Yes it's possible.

Have a look at the ROS2 field types https://index.ros.org/doc/ros2/Concepts/About-ROS-Interfaces/#field-typeshttps://index.ros.org/doc/ros2/Concepts/About-ROS-Interfaces/#field-types As you can see, ROS2 provides a static array datatype that converts to std::array<T,N> in C++.

What you need to do is to define a custom message, such as a ImageStatic.msg

The fields of this message can be the same of the standard Image.msg However, you will change the data field to be a static array.

For example, if your images are monochrome with a resolution of 320 x 240

uint8[76800] data


Where 76800 is the size of your array (320 x 240 = 76800)

Yes it's possible.

Have a look at the ROS2 field types https://index.ros.org/doc/ros2/Concepts/About-ROS-Interfaces/#field-types As you can see, ROS2 provides a static array datatype that converts to std::array<T,N> in C++.

What you need to do is to define a custom message, such as a ImageStatic.msg

The fields of this message can be the same of the standard Image.msg However, you will change the data field to be a static array.

For example, if your images are monochrome with a resolution of 320 x 240

uint8[76800] data


Where 76800 is the size of your array (320 x 240 = 76800)

Here you find a tutorial about creating custom interfaces https://index.ros.org/doc/ros2/Tutorials/Defining-custom-interfaces-(msg-srv)/