Go to Post Your entire life is a choice - a choice to believe or denounce everything that is ever said to you. - 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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-01-2007, 13:30
xrabohrok's Avatar
xrabohrok xrabohrok is offline
hunter of errors
FRC #1208 (The Metool Brigade)
Team Role: Programmer
 
Join Date: Jan 2006
Location: O'Fallon
Posts: 62
xrabohrok is an unknown quantity at this point
camera scope problems

I have been programming our robot's autonomous by using the current positions of the camera servos seen in tracking.c. This, of course, creates scope issues. If anyone could tell me an effective way to pass these variables to user_routines_fast.c, that would be incredibly appreciated. thx!
__________________
"It's programming's fault" may be a viable excuse for just about everything, except the robot falling apart.

It will 'cause it can!

constants aren't. variables won't.
  #2   Spotlight this post!  
Unread 13-01-2007, 14:25
Stuart's Avatar
Stuart Stuart is offline
#include coffee.h
FRC #1745 (P51- Mustangs)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Dallas, TX
Posts: 414
Stuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond repute
Send a message via AIM to Stuart
Re: camera scope problems

edit the tracking.c and .h files to include custom getPan() getTilt() functions.
__________________
Proud mentor of Team #1745 the P-51 Mustangs

If at first it doesn't work, use a hammer.
If that doesn't work, use a bigger hammer.
  #3   Spotlight this post!  
Unread 15-01-2007, 12:48
xrabohrok's Avatar
xrabohrok xrabohrok is offline
hunter of errors
FRC #1208 (The Metool Brigade)
Team Role: Programmer
 
Join Date: Jan 2006
Location: O'Fallon
Posts: 62
xrabohrok is an unknown quantity at this point
Re: camera scope problems

I don't know how to implement that. I tried making the music the extern variable type but that only us a weird problem that goes something like "pan_servo_position's definition in tracking.o" How in the world do I fix this?
__________________
"It's programming's fault" may be a viable excuse for just about everything, except the robot falling apart.

It will 'cause it can!

constants aren't. variables won't.
  #4   Spotlight this post!  
Unread 15-01-2007, 13:51
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,068
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: camera scope problems

It seems to me you wouldnt have to extern the variables. Instead what you can do is to read the PWM output that you are sending to the camera from the servoTrack(). Uh, basically in youre user_routines.h file where it says to add your aliases here you put the lines:
Code:
#define CAMERA_PAN     pwm01
#define CAMERA_TILT     pwm02
instead of pwm01 and pwm02 you put whatever pwm outputs the actual servos are connected to. For another example of how this is done Im relatively sure you can check lines 36 and 42 of tracking.h.

Now to write the get____ functions you just write them like you would any other Accesor Method (sorry too much java programing for me). The only thing you would need to have the function do was return PAN_SERVO or TILT_SERVO. Of course you need to add them to the tracking.h file like any other functions you write.

If you still cant get it pm me and ill try to explain better. Sorry if I seem a bit vague, I dont like it when people just tell someone what to do. Thats really not the spirit of first or programming. Yay for problem solving
  #5   Spotlight this post!  
Unread 15-01-2007, 20:48
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: camera scope problems

um... we used the camera's pwm constants in the autonomous code last year without fail... why would this be causing a scope error at all?

snippet:
PHP Code:
//update variables
        
autoOption = (bAutoOpt01 + (bAutoOpt02*2))+1//parse the binary input
        
robotTilt Get_Gyro_Angle();
        
cam_pan PAN_SERVO;
        
cam_tilt TILT_SERVO;
        
cam_pixels T_Packet_Data.pixels
that worked without fail. i wouldnt use get__ functions though, unless they are inline, because the sheer amount of calls you will be making to these funtions might cause undesirable overhead.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
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
Camera \ EMF problems... zachriggle Electrical 17 02-05-2006 23:48
Strange Camera Problems Hutch Programming 5 25-04-2006 12:45
Camera Servo Problems pi_guy578 Programming 2 28-01-2006 13:17
Camera variable scope question Validius Programming 1 28-01-2006 09:24
Camera Problems pickle Programming 21 20-01-2005 20:43


All times are GMT -5. The time now is 22:48.

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