Go to Post I love the smell of burnt motors in the morning! - Mike Betts [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 09-02-2007, 01:29
jdejoannis jdejoannis is offline
Registered User
FRC #1845
 
Join Date: Feb 2006
Location: Atlanta,GA
Posts: 48
jdejoannis will become famous soon enoughjdejoannis will become famous soon enough
No Tracking During Autonomous

The camera does not track (or do anything) during autonomous mode, but it does a wonderful job during OI mode. Why?

Also, we will want to turn the camera off during OI. How?

Also, my print statements (eg. printf("Confidence=%d\n,T_Packet_Data.confidence); ) are ignored from within user_routines_fast.c. Do I need to use a loop counter to slow things down?

I am using frc_camera_2.1 with last year's RC (at the moment).

Jason
  #2   Spotlight this post!  
Unread 09-02-2007, 08:01
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: No Tracking During Autonomous

To receive data from the camera, you have to call Camera_Handler(). To make the camera servos track the light, you have to call Servo_Track(). Add those two lines to the User_Autonomous_Code() function, immediately after the call to Getdata(&rxdata).

You should also remove the call to Generate_Pwms() and replace it with a call to PWM(pwm13,pwm14,pwm15,pwm16) instead. Kevin's camera code uses non-twitchy interrupt-based signal generation for those pins, and calling IFI's software-based routine will cause conflicts and give unusable output.

To "turn off" the camera, just stop calling Camera_Handler() and Servo_Track() from inside Process_Data_From_Master_uP().

In any code file where you want to use printf(), you need to #include <stdio.h> at the top of the file. The camera code doesn't do that for user_routines_fast.c, so you'll have to add it yourself.
  #3   Spotlight this post!  
Unread 09-02-2007, 10:37
jdejoannis jdejoannis is offline
Registered User
FRC #1845
 
Join Date: Feb 2006
Location: Atlanta,GA
Posts: 48
jdejoannis will become famous soon enoughjdejoannis will become famous soon enough
Re: No Tracking During Autonomous

Quote:
Originally Posted by Alan Anderson View Post
To receive data from the camera, you have to call Camera_Handler(). To make the camera servos track the light, you have to call Servo_Track(). Add those two lines to the User_Autonomous_Code() function, immediately after the call to Getdata(&rxdata).
Thanks, I will try this. But I don't fully understand. After all, Process_Data_From_uP, which currently does the handling and tracking, is executed at every step regardless of mode. Why then do handling and tracking stop during autonomous mode? Oh wait! I see it now. That while loop in the User_Autonomous_Code causes it to remain there until the period is over.

Quote:
In any code file where you want to use printf(), you need to #include <stdio.h> at the top of the file. The camera code doesn't do that for user_routines_fast.c, so you'll have to add it yourself.
Oops, I overlooked that even when I #included the camera and tracking headers. Good stuff!
  #4   Spotlight this post!  
Unread 10-02-2007, 10:59
DHarris's Avatar
DHarris DHarris is offline
Professional Procrastinator
AKA: Dana McDanaface
FRC #1845 (Panthera Robotica)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Atlanta
Posts: 74
DHarris is on a distinguished road
Send a message via MSN to DHarris Send a message via Yahoo to DHarris
Re: No Tracking During Autonomous

Where does PWM() have to be?
  #5   Spotlight this post!  
Unread 10-02-2007, 14:46
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: No Tracking During Autonomous

at the end of the autonomous mode area, it calls "Generate_Pwms". REplace that with "PWM"
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
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
Reading switches during Autonomous TimeOut Programming 3 19-02-2006 16:23
How should we call camera tracking functions during autonomous mode? SHerpich Programming 1 15-02-2006 18:33
error window during tracking... Calvin LabView and Data Acquisition 1 07-02-2006 14:45
Collision avoidance during autonomous Andrew Schuetze Programming 5 17-01-2006 13:24
What do you do during autonomous mode? Salik Syed Programming 46 21-03-2004 21:05


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

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