My Arduino + CMUcam indoor rover

Update 20/09/2008: A major milestone has been reached! The robot can navigate around a otterman, two shoes, my leg and a kitten using just the CMUcam's averaging function and some Arduino clevers. The latest video is the top one. The code for the robot is attached as well.

Update 18/09/2008: I have installed a pair of Solarbotics "Secret" L293D Motor Drivers in the Rogue Blue's servo casings and have added a video showing a test of them in action. I have also uploaded the Arduino code used for the demo video. The motor drivers replaced the pair of TIP122 power transistors that were providing the original stop/go functionality.

Brief Overview

This is my first real robot. It is an "never-ending" project, started a year ago, that is intended to be a test bed for any ideas/projects I think of over the next couple of years. Currently it is handling the interfacing between an RS232 CMUcam1 and an Arduino (Stickduino).

This LMR entry is a little basic at the moment as I created it on impulse, to accompany my main blog at (http://thisismyrobot.blogspot.com). I will replace the following with more detail shortly, and in the meantime there is a stack of info on my blog.

To summarise, the platform is based on a Rogue Blue chassis from Trossen Robotics (http://www.trossenrobotics.com/store/p/3166-Rogue-Blue-ERS.aspx), which I have expanded vertically using very thin hollow aluminium tubing and some large diameter bolts that (just) thread into it. The base seems to be able to handle a couple of battery-packs and a microcontroller or two thanks to the servo gearing.



Navigates around and indoor environment using a CMUcam and Arduino (for now)

  • Actuators / output devices: 2 x 111oz Servos, 2 x 3inch foam wheels
  • CPU: Arduino Decimila (Stickduino)
  • Power source: 7.4V 15C LiPoly pack for motors, 6 AA pack for Electronics.
  • Programming language: Arduino C
  • Sensors / input devices: CMUcam1
  • Target environment: indoors, carpet

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/my-arduino-cmucam-indoor-rover

some more info would be nice

some more info would be nice :slight_smile:

why did you made it so tall? I’d like to have a cmucam too, they are awsome

Very interesting - I found a

Very interesting - I found a link and video regarding the CMUCam here http://www.cs.cmu.edu/~cmucam/ with some amusing videos.
I briefly went over the manual - it appears they have a rs-232 connectionwhich feeds the RGB data to your Arduino Decimila. Do they have a variety of uProcessor code which will do all the Tracking and Blob centering functions?

What does your code do - stop on black centered blob?

What do you think of it?

I noticed they had 2 other versions CMUCam2 & 3 - do you know what was improved?

What are it’s Pros & Cons?

I also notices a Java interface - What would run the Java, not a uProcessor?

I am interested because I am working on a cheap webcam java/robotic library for stereopsis ranging, color tracking, object identification and other functions. I was wondering what other items exists, would be applicable, or coud be interfaced with …

Keep up the great work,

Regards,

GroG

more info and height

Hi Nicola,

Thank you for your comment. I have now added a touch more info above and, as I stated there, more is on my blog and I will fill this in with more as I progress from here onwards.

As for the height, that height seems to work best for the camera, giving a good balance between keeping the robot small and allowing the robot to see enough of the ground (carpet) to be able to judge distances in a basic fashion. I don’t intend to carry much of a payload at the top, just small cameras and IR sensors etc.

The CMUcam is Awesome! Even the basic CMUcam1 is great, and an excellent introduction to machine vision. That, combined with the simple Arduino serial libraries make programming for it incredibly easy.

Cheers,

Robert

Hi GroG, Cheers for your

Hi GroG,<o:p></o:p>

Cheers for your comment, I will try to reply to as many of your points as possible, in order.<o:p></o:p>

Yes, the camera is RS232, and I have hooked the Arduino’s 1+2 pins up to the CMUcam’s TTL RS232 pins (removing the MAX232 chip), and I am using the Arduino’s serial library to talk to the camera. From the manual, I am using these commands to track the shoe.<o:p></o:p>

PM 1 <- this sets the camera into pulsed mode, only returning a single item of data per request

SW 1 1 80 70 <- this sets the working area of the camera to the top half of the view<o:p></o:p>

GM <- this returns the average R,G,B and the Standard Deviations of the R,G,B (6 values in total), for the top half <o:p></o:p>

SW 1 70 80 143 <- this sets the working area of the camera to the bottom half of the view<o:p></o:p>

GM <- again, for the bottom half <o:p></o:p>

I then compare the two averages, and if more that three (between the two sets) are different by 20 (of a range 0-240), the robot stops.<o:p></o:p>

So, it is not overly difficult to obtain cool results quickly. I have done more since then, but I have not taken any vids yet. I would recommend the basic CMUcam to anyone on a budget (like myself) who wants to play with video on their robots.

I have not played with the other CMUcams, but I believe they add higher levels of processing to that of the basic version. I never really looked at them, when I purchased the camera I was wondering about $$$ not functionality :slight_smile:

The Java interface is a demo program parcelled with the camera, allowing for the testing of commands, and for displaying an image – useful for setting focus etc. It would run on a PC usually.

As for the Java library, with the CMUcam most of the processing is done on-board, and based on my experience with Java and the CMUcam (when testing on my main PC), Java’s IO can be incredibly difficult to get working. To be honest, I am not sure how I would proceed in that development.

I hope this helps a little bit, and I will put up some code examples as soon as they are fit for public consumption! :smiley:

I am trying to use the
I am trying to use the CMUcam1 with my Picaxe 28x1 board, am I to connect the TTL recieve pin from the camera board to the digital input on my Picaxe? And the transmit pin from the camboard to the Direct output pin on my picaxe, if so, I need help with the code :confused:

 

Arduino and CMUcam interface

Hi Robert, 

Could I get some information on Arduino and CMUcam interfacing? Which Arduino did you use for this project? Do you see any limitations if Arduino Uno is used.

Cheers

■■■■■■

 

 

Hi

Hi ■■■■■■■

The CMUcam was interfaced to the Arduino via TTL-level RS232. This involved 3 wires for RX, TX and GND.

The Arduino I used was a StickDuino (http://spiffie.org/kits/stickduino/) - but you should be able to use any Arduino that has RS232 (which they all do I think).

Cheers,

Robert

Hi RobertThanks for your

Hi Robert

Thanks for your post. Could you be able to share the schematics for the interface?

 

Regards

Arduino1+2 pins

What are these Arduino 1+2 pins that is being referred to in the above comment? Can we use RS232 shield ?

serial pins

From memory I was using Software Serial through pins 1 and 2 (TX and RX) - so, yes, you should be able to use an RS232 shield and whatever pins you like.

unfortunately no :frowning:

Unfortunately I have since disassembled the arduino + camera interface, but there should be plenty of examples - a simple google brought up this one on LMR https://www.robotshop.com/letsmakerobots/node/13354

Hi, i am from singapore. may

Hi, i am from singapore. may i know how do u get the CMUCAM to communicate to the Arduino?? Say i want to print the output in the serial monitor. The output of the CMUCAM i suppose is in this format "Tn cx cy x0 y0 x1 y1 a q xL xR hA ". how do i read in the output? Thank you so much… i deeply appreciate it. please reply…

CMUcam+Arduino interface

Hi Robert,

 

Need some advice. Appreciate your inputs. I have a small project going where I need to capture an image, perform some postprocessing to retrieve some data from the image and then upload it on a webpage.

 

I have cmucam3 to capture the images and arduino to transfer the data to the webpage. Do you reckon I should run the postprocessing algorithms on the images on cmucam3 or arduino? I am not sure if arduino has the capability to perform any image processing and if the images can be tranferred over the serial port? 

Regards