Thread: variable?
View Single Post
  #9   Spotlight this post!  
Unread 31-03-2003, 09:18
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,710
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
Thanks for the proper vb tags Greg. I went and read up on the vb Code help after you pointed that out.

Doug,

Here's an example of what one of our autonomous program scripts looks like. We don't recode as in my beginners example above, but we change the script instead. It makes it simpler to change the autonomous movements quickly with less risk of introducing coding errors. We have a graphical interface where you drag and click the cursor on an image of the playing field where you want the robot to go and the script gets generated automatically. When each command is executed a subroutine specific to that command does the proper setup and it gets submitted to a master control routine.

The basic command format is: COMMAND, SPEED, DISTANCE
These values are defined constants. Other commands have some variation on the arguments, for instance, some commands have "on/off" arguments and the arm commands are really POT readings.

Code:
'Basic ramp attack

LeftProg  Data CmdFrwd, SpdFull,  25	'Pull out 
	 Data CmdRght,  SpdFull, 40	'Move in front of ramp
	 Data CmdOpen, SpdFull, 10	'Open arms
 	 Data CmdArmB, SpdFull,  50	'Drop arm
	 Data CmdBack,  SpdFull, 130	'Up ramp
	 Data CmdStop,  SpdStop, 1	'Come to a stop

LeftMax  CON 6   'Auto sequence Maximum entries is 255

RghtProg  Data CmdFrwd, SpdFull,  25	'Pull out	 
	 Data CmdLeft,   SpdFull, 40	'Move in front of ramp
	 Data CmdOpen, SpdFull, 10	'Open arms
 	 Data CmdArmB, SpdFull,  50	'Drop arm
	 Data CmdBack,  SpdFull, 130	'Up ramp
	 Data CmdStop,  SpdStop, 1	'Come to a stop

RghtMax  CON 6   'Auto sequence Maximum entries is 255
The commands are stored in EEPROM by the DATA statement and READ in sequence like a script.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 31-03-2003 at 09:41.