Android/IOIO driven car controlled over WiFi with video feedback

3893 views
Skip to first unread message

Ytai Ben-Tsvi

unread,
Oct 2, 2011, 9:16:34 PM10/2/11
to ioio-...@googlegroups.com
Check out this really cool project, which has been shared with me by [noros] on my blog:
And I'll take this opportunity to invite everyone to publish their projects on this list!

Ytai

Krishna

unread,
Oct 3, 2011, 3:00:36 AM10/3/11
to ioio-...@googlegroups.com

Boris Horn

unread,
Oct 3, 2011, 3:33:45 AM10/3/11
to ioio-users
wow - very cool!!!

I'm looking forward to the code

olli pyynönen

unread,
Oct 3, 2011, 4:09:58 AM10/3/11
to ioio-...@googlegroups.com
"Presentation is the fundament of impression", yes, absolutely, impressive!

2011/10/3 Boris Horn <horn....@googlemail.com>
--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To post to this group, send email to ioio-...@googlegroups.com.
To unsubscribe from this group, send email to ioio-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ioio-users?hl=en.




--
Olli Pyynönen
olli.p...@gmail.com

Joseph Swanson

unread,
Oct 6, 2011, 7:26:16 PM10/6/11
to ioio-users
Not as cool as those ones ^

http://swantron.com/android-ioio-project-ioioseek/

There is an embedded video in the above link. Getting closer to the
real project, but posted a little stand-alone write-up.

Cheers

Stanley Wu

unread,
Oct 7, 2011, 9:20:11 AM10/7/11
to ioio-...@googlegroups.com
We did a project like this before with a boarduino.
looks like the days of microcontrollers are over

evillanueva

unread,
Oct 8, 2011, 1:53:31 PM10/8/11
to ioio-users
Inspired by the 2 videos above, i tried this:
http://www.youtube.com/watch?v=Pjq3yFQHIbM
an Android IP Cam with pan control. controlled by another android
phone.

How it works.
HTC is installed with IP Webcam app that runs on background.
Network app (UDP) running also in HTC. same app is controlling IOIO,
driving the servo carrying HTC.

Web browser app running on LG Optimus. it opens the video stream from
HTC via IP Webcam
Two buttons on web app. pressing these buttons send command to HTC
(over UDP), pass it to IOIO, and drive the servo for pan control.

here are some photos of the set up:
http://i54.tinypic.com/34exq3s.jpg
http://i52.tinypic.com/15xu3xz.jpg
http://i53.tinypic.com/m9rl0i.jpg

photo of pc connection test:
http://i56.tinypic.com/97tjjn.jpg
small window on pc is a web browser + udp program that sends command
to IOIO.
big image on pc is from my firefox browser set to fullscreen.
connection is over the internet. 'seems it is easier to implement
internet connection (UDP) on android than on pc.:-)

next plan is to put the htc on my lego buggy. and control it over wifi
(internet) using another android phone


having this test, i'm thinking of a telemetry device which is an
android device with IOIO in a remote area. and a UDP app that
broadcasts signals from IOIO (analog/digital) over the internet.
it can also be done with bluetooth module + android + UDP app. but i
will prefer doing it with IOIO. :-)

THANKS YTAI

Ytai Ben-Tsvi

unread,
Oct 8, 2011, 5:42:23 PM10/8/11
to ioio-...@googlegroups.com

Wonderful projects!

robotsa99

unread,
Oct 9, 2011, 11:23:21 AM10/9/11
to ioio-...@googlegroups.com
Oh"" this is nice project.
Can you share you code. Thank you.

2011/10/9 Ytai Ben-Tsvi <yta...@gmail.com>

Wonderful projects!

norosUCI

unread,
Nov 29, 2011, 4:28:19 PM11/29/11
to ioio-...@googlegroups.com
Hi guys,

thanks Ytai for sharing the link.

The source code of the Android Car is finally available here:

http://www.cogsci.uci.edu/~noros/android_car.html

I don't have the time to comment the code right now... maybe during Christmas.

Anyway, the code is not perfect but people trying to do similar projects should find it useful.


robotsa99

unread,
Nov 29, 2011, 10:20:53 PM11/29/11
to ioio-...@googlegroups.com
Hi,
Thank you very much for your sharing the source code.
 
 
2011/11/30 norosUCI <oros.l...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ioio-users/-/OZ7K3pZJNYoJ.

Nav

