PDA

View Full Version : Android and bluetooth control questions/ideas



K1LD4R
06-02-2013, 04:34 PM
Hello all! New builder here, and I've got some ideas I'd like to flesh out. Has anyone tried to control their robot with an Android tablet/phone or iPad? I've searched the forums and the only mentions I can find are in passing and at least a year old. One of them mentioned a bluetooth module that fits the Xbee socket.

It would be extremely convenient to have a control solution in one very portable package. I understand bluetooth doesn't have enough speed for a decent video connection, especially on top of the command signals. But perhaps a start would be to use the Android device for control and separate the video to an independent 5.8 FPV setup. I'm currently experimenting with this concept using an Arduino and a hacked HexBug Spider. Eventually I want to evolve the project into a competition robot.

I realize this may deviate from the convention rather significantly, but then again I'm not too clear on some of the details of the convention. How do you interface the Xbee signal to your control device? I see lots of people using laptops and joysticks, but I don't see an Xbee module plugged into a USB port or anything. Perhaps I'm just not looking close enough. I've been really focused on Bluetooth so far.

Thanks for your time and any advice!
-Brian

jwatte
06-02-2013, 06:20 PM
Any way of getting signals from A to B will work. I'm using a Windows 8 tablet for some things, although I hook in a keyboard which makes it a laptop :-)
If you're using WiFi, then the browser on that Android could view the video stream from a webcam.
You could build a robot control UI using JavaScript and HTML, and run a webbrowser to receive it on the bot, if you used something bigger than an Arduino -- say, a Raspberry Pi, or BeagleBone Black, or a Zbox -- on the bot.

darkback2
06-02-2013, 11:30 PM
Hey K1LD4R,

A few years back I controlled squidward and Charlie using an ipad...Both of them had onboard PCs and were running a program called MAX/MSP. The app I used was called touch OSC. I have done something similar with HIkari using her onboard FITpc. TouchOSC sends osc messages over wifi. MAX uses UDP receive taking in the osc messages and converting them to serial commands sent out to her arbotix. Really it is a sort of clunky solution because it requires a wifi router, or an adhoc network which sucks big time, especially in a noisy environment with other robots. At home it works fine, but there is a long boot up time.

As for writing a custom app, I would think that would be fairly difficult with the ipad because well...apple.

A couple of things before I continue. I don't know anything about you, and you migh tbe the most capable person on the planet when it comes to all of this, but you said you were knew to robotics, so forgive me if I sound like I am talking down to you.

The arbotix is arduino based and has a xbee input. Most people write a program in arduino (Something like C) that takes commands via serial either from the arbotix commander, another arduino based board, or from a computer. Either way, the remote sends messages via serial port over xbee which are then used by the robot's controller board to tell it what to do.

There is some basic keyboard code as well as basic commander code that is free for the using on the arbotix wiki page.

Currently I have all of my robots running the arbotix and using dynamixel servos. I think a number of people on this forum are doing something similar. Gdubb uses bluetooth but he is a bit of an outliyer and it is hard for him to accept change.
:p

http://code.google.com/p/arbotix/wiki/CodeBook#Other_Code_Examples

Now one option you mentioned was to use a tablet. If the tablet is running windows or really any os that can send data out a serial port then you could plug a xbee into it and create a program or app that would convert touches and screen buttons into messages that the robot can understand....

Lastly if you are relatively experienced you could use a bluetooth adaptor on the robot end and send messages using android. I figure you would have to write an app, you might be able to intercept blue tooth messages from an existing app and then write your robot's code based on that, but that seams a bit difficult. I could do it in MAX, probably in labview if I really wanted too. Other people could do it in python...Since you have your hex bug getting commands from an arduino you could probably use a bluetooth or xbee shield to send it messages...

I know this post wasn't especially helpful...Sorry.

Best of luck.

DB

K1LD4R
06-03-2013, 04:03 PM
Thanks for the input! Different perspectives are always good.

darkback2, I have some beginner experience with programming in C, the Arduino IDE and Processing. I'm currently enrolled at ITT Tech for Electrical Engineering and hope to specialize in robotics. I graduate with my Associates Degree this winter. No apologies necessary, I am still very inexperienced with a lot of this. Thanks for the example links, those will be quite educational.

I was planning on using the Arbotix/Dynamixel combination for a 3 DOF quadruped platform. What i have in mind for the vehicle itself seems to be fairly typical for Mech Warfare bots. It's primarily the control method that I think will be a bit different.

I read up a bit on Xbee, and found the starter kit with the Explorer USB board. Had a "duh" moment.:rolleyes:

I have an Asus TF700T tablet that I intend to use for control and possibly video feed. I have the keyboard dock which has a USB port on it, so I could theoretically plug the Explorer into it. Also, Asus has a USB adapter available for the 30 pin proprietary plug on the tab itself, so in the future I could do away with the keyboard.

