How to create a Android App in Simulink for Subscribe/Publish ROS Messages "Failed to generate all binary outputs"
6 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Cam Salzberger
on 25 Oct 2017
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
2 Comments
Cam Salzberger
on 26 Oct 2017
The error indicates that you are not currently connected to a ROS master. Ensure that ROS network is currently running, and that the model connection settings have specified the correct network.
There's a link from the Publish block mask to open the connection settings. See this documentation for more information.
More Answers (1)
Niko H
on 27 Oct 2017
1 Comment
Cam Salzberger
on 27 Oct 2017
This seems to be something of a different issue, so you may be better off asking it as a new question. It isn't my area of expertise either, so I can't offer any advice.
Feel free to contact Technical Support as well, if you can't find any answers on your own or through the community.
Communities
More Answers in the ThingSpeak Community
See Also
Categories
Find more on MATLAB Mobile in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

