Deploying a ROS node on Raspberry Pi in external mode with Simulink

조회 수: 3 (최근 30일)
Nathaniel Furbeyre
Nathaniel Furbeyre 2019년 4월 26일
댓글: Pedro Fabriz 2021년 8월 28일
Hi all,
I am working on a project that uses ROS and the Robotics Toolbox Package to run Simulink models (with ROS publishers and subscribers) on a Raspberry Pi. The model is generated on my laptop running Linux, and I can currently deploy a "standalone" ROS node to the Pi, where it communicates with other nodes running on that system. In this case all Simulink does is create the model, and send it to the Pi. Simulink doesn't have any capabilities of changing controller values within the model on the Pi, or reading data that is output from the model on the Pi.
What I am trying to do is deploy my Simulink model on the Pi, have it communicate with other ROS nodes that are running on the Pi, and then be able to read data back through Simulink. The last part is what I have yet to acheive, and I am wondering if anyone has some tips.
There are two paths that I can possibly see making this work, with each of them having some parts that I don't understand, which is preventing me from my goal:
  1. Deploy the Simulink model in "external mode" as an executable file. I have seen other projects use this method to communicate data between Simulink (on a PC) and a Raspberry Pi where the model is actually deployed. However, in needing to communicate with other ROS nodes, I am not certain that this deployed model will technically be within the ROS network. It is simply an executable that can be run outside of ROS master's knowledge. Will the model be able to publish and subscribe to ROS topics if it is running as a .elf file?
  2. Deploy the Simulink model as a standalone ROS node. This is currently how I have approached the problem to this point. Unfortunately, the node appears to be isolated from the laptop after it is deployed and cannot send information back to the Simulink program for reading data.
Any help would be very much appreciated!

답변 (2개)

Tohru Kikawada
Tohru Kikawada 2019년 5월 5일
편집: Tohru Kikawada 2019년 5월 5일
I'd recommend you to try the first path. In the external mode, the deployed model can be running as a ROS node simultaneously like below: https://mathworks.com/help/robotics/ug/enable-external-mode-forrobotics-system-toolbox-models.html

Maitreyee Mordekar
Maitreyee Mordekar 2020년 7월 1일
Hello Nathaniel,
You could try to go through the following video. The video explains how you can publish and subscribe between an ROS node in Simulink and a standalone ROS node deployed onto Pi:
I hope this helps!
-Maitreyee
  댓글 수: 1
Pedro Fabriz
Pedro Fabriz 2021년 8월 28일
Hi! Is it possible to create a node in raspberry pi (like this node exists before i connected simulink) and them communicate with this node using simulink?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Network Connection and Exploration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by