Questions about Blank messages of ROS2 Toolbox

4 ビュー (過去 30 日間)
Xiaochen Gao
Xiaochen Gao 2022 年 2 月 19 日
回答済み: Abhijeet Gadkari 2022 年 2 月 22 日
Hello!
I have a problem with the ROS2 Toolbox.
I want to change the blocks from ROS1 to ROS2, but when I try to set the message type to geometry_msgs/poseArray, it will automatically change to another types, which means I can't select this type of message.
Do you know why and how can I solve it?
Thanks!

採用された回答

Abhijeet Gadkari
Abhijeet Gadkari 2022 年 2 月 22 日
Hello Xiaochen,
Information about variable sizes of a ROS message is stored in the model workspace, when you save a Simulink model with a ROS block that has a message type that has fields with variable sizes. You can change the maximum length of variable-size messages using the VariableSize Messages app in SIMULATION > PREPARE tab under ROS TOOLBOX section.
Adding a ROS 2 block to a Simulink model previously saved with ROS blocks, corrupts this information and causes problems when selecting ROS 2 block message type parameter.
Possible solutions are as follows:
  1. Create a new model by copying non-ROS blocks and add the ROS 2 blocks
  2. To avoid creating a new model, delete the ROS variable size data from the model and save the model. Use the following MATLAB commands and save the model:
modelWs = get_param(<modelName>, 'ModelWorkspace');
evalin(modelWs, 'clear SL_ROS_VariableLengthArrays_MaxSizes');
save_system(<modelName>);
- Abhijeet

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by