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

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.

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.

Related

Mobile speech recognition in Kazakh

I want to create a little mobile application for android based on speech recognition. Problem is that there is no such API, which have kazakh dictionary (I tried to find). So, I want to use API which can create own dictionary. Is there any API?
I am not familiar with machine learning, but I understand that I have to teach the system.
A speech recognition system requires a little bit more than a dictionary.
Sphinx is an open source system that you may want to take a look into, at least to understand how things work. Pocketsphinx is their version for mobile devices.
From their FAQ:
Q: How to add support for a new language
The process of building a new language model consists of the following steps:
Data collection (you can collect audiobooks with text transcriptoin
from project like librivox, transcribed podcasts, or setup web data
collection. You can also try to contribute to Voxforge. You can start
very quickly with just few hours of transcribed data.
Data cleanup
Model training
Testing
https://cmusphinx.github.io/wiki/faq/#q-how-to-add-support-for-a-new-language
You can download Kazakh model (including Kazakh dictionary) in CMUSphinx downloads

How to create SIP server for my android?

I am developing an Android application, in which I want to make a calls using internet using SIP in android. So I need to maintain my own SIP sever for my app users, how can I create my own SIP server?
I would not advise creating your our sip server as it would take a large number of man years of development and there are a lot of pitfalls.
There are some open source implementations that you could install and setup yourself. Like FreeSwitch or Asterisk. Both are large and complete to setup as there is a lot of domain knowledge required to understand how to set them up correctly.
There are also free server that you could try out as well like Sip2Sip.
Then there is the job of creating a sip client on Android. Again it's not that simple either. I would look at using a open source library here as well, like pjsip. This gives you the advantage of being able to look at examples of full sip clients already developed for Android like csipsimple. pjsip also has the advantage of being cross-platform, so you could reuse it in IOS for example.
Good luck.
The Server
As a communication server, choose for example sip:providerCE v2.6. The easiest way to get started with it is to download the VMware or Virtualbox image and fire it up on a suitable machine. If you get more serious, you want to install the system from scratch on a dedicated server with a public static IP. If you’re new to VoIP and SIP, do NOT try to install it on an Amazon EC2 instance, as they’re using destination NAT, which is a big pain for SIP and needs some experience with the SPCE to tweak it properly for that scenario.
Note that the SPCE is a 64bit system, so in order to run the VM images, you need to turn on 64bit CPU virtualization in your BIOS if VMware or Virtualbox warns you about it.
...There is very good tutorial HERE! on how to set things up.
...Don't forget there is a technical advise concerning SIP check the accepted ANS!
...Least but not last check THIS! VOIP Wiki, It covers everything related to VOIP.
SIP RFC is very easy protocol to implement. Just create a socket listener and implement RFC-3261. Start with with a basic codec GSM, then move up to A-LAW (G.711), as needed.
The tricky parts with SIP are (A) ensuring your call flows are correct (RFC-3665) and (B) media encoding/compresion. Use Asterisk (FreeSwitch) and WireShark to test your call flow. If you need DTMF support you'll need RFC-2833. If you need advanced codecs, consider using open-source library like FFMPEG.
I used uSIPserver on android. It works well and support video call. If you use client app which supports video then you can video call eachother on wifi.
It is so simple to use.
Good luck :-)

Building Peer to Peer photo sharing on Android

