How to load rigidbodyTree from Workspace into Simulink

8 ビュー (過去 30 日間)
Aastav Sen
Aastav Sen 2020 年 5 月 26 日
コメント済み: Rachid Ramadan 2020 年 10 月 30 日
I wish to import a rigidbodyTree model into Simulink as this is a required parameter for the 'externalForce' function (I could not find a Simulink block that did the same thing). So I chose to do this in a MATLAB Function block instead.
After saving the rigidbodyTree to a .mat file, I am unable to load it. This results in the following error:
"Simulink does not support loading the input data in the variable 'myrobot' in file 'myrobot_saved.mat'. The From File block can only load MATLAB timeseries objects, structures of MATLAB timeseries objects, or two-dimensional arrays consisting of one-dimensional, double, non-complex samples. "
NOTE: I save it by going to the 'Model Explorer' (from Simulink), going to 'Base Workspace', right clicking on my rigidbodyTree and clicking 'export'.
It appears as if I am unable to obtain a type rigidbodyTree from my Workspace into my Simulink model. However, I know it must be possible as this is what blocks such as 'Velocity Product Torque' and 'Gravity Torque' do (as well as some other blocks in the Robotics Systems Toolbox).
TLDR: How do I load a rigidbodyTree object from the Base Workspace into my Simulink model for use in a MATLAB Function block?
Any help would be much appreciated.

採用された回答

Nishant Gupta
Nishant Gupta 2020 年 5 月 29 日
You can use 'MATLAB System' block to implement rigidBodyTree object in your simulink model. Blocks like 'Velocity Product Torque' and 'Gravity Torque' as you mentioned are also created using 'MATLAB System' block only.
Refer to the following links, it might help you:
  2 件のコメント
Aastav Sen
Aastav Sen 2020 年 5 月 31 日
Thank you for opening some doors! I am curently working on this approach and will get back to this thread
Rachid Ramadan
Rachid Ramadan 2020 年 10 月 30 日
I want to implement a matlab system for the externalForce function. Could you share your results?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeManipulator Modeling についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by