MATLAB: How to create a Android App in Simulink for Subscribe/Publish ROS Messages “Failed to generate all binary outputs”

androidfailed to generate all binary outputsrossimulinkThingSpeak

Hello,
I'm trying to create an android app to subcribe and publish ROS messages. As soon as I insert ROS elements in Simulink model my "Deploy to Hardware" fails. In the diacnostic i get:
Error(s) encountered while building "Test": ### Failed to generate all binary outputs.
This is the Simulinkmodel which I want to deploy to my smartphone.
This is my solver options ( I tried different solvers)
This is my Hardware
This is my Code Generation
And this is my Diacnostic I get
It's like only the ROS elements caused this failure, if I create a android app with a model without ROS elements the deployment works fine.

Best Answer

Hello Niko,
The Simulink Support Package for Android Devices does not support communication over ROS network. Specific communication protocols outside of the app typically require custom blocks for Android, like the UDP Send, BLE Send, ThingSpeak Write, TCP/IP Send, and similar blocks. There currently are no custom Android blocks for publishing or receiving messages from a ROS network.
You could possibly use a FromApp or ToApp block, if you can code the interface outside of MATLAB. You can follow the process to create an Android Studio project, and add your method there. However, the back end required to do communication with a ROS network is probably prohibitively difficult to add to an Android app yourself.
Another alternative would be to transfer messages in another way, one that is supported on Android. You could create a ROS node on one of the other network's systems that would subscribe or publish on the topic of interest, but would be sending or receiving the content to or from the Android device over UDP or TCP/IP.
Technically, ROS uses TCP/IP for its communication, but trying to link into that without the ROS architecture seems far more difficult than simply adding a translator node.
-Cam
Related Question