Go to Post A link to BoardGameGeek in a FRC blog post... My worlds are colliding, and it's great! - rwodonnell [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 28-03-2003, 07:50
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,948
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
If you are doing autonomous for the first time you might want to just add some simple movements to your regular Main program.

Helping other teams at regionals I've found they understand the concepts more easily and get up and running faster if you simply add the autonomous as an override of the regular user controls. You only need to expand into multi-bank code if you need more space. We use an autonomous meta or scripting language, so a sample of our code would be counter productive if you're new to this.

The example below is for a single joystick than does 3 moves. Add or subtract moves to fit your need. The code is in the old 1.33 style in case you're modifying last years robot code.


'----------Put these in your declaration section
'These are the # of program loops that completes the movement
FIRST_LEG CON 40 '~ 1 second assuming delta_t=0
SECOND_LEG CON 200 '~5.2 seconds
THIRD_LEG CON 250 '~6.5 seconds
'The last leg you define here should not be > 577 (15 sec.)

auto_counter VAR WORD

'------------Put this before your main loop
auto_counter = 0

'-----------Put this immediately after your Serin command
' We are just overriding the joystick values as if the driver were moving the joystick

IF auto_mode = 0 then NoAuto
auto_counter = auto_counter + 1
'Can also do: auto_counter = auto_counter + 1 + delta_t

If auto_counter >= FIRST_LEG then LEG2
'These values should be what your driver would normally do with the joystick to accomplish what you want to do
p1_x = 254
p1_y = 0
Goto NoAuto

LEG2:
If auto_counter >= SECOND_LEG then LEG3
p1_x = 254
p1_y = 0
Goto NoAuto

LEG3:
If auto_counter >= THIRD_LEG then NoAuto
'Make sure you come to a stop as the last LEG
p1_x = 127
p1_y = 127
Goto NoAuto

NoAuto:

'------------The rest of your regular code

(BTW: This was indented for readability when I typed it in)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 28-03-2003 at 08:40.
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
26 variable limit Gusman1188 Programming 9 12-02-2003 22:38
Coupling the Chiaphua & a variable Drill output Jeff Sharpe Motors 9 13-01-2003 20:21
Variable Amperage in DC Circuit. How? Jordan A. Electrical 4 01-11-2002 20:26
Dashboard programs and the char variable Ian W. Programming 13 26-06-2002 02:07
what teams have a variable transmissions? Greg Perkins Technical Discussion 4 06-03-2002 06:10


All times are GMT -5. The time now is 07:35.

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