View Single Post
  #3   Spotlight this post!  
Unread 25-01-2005, 19:09
Unsung FIRST Hero
Matt Leese Matt Leese is offline
Been-In-FIRST-Too-Long
FRC #1438 (The Aztechs)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1998
Location: Long Beach, CA
Posts: 937
Matt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond repute
Send a message via AIM to Matt Leese
Re: Camera Tracking Woes

While that possibly can get the robot to drive towards the tetra, it probably won't work well.

The best way to accomplish this is to do it with some form of a control loop. In a control loop, you take as input where you'd like to be. You then subtract out where you currently are. Then, you transform this value (through a variety of techniques the simplest of which being a proportional) and output it to the motor.

In short this is:
output = transform(current position - desired position )

If you're using a proportional controller, it would be:
output = constant * (current position - desired position)

To get the robot to drive to the tetra, you want the pan position of the camera to center. That will give you the current position and the desired position. You can determine the constant through experimentation. There is a bit more to it given that for output, no movement is at 127 not 0. You also have to have a way to make sure it will still go forward when centered.

We used a very similiar technique last Saturday and the robot would reliably drive toward the tetra as long as the camera tracked it.

Matt