BOE BOT CMU camera question.
Hello,
I have an older version of the BOE BOT CMU camera (without the app mod header), that Parallax
sold in 2003. I have always wondered about how the servo connection works. In all the documentation
it does not go into any great detail about how to get it to work. The only references that I have seen
explain the pin out and how to hook a servo up to it for object (color) tracking. I have read something
in the documentation that states it is an 'advanced function', but then nothing more. Can someone
explain to me how to get this thing to track objects (color) using the servo connection?
Your replies are greatly appreciated!
Thanks,
Michael G. Jessat
I have an older version of the BOE BOT CMU camera (without the app mod header), that Parallax
sold in 2003. I have always wondered about how the servo connection works. In all the documentation
it does not go into any great detail about how to get it to work. The only references that I have seen
explain the pin out and how to hook a servo up to it for object (color) tracking. I have read something
in the documentation that states it is an 'advanced function', but then nothing more. Can someone
explain to me how to get this thing to track objects (color) using the servo connection?
Your replies are greatly appreciated!
Thanks,
Michael G. Jessat
Comments
·· The CMU Cam was developed by Seattle Robotics.· Perhaps they can answer your advanced questions on the servo tracking feature.· You can contact them at the link below.· They should be able to answer those questions.· If not, post back here.
http://www.seattlerobotics.com/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thanks again for your help, this is a great forum, I wish I had known about it sooner. It would have saved me countless hours
of wasted time in researching the answers. Only to find the answers provided were vague or incomplete, as has been the case
time and time again. It seems that most robotic/electronic web sites on the net just don't give out enough information. Or if they
do, they take you to the brink of being able to understand how 'they' have done it, and stop. Being an IT professional and NOT
and Electrical Engineer or Designer, really tends to complicate things quickly. I can understand the programming required to get
a robotics project working, and to a large degree the required electronic circuits, along with their construction from scratch or a
provided schematic diagram. But, I fall way short of being able to fully understand the complex nature of this hobby. Parallax is
a wonder company and the product support by far is the best I've ever seen to date.
P.S.- I have e-mailed support@seattlerobotics.com today, I guess I may hear from them by tomorrow.
Respectfully,
Michael G. Jessat
a little taken in by false advertising. I have found mention of the syntax used to turn on the servo mode on the seattlerobotics.com
web site (after much digging I might add). Along with a nice little mention of the fact that the servo port when used with what
they called a 'slow processor' (yes, thats right the Basic Stamp II clearly mentioned), that the servo becomes practically useless.
All documentation that I had gotten when I ordered this camera clearly stated "Ability to control 1 servo or have 1 digital I/O pin - advanced function". And thats quoted directly from their website and the documentation that came with my BOE BOT modified CMU camera. I am waiting for a response from Seattle Robotics support to get the official word, but after what I have read on their website I have to believe its fact. I cannot understand why they would market this modified version, that clearly is designed to function with the BOE BOT, a Basic Stamp II robot, then state that certain features are available when in fact they are not
I have used the camera with a BS2 and have successfully been able to both read the position of the servo and direct the servo position through the camera. Look at the capabilities of the··N data packet for reading the position, and the S1 command for moving the servo under Stamp direction.
The digital·I/O pin you are refering to is the same pin as the signal pin for the servo. It's probably only useful if you aren't·controlling a servo with the camera.
The original camera firmware didn't have the capability to return an N packet(I had to upgrade firmware ) but if your documentation mentions the features you want, I suspect you have a more recent camera. Check your firmware version with the GV command. It should return a version of 1.12 or higher.
The key commands to read up on are the MM command to read the servo position and invoke a N data packet, the S1 command to set the servo position or use digital output, and the I1 command to read the digital input
Final hints-
The Stamp IS pretty slow for vision processing. It's probably best to use the camera in Poll Mode so it only has to deal with one data packet at a time (PM command). Don't expect to be able to read miultiple packets in a loop, or packets that give raw vision data. The amount of data returned will overwhelm the Stamp.
I don't direct the servo though the camera any more· - I use·a servo controller on the robot which also contols·other ·servos. I found the range of motion was limited to 90 degrees with the servo I was using and got better range of motion with the servo controller. Plus, I can control pan AND tilt.
Still, the camera is one of the most useful sensors on my RoboMagellan robot. It does have a learning curve to use it properly- I did find that I had to use it a lot to find out what it would do. I found that the discovery process·was part of the fun. Hook the thing up and try all the commands under different conditions It'll take a while- the camera is pretty versatile, but instant gratification isn't one of its features.
Hope this helps
Larry
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Larry) : 6/20/2005 7:02:13 AM GMT
Thanks for your reply. I really appreciate the feedback you provided to me its very helpful. I have read alot of information that I was not able to gleen on the Seattle Robotics web site (after digging in deep). It just left me feeling taken in by flaunting a servo feature, then stating that on a slow microcontroller (yes, BS-II clearly named), that the feature was practically useless. It was designed for the BOE BOT, a BS-II based robot. If I may ask, you say that you are using a servo controller to drive your servo(s) for pan and tilt, how are you doing this in relationship to the camera? I'm trying to be a little more clearer with that query -- If the CMU camera locks onto object 'X' with the proper mode set, it outputs 'Y' to the servo for tracking. How are you telling the servo controller to move the CMU camera in relationship to the object being tracked? Sounds like the best way to go under the circumstances.
Thanks for your feedback!!!
Respectfully,
Michael G. Jessat
First, determine the color you want to track. There are several ways to do this, but the easiest is to use the TW command while you are holding the target color in front of the camera.It will call the GM command to get a color and then call the TC command to get an M packet. after the first time you use the TW command, just·using ·TC will get the M packet for the same color.
Example of how to Track a Color with the default mode parameters
:TC········ ' you send to camera
ACK····· ' camera returns· (this can be surpressed if it is a pain)
M 50 80 38 82 53 128 35 98···· 'camera returns an M packet
This is the return packet from a color tracking command with Middle Mass mode on. In order, the values returned are:
M - tells you what kind of packet you got
mmx - The middle of mass x value
my - The middle of mass y value
x1 - The left most corner's x value
y1 - The left most corner's y value
x2 - The right most corner's x value
y2 -The right most corner's y value
pixels –Number of Pixels in the tracked region, scaled and capped at 255: (pixels+4)/8
confidence -The (# of pixels / area)*256 of the bounded rectangle and capped at 255
This is all info you can use, but the key values to track with servos are the first two values, ·which are the x and y values of the centriod of the color you are tracking.. since the camera· has a resolution of 80 x 143, all you need to do is write code that moves the servos so the two values· stay around 40 and 71, respectively.
If the x value, for instance , is 50, you will need to move the x ·servo to the right. If it is 30, move the servo left. Practice will teach you how much to increment with your servos. It's the same in the y direction The sample packet· above would require you to point the camera·right and up to keep it centered on the object you are tracking.
This same packet will give you the relative size of an object. you can use that as a measure of how close you are to it. . x2-x1 and y2-y1 give the x and y size.
Look over an example program ( the "quick hack" from Seattlerobotics, for instance)
you will see how the camera is set up and how it is used to track a color
start using the camera- it'll soon become clear. Use a bunch of debug statements so you know what the camera is doing.
Larry
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Your help is making my life with this camera much easier, my many, many thanks!!!
Respectfully,
Michael G. Jessat