LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

soccer robot

Hi, i'm working on a robot soccer, that has a webcam placed directly on the top of the robot(showing five different coloured circles from the view of the camera) to act as the robot's  "eyes", detecting the robot's position. I'm required to use Labview, with Vision Assistant as image processing program to create a programme in such that the robot would move to the ball(target). I'm using rs-232 connecting between the host computer and a Basic Stamp 2 board(transmitter), a  RF module to communicate with the robot(receiver). Currently, i'm working in grayscale image abdi've made necessary image processing steps but i cant seem to get the coordinates of both the robot and ball(target) in the same program and i'm stuck on how to control robot's movement to the target using Labview programming. How do I go about finding the angles and distance between the robot and the target? What functions should I use? Hope to seek guidance from anyone who can help.
0 Kudos
Message 1 of 5
(3,278 Views)
About the distance:
If your ball has standard dimensions you can calculate the distance from the size of the circle, you view from the webcam.
The closer the ball is, the bigger the circle will be.
If your ball has not standard dimensions, and a webcam is the only sensor you have, you can make a setup subprogram, that will be called every time the ball changes, so the robot will "learn" the size of the ball. This is a disadvantage but you can measre distance even the robot is still.
 
A better way (and probably more difficult) , will be to use two webcams. Then you can have a 3D view of the world ! (that's why we have two eyes).
I have not done it, but i think you will need quite complicated algorithms.
 
There is a third way. The easier one. If your robot head and webcam always have the same distance from the floor, which probably will be true, you can measure the distance after moving a little the robot and keeping the webcam still. Just compare the angle the ball moved to your webcam with the known small distance the robot moved.
The bad thing is that the robot must move to measure the distance.
 
The angle should be more easily. Just measure the center of the ball, you view from the webcam, with the center of the webcam.
0 Kudos
Message 2 of 5
(3,256 Views)
Creating soccer robots isn't too easy and using optical systems for position- and target-"acquisition" is very difficult.
Pnt already wrote about some things you have to consider, but i will add some more:

- What about "linearity" of your picture? Does your webcam create non-linear distortion? (see this)

- If you create a real soccer robot, there will be relative speeds between ball and robot. Have you already thought about optimazation for this? (Otherwise, your robot will behave like a dog crossing a quick flowing river!)

- Does the robot act as a single player or are there more of them? You will need to "look" for other "players" in order to prevent damage to your robot and the others....

These are some points coming to my mind in seconds (writing takes more time though.....), but you can see one thing:
ONE SINGLE sensor is most often absolutly insufficient to solve such a task. Take in consideration a human footballer:
He has eyes and ears to learn his surrounding and maybe some kind of "precognition" in order to prevent dangerous situations. This will make a good soccerplayer...and your job seems to be to transfer this to.... a robot 🙂
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 5
(3,243 Views)
Dear Pnt and Norbert B,


Seems like my the third method could be the key to solving my problem, as the webcam is fixed at a height distance on a structure. But I'm anxious to know, what functions I could use to measure the distance between the robot and the ball(target)? My "ball", which is the target, is not exactly a ball. It is a piece of circled cardboard with a diameter of about 7cm and has a big cross on it. I've tried out using IMAQ Clamp functions but it seem like its not capable of measuring the distance between two points in reference of the edge detections of both objects. Is there some specific functions i could use to measure the distance? I'm able to get the co-ordinates of both objects but not able to compare robot's co-ordinate with target's co-ordinate to get the distance.

The robot only acts as a single player and as for the linearity of my picture, my webcam does not create non-linear distortion.

Can I have advises on how to send ASCII code out through the RS-232, in relations to the robot movements? My Basic stamp2 codes have all the controls to command the robot's movements but I dont know how to use them with Labview programming. Will someone point me the right direction please?


Lastly, thank you for your kind attention and the valuable advises given. Really appreciated it.
0 Kudos
Message 4 of 5
(3,211 Views)
Hi,

To communicate over RS-232, you can use the VISA functions in LabVIEW. There are some good examples to be found through the NI Example Finder, just search for "serial". For example, the "Basic Serial Write and Read" example will let you configure your VISA resource (serial port) and write and read strings. I hope this information is helpful in getting started with serial communication. There are also some good KnowledgeBases available, for example:

Serial Communication Starting Point
http://digital.ni.com/public.nsf/websearch/e22da85e97818de78625678c0069bfc9?OpenDocument

Please post back if you run into specific problems, and good luck with the SoccerBot!

~NH

0 Kudos
Message 5 of 5
(3,128 Views)