Go to Post your bot brings all the boys to the yard. - looneylin [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

 
View Poll Results: What automatic programs do you have?
dead reckoning (time-based) 47 51.09%
dead reckoning (other) 32 34.78%
line tracking 14 15.22%
line tracking/dead reckoning hybrid 16 17.39%
stored paths 22 23.91%
aaa! we dont have any! 9 9.78%
other/not mentioned 20 21.74%
Multiple Choice Poll. Voters: 92. You may not vote on this poll

Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 06-04-2003, 00:34
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: multiple switches

Quote:
Originally posted by rwaliany
The reason being, the robot takes x amounts longer to load when it has more code to process.
What exactly are you talking about here? The time it takes to download the code from your laptop?
Quote:
By removing and separating the programs into different files, we were able to speed up our auton from 5 seconds to 3 seconds.
Separating code into multiple files shouldn't have any effect on the time it takes your robot to drive to the top. If it does then something isn't right with the way you structured your program.
  #17   Spotlight this post!  
Unread 06-04-2003, 00:34
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
I digress.

Switches can be an effective way to implement autonomous mode if you are storing your multiple autonomous programs in multiple program slots. This is how we do it:

Code:
auto_selection 	             VAR tempvar3
	auto_select           VAR auto_selection.nib0
	auto_bit1	             VAR auto_selection.bit0
	auto_bit2	             VAR auto_selection.bit1
	auto_bit3	             VAR auto_selection.bit2


if active_button = 1 then
	auto_bit1 = auto_select0
	auto_bit2 = auto_select1
	auto_bit3 = auto_select2
endif		

if auto_button = 1 OR auton_mode = 1 then 
	
	select (auto_select)
		case 0		'joy 1
			run 2
		case 1		'joy 2
			run 3
		case 2		'joy 3
			run 4
		case 3 		'joy 4
			run 5
		case 4 		'joy 5
			run 2
		case 5		'joy 6
			run 3
		case 6                     
		                run 4
		case 7
			'do nothing... just in case :-)
	endselect	

else
	gosub operator_control
endif
And really, it works quite efficently
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net
  #18   Spotlight this post!  
Unread 06-04-2003, 00:41
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
Okay, Everytime your robot loads for the competition. IT takes time for the RC to read and interpret/tokenize the code. When I use to have four autonomous programs in the same program, it took two seconds longer to tokenize during the loading period like turning it on time.

it was structured rather similar to randomperson's

- Ryan
__________________
R
  #19   Spotlight this post!  
Unread 06-04-2003, 00:44
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Quote:
Originally posted by rwaliany
Okay, Everytime your robot loads for the competition. IT takes time for the RC to read and interpret/tokenize the code. When I use to have four autonomous programs in the same program, it took two seconds longer to tokenize during the loading period like turning it on time.
It will take longer to tokenize on the host computer and longer time to download to the robot controller. It will not take any longer on when you power the robot on or when it's executing code.
  #20   Spotlight this post!  
Unread 06-04-2003, 00:51
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
it wont? it DID, im only arguing what happened and happens to me
__________________
R
  #21   Spotlight this post!  
Unread 06-04-2003, 00:54
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
Yeah, what he said.

Actually, by loading all of your programs at once you save time because you don't have to recompile and re-load everything at run time.. all you have to do is flip a switch and voila, new program! No loading and crap.. lol, we didn't really use our laptop very much this weekend at all because of this

Idea: post your code so we can see
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net
  #22   Spotlight this post!  
Unread 06-04-2003, 00:55
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Quote:
Originally posted by rwaliany
it wont? it DID, im only arguing what happened and happens to me
Then like I said, there must be a bug or design defect in your code. The code on the robot controller does not 'load' like a program that you run on your home computer. Programs on a microcontroller like the BASIC Stamp are stored in FLASH and execute directly from that FLASH memory.

If you'd like to post the section of your code that was deciding which program to execute maybe we can help pinpoint the problem.
  #23   Spotlight this post!  
Unread 06-04-2003, 01:08
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
The code is identical to randomperson's pretty much word for word.

if it's a certain auton program (rc digital bits) then it runs x from the initialization program

I don't know, whatever. I'm just saying from experience, it runs faster for me using less slots and code (auton programs). I see your argument. I see the absurdity in it running slower. But I also see it happening to me.
__________________
R
  #24   Spotlight this post!  
Unread 07-04-2003, 11:06
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,830
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
Did your code seem to execute faster after you changed, or did it start executing your autonomous sooner?

Slower execution would probably have been due to debug statements left in the code. Depending on how efficient your debug statements are they will make your code start to miss program cycles after 2 or 3 of them.

Just a thought that might help.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #25   Spotlight this post!  
Unread 07-04-2003, 11:20
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
executed auton faster
__________________
R
  #26   Spotlight this post!  
Unread 07-04-2003, 12:10
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,830
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 still have the old code around you might try monitoring delta_t to see if it is greater than 0 while the auto code is executing. It would be easiest to simply save the greatest value delta_t reaches during loops and then either use the OI user_display_mode or a debug statement outside the auto loop after the auto finishes (so the debug slowdown isn't an issue) to display the high value.

From your description of the symptoms it sounds like the separate slot definitely had an additional delay for some reason and the new implementation doesn't have that delay.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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
pic: 103vs75 Auto CD47-Bot Extra Discussion 2 05-04-2003 18:48
picking auto program Mike375 Programming 19 03-03-2003 15:47
To all the ladies in the hiz-ous!! lol a quick question archiver 2001 1 24-06-2002 02:12
Auto CAD Stacy General Forum 7 10-09-2001 21:25


All times are GMT -5. The time now is 03:21.

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