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 CenterFile Exchange에서 ROS 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