Society of Robots - Robot Forum

Software => Software => Topic started by: Jak24 on December 10, 2010, 12:14:23 PM

Title: Camera interfacing with ardiuno
Post by: Jak24 on December 10, 2010, 12:14:23 PM
Hi!

For my next robot i would like to add camera for object tracking/avioding.
I have done quite a bit of research and read a lot of related topics on this forum.
The two cameras that i was looking at were the blackfin and the cmucam 3
I have and ardiuno Mega 2560 controller, and i was looking for some example
program to interface the ardiuno with the blackfin or cmucam 3,
but i didn't find any example programs for ardiuno for any other similar controller,
i also didn't find of examples on how to use the serial communication on them
Can any one suggest a tutorial for me, or some kind of example programs??
Any advice/ suggestions about the camera hardware/software are welcome..

Thanks

Regards
Jak24


Note: (i just realized that this topic was placed in mechanics instead of electronics , sorry :P)
Title: Re: Camera interfacing with ardiuno
Post by: karrotx on December 12, 2010, 01:55:38 AM
If you are serious about object tracking you'll want to look into OpenCV http://www.opencv.org (http://www.opencv.org)

The Arduino is not powerful enough to handle the computation, you'll need something like a netbook in addition to your Mega.

I'm working on a project right now that uses a Dell Mini 9, Arduino Mega 2560, and Ethernet Shield. The Dell runs an object detection program I created using OpenCV which sends motor commands to the Arduino through the shield. It's still in early development, otherwise I'd offer up the code for you to browse.
Title: Re: Camera interfacing with ardiuno
Post by: Jak24 on December 12, 2010, 03:02:49 AM
HI !
If you are serious about object tracking you'll want to look into OpenCV http://www.opencv.org (http://www.opencv.org)

The Arduino is not powerful enough to handle the computation, you'll need something like a netbook in addition to your Mega.

I'm working on a project right now that uses a Dell Mini 9, Arduino Mega 2560, and Ethernet Shield. The Dell runs an object detection program I created using OpenCV which sends motor commands to the Arduino through the shield. It's still in early development, otherwise I'd offer up the code for you to browse.

OK, but i thought the blackfin does all the processing and the mcu (ardiuno) just asks to receive information from it and then
acts upon that information, atleast according to this:
http://www.societyofrobots.com/electronics_blackfin_camera.shtml (http://www.societyofrobots.com/electronics_blackfin_camera.shtml)
and well, the laptop idea wouldn't really work for me cause the space/ weight wouldn't be good.
I still can't find any blackfin+ ardiuno tutorial, any ideas?

Thanks
Regards

Jak24
Title: Re: Camera interfacing with ardiuno
Post by: rbtying on December 12, 2010, 04:17:31 PM
HI !
If you are serious about object tracking you'll want to look into OpenCV http://www.opencv.org (http://www.opencv.org)

The Arduino is not powerful enough to handle the computation, you'll need something like a netbook in addition to your Mega.

I'm working on a project right now that uses a Dell Mini 9, Arduino Mega 2560, and Ethernet Shield. The Dell runs an object detection program I created using OpenCV which sends motor commands to the Arduino through the shield. It's still in early development, otherwise I'd offer up the code for you to browse.

OK, but i thought the blackfin does all the processing and the mcu (ardiuno) just asks to receive information from it and then
acts upon that information, atleast according to this:

karrotx probably misread your post - you're right, the camera should do the processing for you.  The only problem is that such cameras are low-resolution and generally can't recognize all that much - blob detection and edge detection are as far as I've heard them ever go.  Anything more than that and you'll need more power.

[...]
I still can't find any blackfin+ ardiuno tutorial, any ideas?
Don't bother - just look at the datasheet and any C/C++ examples, and then convert the syntax.  Realize than the Arduino isn't targeted toward people who are looking to build complex systems - you can tell just from the lack of power buses on the standard boards.  Alternatively, convert to webbotlib and make your life easier.  Only problem is shifting to C from C++, but that should be fine. 
Title: Re: Camera interfacing with ardiuno
Post by: Jak24 on December 13, 2010, 05:33:42 AM
Hi.

