Off Board Processing

53 views
Skip to first unread message

govule

unread,
Dec 12, 2011, 9:18:29 PM12/12/11
to Cellbots
Hi there,

I've a few questions in relation to getting started with a "Cellbot"
project and would be very grateful if someone could help answer them.

Please bear in mind while answering that I have zero experience with
Arduino and pretty limited knowledge of robotics...while at uni I had
a class for a semester using the Handyboard - years ago! Having said
this I am a software engineer and comfortable with most aspects of non-
moving computers. Basically what I am trying to say is please don't
get too heavy on electrical/moving-parts side of things...I know what
servos and the like are but that's about it.

My question are:

1: I'm unclear on whether an Android device can be used as the main
controller of a "Cellbot". In other words, could I write a program
that occupies 5 MB (for want of a number - but far in excess of an
Arduino boards capacity) of memory and have this execute on my phone,
i.e. the phone sends commands directly to the board and receives
feedback.

2: If the answer to the above is "No" then can this be faked? For
instance, would it be possible for the Android device to dynamically
re-program the Arduino board...say the board fires off some sensor
event then the Android device would clear the boards memory and upload
new code for dealing with the event.

3: Assuming positive responses to either of the above questions. Is
all coding done in Java? Is any of the Arduino/C code required?

4: Assuming Java is allowed. Is it possible to mix the Arduino C and
Java, i.e. program the boards controller and the phone and have the
two interoperate?

5: What is you're opinion on the following kit? The project I have in
mind requires a number of sensors and from my uneducated eye this kit
ticks a lot of boxes (and it's in the UK - where I am)...I'm thinking
I'll make my initial frame from Lego:
http://oomlout.co.uk/starter-kit-for-arduino-ardx-p-183.html

The project I have in mind requires only the most basic physics...the
robot just needs to get from A to B (across a flat surface) and it can
be very slow. My main interest is the robot being able to experience
it's surroundings, via sensors, memory and processing.

Thanks


spirit...@gmail.com

unread,
Dec 13, 2011, 4:04:05 AM12/13/11
to cell...@googlegroups.com
1) Not with the existing API.
2) Yes, easily. Did you try the audio serial out app for that? (You'd
be basically writing your own program then though!)
3) You do have to flash the microcontroller with SOMETHING in order to
interpret the phone's commands.
4) It is possible, but in all honesty, that's the hard way to do it.
You are best off using the microcontroller as a servo/motor driver in
that respect.
5) Also look at www.osbots.com please (disclaimer, I sell those).

> --
> You received this message because you are subscribed to the Cellbots.com
> Google
> Group.
> To post to this group, send email to cell...@googlegroups.com
> To unsubscribe from this group, send email to
> cellbots+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/cellbots?hl=en
>

govule

unread,
Dec 13, 2011, 8:40:22 AM12/13/11
to Cellbots
Thanks for the reply :)

1: Cool.
2: I've not tried the serial out app, in fact I've not tried anything
yet. It is good to know that this is possible though and I like a
challenge :) I'll read up on this serial out app. Is it possible for
two-way communication over this though, i.e. can the phone receive
signals from the microcontroller as well as send them down?
3: Cool.
4: Good to know it's possible, as mentioned two-way communication is
very important for me...I want the main program (which I'm hoping will
be on the phone) to be able to have knowledge about the state of the
microcontroller and be able to react to this and then tell the
controller what to do next.
5: Your stuff looks very nice! I think it's overkill for me though
(for the minute at least). At the moment I'm more interested in the
software side of things as opposed to the physical robot. I'll
definitely keep your site in mind though for the future.

The jist of the ultimate project I've been pondering for years (but
till now the cost of the necessary components would have been too
great) is to have a family of small robots that are vaguely
intelligent - maybe a little more intelligent than rats. Basically
these robots would be able to map out their surroundings and then
communicate this to their peers. This is to say that one robot could
be put into one room and it would drive about bumping into things for
a couple of hours but at the same time it's building it's own internal
map of the room. If this robot is then introduced to another it can
transfer it's map so the other robot doesn't have to re-learn the
rooms layout...after this there would be various other objectives,
such as having them seek out food (i.e. a light source) and
communicating the location of this "food" to the other robots in the
group, having them determine the most likely locations of "food" at
certain times of day, etc, etc.

