Go to Post It is an honor and a privilege to be associated with such an outstanding group of people. And Arefin. - Gary Dillard [more]
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 02-10-2003, 04: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, 04: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

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

p1_x = 84
p1_y = 127
goto restofcode

p1_x = 200
p1_y = 127

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 05:02 PM
Electrical componenets for autonomous navigation maclaren Electrical 10 12-18-2003 01:28 AM
crazy idea for autonomous Mike Ciance Programming 16 04-24-2003 08:50 PM
autonomous mode problem on field Chris_C Programming 17 03-26-2003 06:11 PM
Autonomous Kill Switch UCGL_Guy Programming 8 01-15-2003 04:39 PM

All times are GMT -5. The time now is 09:13 AM.

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

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