I am planning to do a project on Peer to Peer photo sharing on Android. My professor wants me to do that using some language other than Java or C/C++. Is any of Erlang, Haskell, Ocaml,
Scala, Go helpful to build an android app with following functionality?
Ability to design a GUI for android to view the pictures to be shared
Support for socket communications to transfer the pictures?
Since Android relies heavily on Java, Scala would be a good choice here. Scala makes interoperating with Java code easy and runs on the JVM. On top of this, it is a nice functional language with an interesting type system, so it will be a good learning experience. (So will your other languages, but Scala is probably easier to use on Android.)
Check out Scala Programming for Android, which describes how you can make Android applications in Scala.
You can compile and execute Go programs on Android (or ARM in general), but you can't actually use the Android libraries. So, writing services or GUI applications for Android in Go is currently not that easy. I am not sure about the other languages, but I think Erlang, Haskell, Ocaml, etc. have similar problems (if they even provide an ARM compiler).
Therefore it's probably best to focus on a JVM based language. Most of the examples and other applications are written in Java, but Scala is also able to access all those APIs. So, I would either use Java or Scala.
There's also this JVM-based functional, dynamic, lisp-like language Clojure, which some people seem to like a lot. It should be possible to use it to write Android Apps.
Well, in my view, it depends on what you want to really use the language for as regards your project. Photo Sharing: are you planning on using Web based tools for the client, i.e. JavaScript, HTML5, CSS3, JQuery Mobile (http://jquerymobile.com/), sencha Touch (http://www.sencha.com/products/touch), Phone Gap (http://phonegap.com/),Titanium Appcelerator OR you want to use native stuff like Java, J2ME, e.t.c. Then if its web based (which would make things easier in my view), the language you are referring to in this case would be on the Server side. So in my view if you just need the language to web-serve photos and stuff, then it would not matter which one you use: really depends on your liking. I am pretty sure that Erlang, Scala, Java and the others all have capability for developing great web services. However, the conditions you put as below:
1) Ability to design a GUI for android to view the pictures to be shared 2) Support for socket communications to transfer the pictures?
Suggest that you were referring to a Front-End technology to use. You cannot use Erlang to create GUIs on Android, if i am right, you may not also be able to use Haskell and OcamL as well because these technologies cannot run on the device. For GUIs on Android, you can only use Java, OR you can use Widget Technologies like Opera Widgets OR you use Web based stuff like i mentioned above. However, you should know that using JavaScript Libraries, HTML5, CSS3, e.t.c. is the quickest and more manageable way of developing Apps on any Device. I even wonder why you are talking of Socket Communications !! Am i getting you right ? you want to develop a Photo Sharing App which transfers Photos over raw Socket Communications ? Well, i am NOT sure how many apps out there for Android are doing raw Socket stuff, but i am pretty sure that many (http://androidapplications.com/) are using HTTP Protocol, as in Web Services. Consider looking into web services than raw Sockets. I am pretty sure that even apps developed using native Java, uses HTTP (Web Services like SOAP) to communicate with a remote Server, be it weather apps, location-based stuff e.t.c. Otherwise i guess you should concentrate on Java, for now.

Best back end for data intensive Android, iOS app: Drupal or Django or Rails or something else?

We are starting from scratch to develop a couple sophisticated mobile apps. We anticipate supporting iPad, iPhone, Android tablet and Android phones. However, our initial focus will be Android only.
The applications will be used to collect data and send that data to the backend. The whole scope of this project is data collection, data analysis, and data presentation. It's all about data.
What is the right backend technology?
EDIT: Sorry for not providing this info initially. The attraction of Python is the SciPy / NumPy libraries for data presentation and data analysis. I don't think any other platform has libraries that can match these. So Python/Django would seem ideal if there is no problem interfacing with mobile apps...
It will also be nice to use the same technology for the general website and I guess Python/Django is good in that regard too.
I don't see any difference between PHP, Python and Ruby in this case. As I understand, backend is going to be used as a database access layer and for nothing more complex. Am I right? If yes, go with technology you know better.
Why do you want to use Drupal for this task? From my point of view, it is better to use something more oriented on high performance and database interaction. Try Yii, Codeigniter or Fat Free PHP frameworks for example.
Django is a good choise as well because it has wonderful administration interface which is being generated by framework automatically. The only thing you should do is to set up models in your app and enable admin module.
Unfortunatelly, I have no RoR experience so I can say nothing about it except that a lot of people say that it is great.
Python/Django plus SciPy/NumPy proved to be the best option for our project.
The attraction of Python is the SciPy / NumPy libraries for data
presentation and data analysis. I don't think any other platform has
libraries that can match these.
Seriously: Java. You've got ease of use, statefulness and many very very good frameworks. And performance for large datasets is still very very good.
I'd especially recommend the Spring framework and hibernate.

I-Jetty or Jetty

I have a web application to be hosted on android device. I am currently using the emulator available with android sdk. My application will serve both static as well as dynamic data. I am currently using jetty version 6.1.22. I wanted to ask what will be a better option to be used.
1. Jetty webserver with stripped off code.
2. I-Jetty.
My application uses following features-
ResourceHandler to serve static resources.
A Generic servlet to serve synchronous data requests.
An extension to CometServlet to serve asynchronous data requests.
I am looking forward to following criteria for comparison.
Application size. Size of apk which will contain the code.
Memory and CPU usage under a maximum load of 30 requests/sec. These are short bursts which occur very few times in app-life cycle. The average load would be approximately 5 requests/sec.
Ease of maintenance. Including important upgrades of Jetty in application.
Any other side-effects which I probably am missing out at.
I too have been searching for information on embedding the i-Jetty server in an application. Like the original poster, I need to serve both static and dynamic resources. I found the following post to be a helpful start:
http://puregeekjoy.blogspot.com/2011/06/running-embedded-jetty-in-android-app.html
I notice that in searching for answers about embedding a web server in an Android app that many responders, rather than providing a helpful answer, chide the original poster for wanting to do such a thing "in a phone". They then proceed to give all the reasons not to. There are more Android devices out there than just phones. My project involves just such a device. Thanks for all the helpful answers on this and other sites that guided me in my efforts. I hope the link I provided helps other searchers.
There are good reasons for embedding a web server in your app. May not be the best way but you have to do it when Android ties your hands. An example is when you want to decrypt video on the fly at runtime and use the media player to play it. Android media player does not allow me to feed it an in-memory stream as would come from a decryption pipe.
In this case, one solution (help me think of others please!) is to embed a web server that would serve up the stream - because Android does accept a stream from a URL!!
The other solution would be port some native library over and write a JNI interface to it. Too much work and unstable at best.
The point is, there are valid enough reasons out there.
It you need to decrypt video or serve content, you might consider just writing a simple web server yourself that can specifically handle your application's needs without any bloat. Adding an existing web server or web container might be more than you need. It very much depends on your application's needs though.
I have a web application to be hosted
on android device.
Why? It won't be usable, except maybe on a WiFi LAN. It won't be able to run terribly long, because services cannot run forever. Etc.
Whatever technical problem you think you're solving by using a Web server on Android can be better solved by other means.
I wanted to ask what will be a better
option to be used. 1. Jetty webserver
with stripped off code. 2. I-Jetty.
Arguably "neither", not only due to the technical issues, but that Greg Wilkins (creator of Jetty) does not like Android much. Of the two, though, i-jetty is at least regularly tested on Android.
Memory and CPU usage under a maximum
load of 30 requests/sec. These are
short bursts which occur very few
times in app-life cycle. The average
load would be approximately 5
requests/sec.
While running, battery life will suck, because you are going to keep the CPU and WiFi running all of the time to support the Web server, let alone the load.

Categories

Resources