Simulink with ROS : For loop for array of sensor_msgs/Image

2 ビュー (過去 30 日間)
Hassan Farag
Hassan Farag 2020 年 5 月 22 日
コメント済み: Hassan Farag 2020 年 5 月 22 日
Input: array of ROS sensor_msgs/Image (sensor_msgs/Image [])
Output: array of arrays/images (Images [])
I am trying to convert sensor_msgs/Image[] to Image array. But I can not use ReadImage block inside For each subsystem loop.

回答 (1 件)

Cam Salzberger
Cam Salzberger 2020 年 5 月 22 日
Hey Hassan,
I'm not sure how to do it inside standard Simulink blocks, but a workaround may be to pass the Image message array (or the message containing that array) into a MATLAB function block, and looping through the Image messages with readImage inside of there. Might be simpler than trying to manipulate the output array in a for loop in Simulink?
-Cam
  1 件のコメント
Hassan Farag
Hassan Farag 2020 年 5 月 22 日
I tried this already but simulink does not run with readImage inside matlab function block which was the source of the problem. As a workaround, I tried to do it in simulink

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeROS Network Access in Simulink についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by