How to create a Android App in Simulink for Subscribe/Publish ROS Messages "Failed to generate all binary outputs"

6 views (last 30 days)
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.

Accepted Answer

Cam Salzberger
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
Niko H
Niko H on 26 Oct 2017
Ok, thank you for your help. The way with the translator node seems interesting.
Do you have any suggestions how to create such a standalone ROS node.
So far i tried this way generate a ROS node but had no success to get it on.
I get these diagnostic
Cam Salzberger
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.

Sign in to comment.

More Answers (1)

Niko H
Niko H on 27 Oct 2017
Ok, this error was simple to get away with.
Little overview: Android App is working, TCP/IP is working (If i run the model in the simulation i am able to control the robot with the app), Roboter is working and ROS Publish/Subcribe is working.
Only the last step with the standalone node isn't done that easily.
The TCP/IP Master is running on the Smartphone, but it seems the ROS Node has problem with the TCP/IP receive..
  1 Comment
Cam Salzberger
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.

Sign in to comment.

Communities

More Answers in the  ThingSpeak Community

Community Treasure Hunt

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

Start Hunting!