unread,
Nov 30, 2011, 10:30:55 AM11/30/11
to ioio-...@googlegroups.com
Hi everyone,

I was able to compile and run the code and it works great over a WIFI connection. I was just wondering how I can get this to work if my laptop is connected to a WIFI hotspot and my phone is connected to a 3G network?

The code returns a local IP address which can't be accessed outside of my network. Is it possible to connect via the global (public) IP address?

Any help will be greatly appreciated.

Thanks.

norosUCI

unread,
Dec 1, 2011, 11:41:11 AM12/1/11
to ioio-...@googlegroups.com
Hi Nav,

I'm glad to hear that the code works for you. Can you tell me what phone and Android version you're using please? ...just for info...

Concerning 3G, I was initially working on this project with my phone connected to 3G and my laptop connected directly to a modem and it worked, however I was experiencing annoying video lags (1-2s). So I decided to work only using a private Wi-Fi network.
It would be nice if someone with experience in video streaming could reduce this video lag over 3G...

Anyway, I haven't tried with my laptop connected to a public Wi-Fi hotspot so I don't know if it will work...certain ports might be blocked...dunno.
When you say: "The code returns a local IP address which can't be accessed outside of my network" I guess you're talking about the PC client.
and, when you talk about wi-fi hotspot, do you mean your own wireless router? If that's the case, you might have to configure your router to do IP/port forwarding.

If you meant a public wi-fi hotspot, you can try this:
in the PC_UDP_Client project, in the three files cam, ioio and sensors thread UDP, replace

InetAddress serverAddr = InetAddress.getLocalHost();
 by
InetAddress serverAddr = InetAddress.getByName("your gobal IP address");

And on the Android, just type in your global IP address in the app.
I don't remember much about computer networks so I'm not sure if it will work but you can always try...

Anyway, I hope this helps...
Nick

robotsa99

unread,
Dec 4, 2011, 4:53:38 AM12/4/11
to ioio-...@googlegroups.com
Hi.Nav
 and every body .
How to run  PC_UDP_client on computer when i import into eclipse. please help. i m a new user.

thank you.



2011/12/1 norosUCI <oros.l...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ioio-users/-/EXd3ews4CiQJ.

norosUCI

unread,
Dec 4, 2011, 11:59:42 AM12/4/11
to ioio-...@googlegroups.com
well... normally you just need to open Main_GUI.java and run it as a Java application.

robotsa99

unread,
Dec 5, 2011, 2:15:11 AM12/5/11
to ioio-...@googlegroups.com
Thank you very mouch.  I can get it now.. 

2011/12/4 norosUCI <oros.l...@gmail.com>
well... normally you just need to open Main_GUI.java and run it as a Java application.

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ioio-users/-/btY4L9qicyQJ.
360.gif

John Hewitt

unread,
Feb 5, 2012, 5:51:53 PM2/5/12
to ioio-...@googlegroups.com
     The android car code worked great when I gave it a try. Under my eclipse environment I had no trouble running the UDPClient although under my windows eclipse enviroment I could not. I did install the slick libraries but still got errors and could not run. For my particular RC car I needed to give a little broader range on the PWM signals to get the motor to spin but after that it work flawlessly. I would like to run this with bluetooth although need to learn how to make the proper modifications and use IOIOabstractactivity it seems.

Thanks for making this code available.

John

norosUCI

unread,
Feb 7, 2012, 11:51:30 PM2/7/12
to ioio-...@googlegroups.com
I'm glad it works for you too.
I'm not sure what the problem is when using Eclipse under Windows...that's what I used to program it.
You can always post what errors you're getting and I can have a look.
And maybe someone else had the same problem and might be able to help.

I do not know how to use Bluetooth with the IOIO...I have the first version of the IOIO that doesn't support Bluetooth I think...but I haven't tried to be honest.

take care,
Nicolas

John Hewitt

unread,
Feb 14, 2012, 3:39:47 PM2/14/12
to ioio-...@googlegroups.com, no...@uci.edu
Nicolas,   I was able to to run the car even after I turned off wifi on my phone so I am assuming that it is working fine  under 3g. The video still seemed to update reasonably. I will try to make a video when I get more advanced with something worth showing.  Ytai is giving some guidance I think on talking to the sensors while using ioioabstractactivity but I am still struggling with this. I saw the video from a fellow named Ricky who is working on getting his wifi car to navigate to a GPS coordinate. My robot is large enough to hold a person or large beer cooler and it would most pleasing to have the guests at my next outdoor party load an app which allows them to bring the beer cooler out to the horseshoe pit.


