Go to Post With computers, every once in a while you see something that makes you think "I could have done this, why didn't I think of it? It would have made my life so much easier." Now is one of those times. - Nadav Zingerman [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 04-02-2005, 20:38
schenkin schenkin is offline
Registered User
#0486
 
Join Date: Jan 2005
Location: Strath Haven High School
Posts: 17
schenkin is on a distinguished road
Autonomous With Camera

So, weve gotten tracking working just like everyone else here. I am trying to figure out how to move what we have in the normal mode to autonomous. Below are things I have to consider:

1. Setting which color we should use for tracking
2. Which functions must be called on in order for tracking to work properly


Has anyone gotten this to work properly? It seems to me that If i copy all the stuff in Default_Routine() function to the Default_Routine_Fast() function it should work. This means the following code:

camera_find_color(color) // Tells is what color to start tracking

and


if (p1_sw_trig > 0 && tracking > 0) { //If vision active and tracking use camera data
p1_y = speed_control; //set forward speed
p1_x = pan_position; //set turning rate
p1_x = 255 - p1_x; //invert turn direction
// Steering Compensation
if (p1_x > 135 && p1_x < 225 && steering_comp > 0)
p1_x = p1_x + steering_comp;
if (p1_x < 120 && p1_x > steering_comp && steering_comp > 0)
p1_x = p1_x - steering_comp;
pwm11 = Limit_Mix(2000 + ramp_y() + ramp_x() - 127); //uses our ramp
pwm12 = Limit_Mix(2000 + ramp_y() - ramp_x() + 127); //uses our ramp


Had anyone done this? I just wanted to share my thoughts.


--Sam
--Team 486
--Positronic Panthers
--Gotrobot.org



EDIT:

I just had a thought. Since the code to pick your color isn't in the Default_Routine() function, it is always running, even when the robot is disabled. This means that another way you can work setting up the camera is by mimicking the button controls. For instance:

I don't think i'll do this for changing the colors (it'll start looking for each color in turn), but it might be useful for the other functions. An important thing to remember is that there is no need to change the output variable when you can change the input one!

Last edited by schenkin : 04-02-2005 at 20:47.
 


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
Unresponsive camera neilsonster Programming 9 17-02-2005 08:51
CMUCam2 Camera Code - Are important parts commented out? Mr. Lim Programming 4 14-01-2005 12:11
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11


All times are GMT -5. The time now is 21:05.

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