I've no idea if the above sounds crazy or not to you - I'm not
expecting it to be a weekend project :) I'm sure you can see though
that my main requirements are; adequate memory, persistent storage,
continual feedback from the on-board sensors for interpretation by the
main program. No matter how difficult this might be, is it possible
to have a phone and Arduino board communicate to the level I need,
i.e. complete two-way communication?

Thanks again

On Dec 13, 9:04 am, "spiritplum...@gmail.com"


<spiritplum...@gmail.com> wrote:
> 1) Not with the existing API.
> 2) Yes, easily. Did you try the audio serial out app for that? (You'd
> be basically writing your own program then though!)
> 3) You do have to flash the microcontroller with SOMETHING in order to
> interpret the phone's commands.
> 4) It is possible, but in all honesty, that's the hard way to do it.
> You are best off using the microcontroller as a servo/motor driver in
> that respect.

> 5) Also look atwww.osbots.complease (disclaimer, I sell those).

spirit...@gmail.com

unread,
Dec 13, 2011, 8:49:57 AM12/13/11
to cell...@googlegroups.com
It does sound crazy but that's the fun part :) The audio serial out is
on market fro download (just search for audio serial) and the source
is available both as part of cellbots and by itself.

You may also want to look into the IOIO board, Microbridge and
Thalamoid for use as a microcontroller.

govule

unread,
Dec 13, 2011, 9:17:09 AM12/13/11
to Cellbots
The products you mentioned look just like what I'm after, thanks for
your help :)

On Dec 13, 1:49 pm, "spiritplum...@gmail.com"

> >> 5) Also look atwww.osbots.complease(disclaimer, I sell those).

spirit...@gmail.com

unread,
Dec 13, 2011, 9:18:55 AM12/13/11
to cell...@googlegroups.com
I sell the thalamoid, the IOIO board is cheaper and has less
functionality - if you want to do most of your coding on the phone
it's objectively your best bet.

Will Pearson

unread,
Dec 23, 2011, 2:02:32 PM12/23/11
to Cellbots
Another method is a phone with Android version 2.3.4 or greater and an
arduino with USB host (e.g. MegaADK). Then you can use the ADK.

http://developer.android.com/guide/topics/usb/adk.html

I've done 1 way communication (android to arduino) but two way should
be easy. On the java side of things you get input and output streams
to read and write, which talk to the arduino so you can send arbitrary
data.

I'm interested in Mapping as well. My first cellbot style project will
be looking at using video from camera to get a depth map of the
surroundings. It will probably just process the middle line of pixels
for speeds sake, as I just want a 2d map. Eventually I want to make a
simple/cheap robot that uses the android phone for sensors and arduino
for controlling the body.

More stuff about my thoughts for android robots can be found here

http://wiki.london.hackspace.org.uk/view/User:Eb4890

Will

govule

unread,
Dec 23, 2011, 3:54:20 PM12/23/11
to Cellbots
Thanks Will. I'd considered using ADK but decided to go with the IOIO
board. I've bought one but there are still a few things I need to get
in order to build the robot.

Your project sounds very interesting, have you seen any projects that
can successfully determine distance bases on such limited information
coming from an image? Doesn't sound easy at all - I've maybe
understood your plans though? I'm thinking you plan on having an image
and just basing your calculations on the central row of pixels!? I
can't think how this could possibly be done...perhaps if you could
focus on a particular spot on a wall and move towards it, relative to
the camera this spot would be seen to rise and you could maybe
calculate distance based on this?

I think echo location would be easier to achieve...not to mention you
already get cheap sensors for this.

Cheers

Vali Baciu

unread,
Dec 23, 2011, 3:55:52 PM12/23/11
to cell...@googlegroups.com
Hi all

My passion in the last few weeks was to find ways to connect mobile phones with robots and your cellbots initiative inspired me a lot!
Basically what I did is grabbing code from similar examples from all over the internet and adapt them on my robot platform...

I just managed to connect the accelerometer of an HTC Wildfire with the motion action on an Arduino Mega ADK based robot (I use a DFRduino Mega ADK replica that it is cheaper) . The simplest way is to use Amarino toolkit app to grab via serial Bluetooth the accelerometer values and modify an arduino code to controll the motors. The speed acceleration is not coded yet, the 4wheel robot has a constant speed ... http://youtu.be/1uLr0o4bpm4

and here is the voice recognition test, a little bit complicated to make everything work well : http://youtu.be/X0f7gfbzEVI
the code is adapted from this blogpost : http://shazsterblog.blogspot.com/2011/11/arduino-google-voice-activated-servo.html

