Simulink Ros, code generation

Hello,
I am trying to generated a c++ class on simulink where i use the Ros block "Current time". I have launch rosinit in matlab and set the hardware board to Ros but when i generate the c++ code some files are missing:
slros_initialize.h and slros_busmsg_conversion.h are generated but they use librairies like slros_generic.h or slros_time.h that are not generated. Where could the problem come from?

4 件のコメント

Josh Chen
Josh Chen 2021 年 6 月 30 日
Hello Nicolas,
Both slros_generic.h and slros_time.h should get generated automatically together with other files, I've attached a screenshot from a quick code generation test. As you can see from the screenshot, they are under the src/ folder.
Which version of MATLAB/Simulink are you using? And could you please share the model so I can take a closer look?
Thanks,
Josh
Nicolas TESTARD
Nicolas TESTARD 2021 年 6 月 30 日
It is a control law. First i generate it into c++ code thereafter it is called in ros as .so librairy. I only want to use the time from ROS simulation in it. When i compile it, all the codes are in the *_ert_rtw folder of the current folder.
Nicolas TESTARD
Nicolas TESTARD 2021 年 6 月 30 日
And i am using matlab R2109a
Josh Chen
Josh Chen 2022 年 1 月 18 日
Hello Nicolas,
Sorry for the late response.
In R2019a, not all codes will be generated into the *_ert_rtw folder. Instead, they were packed in the *.tgz file. If you would like to compile the code manually after generation, please unzip the *.tgz file and you should be able to see all the required files.
You may also refer to this documentation page for more information about manually deploy the generated code.
Thanks,
Josh

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

回答 (1 件)

Josh Chen
Josh Chen 2022 年 1 月 27 日

0 投票

Hello Nicolas,
In R2019a, not all codes will be generated into the *_ert_rtw folder. Instead, they were packed in the *.tgz file. If you would like to compile the code manually after generation, please unzip the *.tgz file and you should be able to see all the required files.
You may also refer to this documentation page for more information about manually deploy the generated code.
Thanks,
Josh

カテゴリ

製品

リリース

R2019a

質問済み:

2021 年 6 月 29 日

回答済み:

2022 年 1 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by