Search code examples
androidros

Is there any way to connect my phone camera feed to ROS?


Currently, I have made an android application that allows me to access my video feed. However, I wish to know if there is a way to directly convert my phone camera feed into a ROS topic to which I could subscribe to directly. Any advice would be greatly appreciated.


Solution

  • Which language is your android application in? For mobile devices, the best ros library is probably the roslibjs javascript library. There are demo examples publishing video & imu msgs and demoing basic functionality on how to use it, chiefly in some sort of browser / webapp or js engine. To understand what it's doing, in order to connect to it, reading the core ROS object constructor / initializer shows you which transportOptions it supports, and other initialization features (like options.url for your target url). If you chiefly use another language, or you want to send it over the internet, whether as a local buffer or as a remote buffer, you can use the url to transmit your messages.

    Otherwise, if you can use python or (more strongly encouraged) C++, those are robust. If it's java... there's some vague end of life support for kinetic (click kinetic!), but no guarentees. If you want to or are using ROS2, the official ROS2-java org/repo is the only thing available (for java &/or android). As it's still being developed, ecosystem java/android support is the depth of this project's implementation.