Go to Post Something has gone awry this year in FIRST. I think more teams are concerned with winning and their robot that they don't even stop to think about the kids on their team, or the learning experiences of others. - Amanda Morrison [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 15-01-2005, 00:33
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Camera Range Finding

Ok I am new to programming, but I am supposed to be figuring out how we can use the camera this year. Now it looks easy enough to make the robot get to the vision tetra, but obviously it needs to know when it gets there. My first thought was to use one of the light sensors from last year and turn up the sensitivity so they would see any reflected light from a tetra, but that seemed kind of iffy. Now I am thinking of using the tilt of the camera to compute the range of the target. My plan was to run a cable from the tilt servo port on the camera then split it and run one end to the servo, and another to the RC, then monitor the signal on this cable in order to tell where the servo was supposed to be, then when it gets to the proper angle it starts up the code that makes the robot pick up the tetra. But just now I was going over the code and I noticed this in user_routines_DDT.c:

Quote:
/********************************************
** VISION VARIABLES **
*********************************************/
int pan_dir=0;
int state=0;
int latch=0;
int latch2=0;
extern unsigned int index_ptr;
extern unsigned int data_rdy;
extern cam_struct cam;

int color=0;
const int steering_comp = 30; //steering compenstation (0 to 127)
const int speed_setting = 150; //forward speed setting (127 to 254)
extern int pan_position,tilt_position,tracking;
unsigned int speed_control;
Notice that on the second to the last line it seems to be setting up a variable that monitors the tilt position. Can someone tell me whether my analysis is correct, and how I can access this for an if/then statement basically saying that if this value is above or below a certain number it needs to do something.
 


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
Only 1 camera allowed? Joe Ross Control System 4 17-01-2005 23:29
Camera Problem n_0163 Electrical 3 14-01-2005 21:10
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 10:23.

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