I want to use Processing to create the Android control app. I've been fiddling with this to control the HexBug Spider, and I've got a simple little PC app that controls it pretty nicely. Porting it to Android is proving to be a challenge though. Apparently, serial communications are one of Android's biggest weaknesses. Go figure. :confused:

The next challenge, especially if I go with Xbee over Bluetooth (which everyone seems to recommend) is how to get a video feed to the Android tablet. Ideally I want to create an app that super-imposes the control buttons and HUD translucently over a full screen live video feed (akin to how some games like Minecraft Pocket Edition look). But I think I should probably tackle that one after I've figured out wireless communication.

Lupulus
06-03-2013, 04:18 PM
Edit: Didn't see your recent post until after I submitted! Sounds like you are getting some answers.

Hi KLDR, welcome! I'll try to answer a few questions (sorry if I repeat things you already know!)


Has anyone tried to control their robot with an Android tablet/phone or iPad? I've searched the forums and the only mentions I can find are in passing and at least a year old. One of them mentioned a bluetooth module that fits the Xbee socket.

Do you want to use the Android/iPad for the controller actually riding in the robot, or the user controller sending commands? Either way, I'm not aware of any mech warfare competitors doing this, but it should be possible. There's definitely examples of other robot projects using android for "brain", commands, or both. Several companies make Bluetooth modules for the Xbee socket, usually called a Bluetooth-Bee. That would be the way to go if you're using Arbotix, but there's lots of other bluetooth modems to fit other arduino derivatives.


I understand bluetooth doesn't have enough speed for a decent video connection, especially on top of the command signals. But perhaps a start would be to use the Android device for control and separate the video to an independent 5.8 FPV setup.

Yep, XBEE doesn't provide enough bandwith for video either. Most competitors are using a "WiFi camera" which has a self-contained WiFI connection, and functions independently of the robot's microcontroller. Probably the easiest way to go.


How do you interface the Xbee signal to your control device? I see lots of people using laptops and joysticks, but I don't see an Xbee module plugged into a USB port or anything. Perhaps I'm just not looking close enough. I've been really focused on Bluetooth so far.

XBEE hanging off my USB port is exactly what I'm using to control my mech-in-progress. It works, though an enclosure might be nice :happy:. Another option with XBEE is to use a self-contained hand-held controller, such as the Arbotix Commander sold by Trossen. The Commander has an arbotix inside it running your command program. The laptop or tablet or whatever is then just used to view your video feed.

ArduTank
06-05-2013, 03:10 PM
BlueTooth will work, try to get a bluetooth serial module. If you use the Arbotix, though, it is preferable to use Xbees, due to the fact that they are more stable, and provide an out of the box wireless serial link.

K1LD4R
06-10-2013, 05:44 PM
I got the Xbee starter kit and a shield for my little prototype Spider. I was impressed at how easy it was to get working. It's basically plug and play. I was also surprised by how much juice it seems to slurp. With three 9v batteries rigged in parallel, the Spider will only run properly for a minute and a half. Once the current drops too low it won't walk. I can still turn the turret, but no forward or reverse.

The issue is if I can get Xbee talking to an Android device. I haven't looked yet, I'm not quite that far along, but I don't know if Android drivers are available.

jwatte
06-10-2013, 08:36 PM
The Xbee Pro will draw 60-80 mA. The motors in the servos will probably draw a lot more :-)
But yes, this is why we all load up on big, heavy, LiPo batteries, and then worry about the payload weight...

ArduTank
06-11-2013, 09:36 AM
Depends on the android device. Does it have a usb port? If so, you might be able to find a serial interface, because Android is based on the Linux kernel, and the Linux kernel it uses has the same generic drivers that a Linux computer would have, including one that would work for a usb serial port (Xbee Explorer's FTDI chip).

K1LD4R
06-11-2013, 05:08 PM
Yes, the Asus TF700T I will be using has a USB 2.0 port and Host Controller drivers. I've found a handful of apps that are supposed to use FTDI to communicate with serial devices, but so far none of these have worked. I'm using the Explorer USB board that comes with Trossen's Xbee starter kit. I don't know if I'm just doing something wrong, or if I will need to go all the way and root my tablet to install the VSP drivers on the kernel. Fortunately, FTDI provides a nice guide for that at the bottom of this page: http://www.ftdichip.com/FTDrivers.htm

ArduTank
06-11-2013, 06:28 PM
Rooting it, believe it or not, will benefit you because you can do more in software.

An app using FTDI doesn't necessesarily mean that particular FTDI chip. They each have a different driver. If it's not working, then it's not the right driver/ the person who published the app intended you to root your tablet to use it.