开发者

android: api to external usb devices for robotic applications

Android devices become incredible cheap (especially those with android v1.6). I'm considering to use one as a 开发者_运维百科brain of autonomous robot. Unfortunately I didn't find any info on that.

I would like to connect two external USB-webcams and some DIY-selfmade USB ADC & output-ports converter to steer the wheels and read analog distance sensors. If I choose some cheap netbook than they usually already have 3 usb ports. But if I will be forced to use a tablet, then it requires also an usb hub.

  1. Do android devices support usb-hubs?
  2. Is there any API to grab still frames from external usb webcams (e.g. "vfa://0" & "vfa://1")
  3. Is there any API to read from USB custom device? Let assume that it will simulate serial port for simplicity.
  4. Do I get all of this in android 1.6 or any newer version?

As an update for your information: Based on answers I assume that android device will be too expensive in comparison to effort. I will go for cheap atom netbook with standard linux & arduinio USB device for controls & sensors. At cost of half kg (one pound) heavier device I will save months on learning & development.


You need an android device that either supports usb host mode out of the box (a few of the cheap tablets apparently do) or a phone that can do so with custom usb power wiring and perhaps a new kernel driver (as many phones can).

You will likely need root.

The api would be the normal linux USB stack, including just about any C-coded source-available device driver available for a desktop linux (excepting those that use bits of x86 binary windows drivers run in a compatibility wrapper).

You could interact with that either from the ndk using normal methods (device files, read/write/ioctl) or with careful driver design so things really look like files you can probably get at some of it from java or at the very least java with some thin ndk wrappers around device file operations.

Essentially, this isn't an "android" question, it's a question about the capabilities of a particular android device's hardware, how to get root on that device, and then it becomes a standard embedded linux question.


As far as I know you won't get any of this with the default Java API. Lots of this stuff can however be achieved if you build a custom kernel and add needed modules to it. Basically it all comes down to kernel hacking and won't be really Android related.

I'm very interested in stuff like that myself so keep me updated please.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