No! I will not be an enabler for this madness. Go outside. See a movie. Read a book. LIVE!!!! - Herodotus [more]
 Chief Delphi autonomous sensor programming ?
 CD-Media CD-Spy
 portal register members calendar search Today's Posts Mark Forums Read FAQ rules

#1
02-10-2003, 05:28 PM
 Laura_d Registered User #0755 (Metallic Tigers) Join Date: Feb 2003 Location: Washington, KS Posts: 1
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
02-10-2003, 05:46 PM
 Skabana159 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
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

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     User Announcements FIRST     General Forum         FIRST E-Mail Blast Archive     Rumor Mill     Career     Robot Showcase Technical     Technical Discussion     Robotics Education and Curriculum     Motors     Electrical         CAN     Programming         NI LabVIEW         C/C++         Java         Python     Control System         FRC Control System         Sensors     Pneumatics     Kit & Additional Hardware     CAD         Inventor         SolidWorks         Pro ENGINEER / Creo     IT / Communications         3D Animation and Competition         Website Design/Showcase         Videography and Photography         Computer Graphics     National Instruments LabVIEW and Data Acquisition         LabView and Data Acquisition Competition     Awards         Chairman's Award     Rules/Strategy         Scouting         You Make The Call     Team Organization         Fundraising         Starting New Teams         Finding A Team         College Teams     Championship Event     Regional Competitions     District Events     Off-Season Events     Thanks and/or Congrats     FRC Game Design     OCCRA         OCCRA Q&A         OCCRA Programming Other     Unsung FIRST Heroes     Chit-Chat         Games/Trivia             Fantasy FIRST     Car Nack's Corner     College & University Education     Dean Kamen's Inventions     FIRST-related Organizations         Western Region Robotics Forum         Southern California Regional Robotics Forum         FIRST Interactive Rural SupporT         FIRST Scouting Network         FIRSTwiki         The Blue Alliance             Video Archives     FIRST In the News...     FIRST Lego League         Lego Mindstorm Discussion     FIRST Tech Challenge     VEX         VEX Robotics Competition         VEX IQ     Televised Robotics     Math and Science         NASA Discussion ChiefDelphi.com Website     CD Forum Support     Extra Discussion Old Forum Archives     1999     2000     2001

 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 04:40 AM.

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

 -- English (12 hour) -- English (24 hour) Contact Us - Chief Delphi - Rules - Archive - Top