karrotx probably misread your post - you're right, the camera should do the processing for you.  The only problem is that such cameras are low-resolution and generally can't recognize all that much - blob detection and edge detection are as far as I've heard them ever go.  Anything more than that and you'll need more power.

That's plenty for me :P
[...]
I still can't find any blackfin+ ardiuno tutorial, any ideas?
Don't bother - just look at the datasheet and any C/C++ examples, and then convert the syntax.  Realize than the Arduino isn't targeted toward people who are looking to build complex systems - you can tell just from the lack of power buses on the standard boards.  Alternatively, convert to webbotlib and make your life easier.  Only problem is shifting to C from C++, but that should be fine. 
well the datasheet doesn't have any commands(atleast the one i was looking at didn't) the only commands i found were these:
http://www.surveyor.com/SRV_protocol.html (http://www.surveyor.com/SRV_protocol.html)
and i am pretty sure that i can't use that code with the arduino,
Could you point me at some c/c++ examples?
Thanks

Regards
Jak24
Title: Re: Camera interfacing with ardiuno
Post by: rbtying on December 13, 2010, 08:49:31 AM
It's got a UART you can use for data and command tranmission:

Code: [Select]
  uint8_t command = 'a'; // or any other command from the list...
  Serial.print('command');

I don't actually own a blackfin, so I can't tell you more than that. 
Title: Re: Camera interfacing with ardiuno
Post by: Jak24 on December 15, 2010, 11:58:55 PM
Hi !

The commands on the website helped me alot, but i was looking at the blackfn with axon tutorial and in there
to initialize the communication it has the following command :
Quote
#include "Blackfin_Axon.c" //files for Blackfin Robot camera
#include "control.c" //your code goes in here
My question is how can i get the library for the blackfin to work with an arduino?
Or should i be able to just connect them with out any libraries?

Thanks
Regards

Jak24
Title: Re: Camera interfacing with ardiuno
Post by: Admin on January 13, 2011, 08:49:55 PM
The issue with the Arduino is that it only has one UART port, and that is tied to the USB already. You'd have to create a software UART, but that'll be very slow.

The Axon comes with four UARTs . . .

If you use WebbotLib Project Designer, you can very easily add the Blackfin to your Axon or Arduino.
Title: Re: Camera interfacing with ardiuno
Post by: Hawaii00000 on January 15, 2011, 04:11:50 PM
There was a guy who post and an Arduino + vision processing project a while ago which included code. Don't know if I could find it though.

A regular Arduino has only one uart, but and Arduino Mega should has a few extra.
Title: Re: Camera interfacing with ardiuno
Post by: Joker94 on January 15, 2011, 09:52:36 PM
if I was in your situation and wanted to get webbolib blackfin library working with the Arduino board and the Blackfin Camera I would write the code in AVR studio, and use a hardware programmer to upload the code to the board and treat it as if it was a 328 controller board. this will remove the boot loader software and free up the UART port.

If you are worried about not being able to reload the software, get a new mega328 chip for $2.50 and the put that chip into is the arduino for ths\is project, that way you still have a MCU with the Arduino boot loader still loaded.
Title: Re: Camera interfacing with ardiuno
Post by: Ro-Bot-X on January 16, 2011, 07:16:22 AM
Arduino Mega has 4 UARTs, just like the Axon. UART0 is used for bootloading, all others are available for the user. Actually, different from the Axon, the Arduino Mega allows the user to use the UART0 for his own purpose, even if the pins are tied to the FTDI chip. The only thing you have to do is unplug your device from UART0 before you use the bootloader and plug it back afterwards. Same is true for the regular Arduino. Sometimes this is inconvenient, but it works. Also, many compatible boards don't have the FTDI chip on board anymore, so the user can plug in whatever is needed at the time.