Go to Post The rules are the rules, but if the rules get so ridiculous some of us may choose not to play anymore and that is the bigger shame. - Paul Copioli [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-01-2005, 16:17
VideoMan053's Avatar
VideoMan053 VideoMan053 is offline
Computer Freak
AKA: Dan J.
FRC #0063 (Red Barons)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Erie, Pennsylvania
Posts: 18
VideoMan053 is an unknown quantity at this point
Send a message via AIM to VideoMan053
Camera Tracking Woes

Has anyone been able to get the camera to track and follow (or get close to) one of the vision tetras?

I had an idea about having the drive motors try and turn so that the pan servo on the camera returns to zero, but that doesn't seem to be working.

I have something like this

Code:
 
 
if (cam.pan_servo < 127) // Camera is turned left
{
	 pwm01 = 70; // Left Drive Motor
	 pwm-2 = 200; // Right Drive Motor Forward
}
else
the code continues saying that if it is facing the other way, turn right.

Any ideas?
__________________
GET OVER IT! ~ not the most useful words in competitions, but some of the most useful in life!
My Jobs: Programming
  #2   Spotlight this post!  
Unread 25-01-2005, 18:48
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Camera Tracking Woes

It doesn't seem to be working, like...?

I think the default code is setup that the RC does tracking (which I think is a bad idea, since the camera is perfectly capable of it).
  #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
  #4   Spotlight this post!  
Unread 27-01-2005, 19:54
VideoMan053's Avatar
VideoMan053 VideoMan053 is offline
Computer Freak
AKA: Dan J.
FRC #0063 (Red Barons)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Erie, Pennsylvania
Posts: 18
VideoMan053 is an unknown quantity at this point
Send a message via AIM to VideoMan053
Re: Camera Tracking Woes

Okay, does anybody know what the variable for the camera pan servo is in user_routines_fast.c ??? Please help!
__________________
GET OVER IT! ~ not the most useful words in competitions, but some of the most useful in life!
My Jobs: Programming
  #5   Spotlight this post!  
Unread 29-01-2005, 18:09
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: Camera Tracking Woes

Quote:
Originally Posted by VideoMan053
Okay, does anybody know what the variable for the camera pan servo is in user_routines_fast.c ??? Please help!
If you look at the source code you will find that the variable is cam.servo_pan, unless I am mistaken.

[edit] It might be cam.pan_servo [/edit]

Last edited by Greg Marra : 29-01-2005 at 18:11.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
Kevin Watson's Kick-off Demo Code! Mr. Lim Programming 27 22-01-2005 03:38
Camera Auto Tracking? Ryan Cumings Programming 9 22-01-2005 02:20
Game Field Camera Calibration Matthew_H Regional Competitions 2 15-01-2005 23:09
CMUCam2 Camera Code - Are important parts commented out? Mr. Lim Programming 4 14-01-2005 12:11


All times are GMT -5. The time now is 02:49.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi