How to start on boot Simulink model deployed to Raspberry Pi running ROS?

2 vues (au cours des 30 derniers jours)
Sully
Sully le 6 Août 2021
Modifié(e) : Murat Belge le 9 Août 2021
Hey,
Is it possible to start on boot, a simulink model that is to be part of a ROS network, which is deployed to a raspberry pi using the hardware support package for raspberry pi in simulink?
I see that their is an option in the model configuration for Hardware board: Raspberry Pi but not for Raspberry Pi - Robot Operating System as discribed here.
Thank you!

Réponse acceptée

Murat Belge
Murat Belge le 9 Août 2021
Modifié(e) : Murat Belge le 9 Août 2021
Raspberry Pi - Robot Operating System does not have an option in Simulink to automatically start an executable. However, this can easily be implemented manually. Here are the steps:
  1. Build and deploy your Simulink model using Raspberry Pi - Robot Operating System target. This step creates a ROS node under ROS workspace. If the selected workspace name is "~/catkin_ws", the ROS node executable will be located under "~/catkin_ws/devel/lib/<simulink model name>"
  2. Create a bash script to automatically start the ROS node on booth. There are various ways to do this but the recommended approach is to use systemd. Here is a guide. In the script, source the ROS setup script, ~/catkin_ws/setup.bash, start roscore and use rosrun command to launch the executable per usual way.

Plus de réponses (0)

Catégories

En savoir plus sur Raspberry Pi Hardware dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by