Borrar filtros
Borrar filtros

Index exceeds array dimensions in Write Point Cloud block ROS2

1 visualización (últimos 30 días)
I'm looking to generate a point cloud message from a UAV scenario LiDAR and send it to ROS2, but I keep encountering this persistent error.
Index exceeds array dimensions. Index value 133 exceeds valid range [1-128]. Code generation does not support growing arrays via indexing except by using end+1.
Error in WritePointCloudFcnBlock.m (line 100)
Data(Inds(1 : NumBytesArray(idx), :) + byteOffset) = typecast(XYZunordered(:, 1), 'uint8');
This is my model. My point cloud is unorganized and has dimensions of (18,000, 3).
Interestingly, when I utilize a constant block and provide it with data like [[0, 0, 0]; [1, 1, 1]], it functions without any issues. Could you guide me how to fix this.

Respuesta aceptada

Jarunyawat Buasri
Jarunyawat Buasri el 12 de Ag. de 2023
So, I gave it a shot – trying to read a point cloud from Gazebo. That's when I stumbled upon something interesting in the ROS toolbox: the Variable Size Message. By tweaking the maximum length to over 128, I managed to get it working like a charm.

Más respuestas (0)

Categorías

Más información sobre Specialized Messages en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by