ros2 write image cant write a image to ros data
3 次查看(过去 30 天)
显示 更早的评论
when I run it ,it have a error info!
- Index exceeds array dimensions. Index value 129 exceeds valid range [1-128]. Error in WriteImageFncBlock.m (line 25) Data(1:DataLength) = Data1(1:DataLength); 'ros_publish/Write Image/MATLAB Function' (line 30) 中出现错误
0 个评论
采纳的回答
Swaraj
2023-12-26
Hi,
When working with a ROS network, the Simulink model is ultimately converted into C code, which needs all data to be presized and designated. The standard length of the ROS Message is 128. Thus, when sending larger messages, you need to override this and size the message to the size of your data.
This is accomplished by going to the “Simulation” tab in Simulink and clicking on the “Variable Size Messages” table in the top left.
From that menu deselect the “Use default limits for this message type” and then specify the length that works for your data.
Hope it helps!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specialized Messages 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!