Communicate using ROS between 2 different MATLAB versions

2 ビュー (過去 30 日間)
Mohammed Mohiuddin
Mohammed Mohiuddin 2022 年 5 月 31 日
移動済み: Remo Pillat 2023 年 5 月 1 日
Hello,
I have been trying to use ROS publish and subscribe blocks for communicating between 2 different versions of MATLAB (R2018a and R2022a) on the same computer (same machine). The thing is, I am trying to run experiments on a hardware system that is compatible with R2018a or lower. However, I want to implement Reinforcement learning on the system. RL toolbox is available from R2019a onwards. Hence, I trained my RL agent using R2022a, and now want to deploy the trained agent on the hardware (which interfaces only through R2018a).
The system models, for the hardware interface and the RL agent are in Simulink. So the below description is for Simulink models in the respective MATLAB versions.
I was planning on using ROS publish blocks in R2018a (hardware compatible version) and corresponding subscribe blocks in R2022a (RL agent trained version), both versions on the same computer (my laptop). I thought this way, I will be able to communicate with the hardware using R2018a and recieve the states from the hardware system, which I can publish on a ROS topic. After this, I wanted the subscribe block in R2022a, to subscribe to that ROS topic and recieve the system states which can then be fed to the RL agent. This RL agent can then give out actions, which I planned to communicate the same way (in reverse manner) to the hardware. However, after a lot of tries and going through multiple solutions, I have not been able to figure this out. Any suggestions or ideas are welcome.
  6 件のコメント
Jagadeesh Konakalla
Jagadeesh Konakalla 2022 年 6 月 7 日
Hi Mohammed,
I have tried on my end and i do not see any issue with communication. Here is what i followed.
  1. I launched the rosinit from 22a release MATLAB.
  2. Then i ran the rosinit on 18a MATLAB.
  3. Simulated the publisher model in 22a release with inf time as Stop time
  4. Simulated the subscriber model in 18b release with inf time as Stop time.
  5. I can see that subscriber gets the data published from 22a release MATLAB.
Thanks,
Jagadeesh K
Mohammed Mohiuddin
Mohammed Mohiuddin 2022 年 6 月 8 日
If you don't mind can you please share the models with me, and also let me know of any parameters or settings I need to keep in mind.

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

回答 (1 件)

Jagadeesh Konakalla
Jagadeesh Konakalla 2022 年 6 月 21 日
移動済み: Remo Pillat 2023 年 5 月 1 日
Hi Mohammed,
Is the issue resolved on your end ?
In case if the issue is not resolved, Please contact us through the MathWorks Technical Support team for further assitance.
Thanks,
Jagadeesh K.

カテゴリ

Help Center および File ExchangeROS 2 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