OCCRA
Go to Post It is proper to have a disagreement, but it is improper to be disrespectful. - Bill Moore [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-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 02-10-2003, 05:28 PM
Laura_d Laura_d is offline
Registered User
#0755 (Metallic Tigers)
 
Join Date: Feb 2003
Location: Washington, KS
Posts: 1
Laura_d is an unknown quantity at this point
autonomous sensor programming ?

We're trying to use three sensors to track the white line in the autonomous mode. We're using 1 joystick drive. Our left sensor is on rc_sw1, pin 1, our middle sensor is pm rc_sw2, pin 2, and the right one is on rc_sw3, pin 15. I have tried lots of different things, but since I don't really understand what I'm doing I haven't accomplished anything remotely useful, and I have managed to completely confuse myself. If anyone has any suggestions as to how to get these sensors to recognize the tape and turn and basically just WORK, I would be thrilled.
  #2   Spotlight this post!  
Unread 02-10-2003, 05:46 PM
Skabana159's Avatar
Skabana159 Skabana159 is offline
Robotics and Field Hockey
AKA: Jesse C. Owens
#0159 (Alpine Robotics)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2000
Location: Ft. Collins, CO
Posts: 92
Skabana159 is on a distinguished road
Send a message via AIM to Skabana159
What you should do in instances like this is write psuedo-code in english. You should try this:

If the middle sensor is on, then I want to go straight.
If only the left sensor is on, then I want to turn left.
If only the right sensor is on, then I want to turn right.
If no sensors are on, then spin in a circle.

Now, go on to write your code:

If (rc_sw2) then gostraight
If (rc_sw1)&(rc_sw3 = 0) then turnleft
If (rc_sw3)&(rc_sw1 = 0) then turnright
goto turnleft

gostraight:
p1_x = 127
p1_y = 200 'random forward speed, should be tested on bot
goto restofcode

turnleft:
p1_x = 84
p1_y = 127
goto restofcode

turnright:
p1_x = 200
p1_y = 127

restofcode:
...
...
...
serout ...
__________________
"What most people do not understand is that the Buddha, the Godhead, resides just as comfortably in gears and circuits as in hills and trees. To believe otherwise is to dilute the Godhead."
-Robert Pirsig, Zen and the Art of Motorcycle Maintenance
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
A better autonomous method.. randomperson Programming 4 02-24-2004 06:02 PM
Electrical componenets for autonomous navigation maclaren Electrical 10 12-18-2003 02:28 AM
crazy idea for autonomous Mike Ciance Programming 16 04-24-2003 09:50 PM
autonomous mode problem on field Chris_C Programming 17 03-26-2003 07:11 PM
Autonomous Kill Switch UCGL_Guy Programming 8 01-15-2003 05:39 PM


All times are GMT -5. The time now is 08:30 PM.

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


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