I grabbed everything I found and documented it in a paperwork that is not so good compared to other articles... but it gathers some information about the history how to connect phones and robots. The article is not high quality, for this it is not published :)
http://robotx.ro/download/Trends_in_Robot_Teleoperation_and_Telepresence_using_Mobile_Phones.pdf

What I also like about this trend is the augmented reality apps. Here is an interesting video about a quad copter controlled with a smartphone and another video about augmented reality app that uses the video from the phone in background. The two ideas combined will give users an incredible experience :)

Here is the latest photo of my robot : http://robotx.ro/download/4W_Evilos_V4.jpg
I am working on including a PIN)) ultrasonic scanner and a servo motor to detect obstacles and send via Bluetooth a vibration feedback on the smartphone.

I am also interested in controlling the robot with ROS... installing rosjava and understand how the communication works.

Another test that I would like to do is connect two mobile phones:
- one smartphone on the USB type A from the Arduino MegaADK
- the other smartphone connected (via bluetooth or... wifi for higher communication speed) for video streaming.

For beginning connecting a phone with arduino...my advice is to try to connect the android phone with arduino via Bluetooth. This connectivity is straight forward, no programming app skills required. I only had to change the baudrate from 9600 - default value of my bluetooth device - to 115200. You can use arduino duemilanueve or MegaADK... The result is a two ways serial communication with a good speed and immediate results :)

I downloaded a lot of android sources over the internet, the google arduino ADK example, cellbots arduino exemple, SL4A and Python for android etc. I managed to remotely connect the android phone, install some of apps directly from Eclipse and perform some led tests... The first test that I managed to make it work was the Seeduino exemple (another replica of Arduino Mega ADK). but I have a lot of errors with Eclipse. I have a lot to learn in Java programming...

Even today I did not yet succeed in exporting an arduino app from cellbots example PerceptionManager... it gives me this error :

[2011-12-23 21:42:18 - PerceptionManager] Conversion to Dalvik format failed with error 1

I goggled over the internet and found some solutions like go to Project/Clean or switch between java compiler versions (1.5 1.6 1.6 android versions...) or make changes to java libraries...non worked. It must be something with the libraryes that I do not understand...

at the end I d like to thank you Cellbots initiative to inspire us all, and thanks to Will for the Android Robotics source codes!

Well I wish you all have a great happy Christmas! :)

Thanks,
Vali




--
You received this message because you are subscribed to the Cellbots.com Google
Group.
To post to this group, send email to cell...@googlegroups.com
To unsubscribe from this group, send email to
cellbots+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/cellbots?hl=en



--
---
Thanks,
Vali
0034.674.238.706

Will Pearson

unread,
Dec 23, 2011, 6:44:08 PM12/23/11
to Cellbots


On Dec 23, 8:55 pm, Vali Baciu <vali...@gmail.com> wrote:
> Hi all
>
> My passion in the last few weeks was to find ways to connect mobile phones
> with robots and your cellbots initiative inspired me a lot!
> Basically what I did is grabbing code from similar examples from all over
> the internet and adapt them on my robot platform...
>
> I just managed to connect the accelerometer of an HTC Wildfire with the
> motion action on an Arduino Mega ADK based robot (I use a DFRduino *Mega
> ADK replica that it is cheaper*) . The simplest way is to use Amarino
> <http://www.amarino-toolkit.net/>toolkit app to grab via serial Bluetooth
> the accelerometer values and modify an arduino
> code<http:///robotx.ro/download/amarino_android_htc.pde>to controll
> the motors. The speed acceleration is not coded yet, the 4wheel
> robot has a constant speed ...http://youtu.be/1uLr0o4bpm4

Very nice :) I'll have to have a dig through your other stuff later.

> I am also interested in controlling the robot with ROS... installing
> rosjava and understand how the communication works.

I'm interested in that as well. Let me know how you get on. It seems
like everything is IP (XMLrpc) based. You can have different forms of
communication. One thing broadcasting and lots of other things
listening, (publish subscribe) or one thing acting as a function that
performs an operation on some data (a service).

As I'd like to work with pure java solutions I'm not sure how much use
to me it would be as Intents fulfill the same kind of communication in
Android. It would help for networked scenarios though.

