Communicate using ROS between 2 different MATLAB versions

1 次查看(过去 30 天)
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
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
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
移动: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 CenterFile Exchange 中查找有关 Communications Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by