Difference in current length and receive length in bus selector block in simulink
조회 수: 2(최근 30일)
hi, im taking image array from ROS node which is of lenght 3072x1 but in simulink im receiving only 128x1 length and not able to retrive rest of the data. please refer below snap -
you can see that recive lenght is 3072 and current length is 128, please help me to solve this problem, im taking rgb image from ROS node and trying to process in matlab, thanks.
Abhijeet Gadkari 2021년 7월 27일
sensor_msgs/Image is a type of ROS message that contains variable sized sub-message fields.
There is a documented example for working with ROS messages of variable sizes from Simulink.
As shown in the Modify maximum Size of Variable-length Array section of that example, you need to set the correct array-size of the "Data" message field for "sensor_msgs/Image".
You can use Read Image block to read the sensor_msgs/Image ROS message and convert it to image.
Following snapshot of the Simulink model shows this setup.
Let us know if this answers your questions.