> I downloaded a lot of android sources over the internet, the google arduino
> ADK example, cellbots arduino exemple, SL4A and Python for android etc. I
> managed to remotely connect the android phone, install some of apps
> directly from Eclipse and perform some led tests... The first test that I
> managed to make it work was the Seeduino
> exemple<http://seeedstudio.com/wiki/Seeeduino_ADK_Main_Board>(another
> replica of Arduino Mega ADK). but I have a lot of errors with
> Eclipse. I have a lot to learn in Java programming...
>
> Even today I did not yet succeed in exporting an arduino app from cellbots
> example PerceptionManager... it gives me this error :
>
> *[2011-12-23 21:42:18 - PerceptionManager] Conversion to Dalvik format
> failed with error 1
> *
> I goggled over the internet and found some solutions like go to
> Project/Clean or switch between java compiler versions (1.5 1.6 1.6 android
> versions...) or make changes to java libraries...non worked. It must be
> something with the libraryes that I do not understand...

Looking at project-properties you need android-9 which is version
2.3.

I just compiled and ran it and this was the rough steps I took.

Add the PerceptionManager and PerceptionTestBed to Eclipse
I changed the API to 14, because that was what I had installed (not
recommended if you don't have ICS yet though)
Build PerceptionManager (not run)
Add PerceptionManger.jar to PerceptionTestBeds build path.
Build/Run PerceptionTestBed.

Let me know if that helps.

> at the end I d like to thank you Cellbots initiative to inspire us all, and
> thanks to Will for the Android
> Robotics<http://wiki.london.hackspace.org.uk/view/User:Eb4890#Android_Robotics>source
> codes!

Happy Christmas. Hopefully I'll have more interesting stuff up there
soon.

Will

Will Pearson

unread,
Dec 23, 2011, 7:22:14 PM12/23/11
to Cellbots


On Dec 23, 8:54 pm, govule <gov...@gmail.com> wrote:
> Thanks Will.  I'd considered using ADK but decided to go with the IOIO
> board.  I've bought one but there are still a few things I need to get
> in order to build the robot.
>
> Your project sounds very interesting, have you seen any projects that
> can successfully determine distance bases on such limited information
> coming from an image?

Lots of scholarly stuff. Googling uncalibrated image sequence 3-d
reconstruction seems to get you the best results.

This gives a brief demo but doesn't say how it is done.
http://compression.ru/video/3d_display_video/depth_map_generation_en.html.
This is using the whole image, but I think that is overkill for
getting a 2D map of a room.

An image has lots of information. :) My idea is that you look for
edges, that is changes in colour. These represent both edges of
objects and textures. You try and pair up edges between two frames
based on colour change and position. If an edge moves a lot between
successive frames of a video due to the motion of the camera, it is
close, if it doesn't change much it is far away (the change is
proportional to distance, I'll probably have to do some scaling using
data from the accelerometer to figure out how far the robot has moved
to improve precision). The depth of areas between edges would be
linear interpolations of the depths of the two edges either side. This
will work better in textured environments, it will have trouble with
plain white walls. Also the camera would have to be fairly level so
that it wouldn't be looking at different point of an object as it
changed distance. This may be a problem. Although I could average over
a few pixels in a vertical strip to even out bumps in the ride. But
the basic idea would remain the same.

From what I've read of the algorithms that do full depth mapping of an
image they have to look for corners of objects and other features as
the image can rotate in many dimensions. Since I'm constraining the
robot to be on the floor and only rotate around 1 axis, I think that
edges should be enough.

>  Doesn't sound easy at all - I've maybe
> understood your plans though? I'm thinking you plan on having an image
> and just basing your calculations on the central row of pixels!?  I
> can't think how this could possibly be done...perhaps if you could
> focus on a particular spot on a wall and move towards it, relative to
> the camera this spot would be seen to rise and you could maybe
> calculate distance based on this?
>
> I think echo location would be easier to achieve...not to mention you
> already get cheap sensors for this.

I'd like to make a cheap easy to make bot like the truckbot (although
that requires a phone with serial which seem to be rare). I'm going to
push the phones basic sensors to the limits and see what I can get
from it. To be honest I'm not sure it will work, it might need to go
full depth mapping, which I don't think phones will have enough grunt
for. At least for a few years :)

Will

spirit...@gmail.com

unread,
Dec 27, 2011, 6:54:57 AM12/27/11
to cell...@googlegroups.com

My suggestion if you want a cheap/easy chassis, use the ones at www.osbots.com it will work with cellbots, robotsanywhere and explorationuplink. It has no sensors on its own. Arduino based but the arduino is preprogrammed. This uses audio out instead of bluetooth, though, so YMMV.




 Will

Reply all
Reply to author
Forward
0 new messages