Also, Thanks for the tip to look at the classpath. Somehow though I still get some errors that I am looking into, perhaps the slick libraries are having trouble  with my windows 7 64 bit machine? :

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Ownber\Downloads\slick\lwjgl.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)


norosUCI

unread,
Feb 14, 2012, 4:52:35 PM2/14/12
to ioio-...@googlegroups.com

Concerning Bluetooth, I'll soon have a new IOIO with the firmware that supports bluetooth (I'll also be able to update my old one). Then, I will be able to try to use bluetooth using the new libraries with the new abstractioioactivity.
If it works, I'll update the new (bluetooth) version of my project on my website.

I like the idea of a robot carrying a large beer cooler ;-)

I've been playing around with path planning using GPS location as well but keep in mind that it only works outside and the resolution is usually not great...it might be fine though if you have a big garden.
I'm actually working on path planning using wi-fi access points right now. It might be in the next release of my project.

For your error, see:
http://stefanhendriks.wordpress.com/2011/03/26/slick-java-library-and-64-bit/

It is surprising though, since I also run Windows7 64 bits and it works on mine, and all the libraries should be included with the project...

Alex Flynn

unread,
Mar 9, 2012, 9:17:40 PM3/9/12
to ioio-...@googlegroups.com
Ive had a play with your code and its pretty nice, I am planning something similar and had no idea where to start, so this was brilliant.
I think ive managed to improve camera FPS. For one, on my i9000 the main culprit was the decode method. If you used traceview you could see it taking masses of time and making the GC go crazy. I've done some work with OpenCV in the past, so I included that to convert the YUV image to a bitmap, and seems to have made it much faster for me. Also, I have added a Deflator and Inflator, to compress the byte[] produced by the camera sent in send_data_udp. This reduces the amount of packets for one frame at 640x480,  50% compression by around two. Not a huge amount but... every little helps. 

But its still not as smooth as what you get in the video. My next guess is my wifi network is not as fast as yours. Pinging my Android is on average ~70ms, which is around twice as long as it takes to ping Google. I'm going to test it on my University network soon.

If youre interested in the code, let me know and i'll mail you. Again, thanks for providing a great starting point :)

norosUCI

unread,
Mar 12, 2012, 7:49:49 PM3/12/12
to ioio-...@googlegroups.com
Hi Alex,

that's sounds awesome. Please, do send me the source code.
I don't know much about video/image compression so I was hoping someone would find a better way to do it.
I should also start profiling my app more often to optimize the code.

thanks,
Nicolas
Message has been deleted

artem

unread,
Apr 6, 2012, 1:29:44 PM4/6/12
to ioio-...@googlegroups.com
hey Nicolas (pardon, in the previous post i used your last name didn't figure out it was your nick) , i have an RC plane which i control with a regular radio, after seeing your project i got a crazy idea of doing the same thing but with a plane!  there are 2 main points which i am not sure of: 
1. did u use a separate server with a static ip as a median for communication between your android app and your windows app? 
2. did you create your own protocol for sending live video to the control point or did you use an existing application running in the background on the andoird device? 


norosUCI

unread,
Apr 8, 2012, 1:38:02 PM4/8/12
to ioio-...@googlegroups.com
Hi,
no problemo.
It would be great to see an RC plane doing that.

1. I didn't use a separate server. I just had and Android phone and a laptop. On the youtube video, there were both on the same Wi-Fi network but it also works using 3G.
2. I'm using UDP protocol to stream the video frames. I add/create my own header for each packet though. In the end, it might be similar to RTP protocol but I'm no expert on this.

best,
Nicolas

Belal Salama

unread,
Apr 19, 2012, 6:05:27 PM4/19/12
to ioio-...@googlegroups.com
hey Nicolas, 
this is impressive work, really. 

I'm working on a similar project controlling RC plane. The connection works fine (although I'm having a little trouble when connecting over 3G .. It's an IP thing .. I'm working on it) ... 

However, I have a problem with the 'hardware' ... could you give me some information about the servos you used and the batteries you used to power up the ioio and the servos .. and the connection between them? 

Thanks in advance.

xelhion

unread,
Jul 24, 2013, 9:22:27 AM7/24/13
to ioio-...@googlegroups.com
Sir Nicholas, I am an engineering student and i would like to know if it's okay with you that i would like to replicate your work :)
Thanks sir :)
Reply all
Reply to author
Forward
0 new messages