Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Test Autonomous Mode (http://www.chiefdelphi.com/forums/showthread.php?t=16539)

jluvera 15-01-2003 16:11

Test Autonomous Mode
 
We have fitted last year's robot with the new RC and are using the new OI so we can test while others build.

In reading the default code, I see that there is a value read in for PB_mode. Basically, I am not sure how we can test the robot in autonomous mode since we don't know how the PB_mode variable is changed. The reference guide says to set the Team number on the RC to zero. That doesn't make sense to me because I thought that number needs to be set to our team number for the competition.

I would appreciate any help.

John Luvera
Team 637

Nate Smith 15-01-2003 16:35

Take a look on IFI's web site under the Documentation section...there's instructions there as to how to create a new dongle which will let you switch autonomous mode on/off...

Jeremy_Mc 15-01-2003 16:42

autonomous mode is aliased as auton_mode in the code...

here's some code to try:

if auton_mode = 1 then do_auto_stuff
'driver code here
goto end_of_auto

do_auto_stuff:
'auto code here
end_of_auto:

put that in the main loop...

it's really basic and has no real value unless you have code to put in there...but it should help out a little


*jeremy

Lloyd Burns 15-01-2003 17:31

You can still test your auton_mode code.... even with no Dongle.

Just set auton_mode equals 1 at the start of each loop, right after the serin. In your auton_mode service area, set the variables which are digital to zero, and the analogs to 127.

Jump from the auton_mode servicing part to the Serout or to the tank drive in the USER program, so that the rest of the program won't process the auton_mode values, and let things go. If your robot resembles a hairy rabbit, pull the plug.

Make a dongle soon, though. It's fun to watch the auton_mode switch from 1 to zero when the comp_mode (Kill switch) switches from 0 to 1.

rosebud 16-01-2003 17:22

one idea is to utilize the new code. use #if and #endif to only compile and download the autonomous code or the usercode. u can make the condition a #define statement or constant that u change whenever u want to test code. of course, this wont allow u to download auto and user code and switch without dowloading again, but at least u can test code. anyone know how to download programs into slots on the rc and then run different programs in different slots? or how to free up memory that is needed in auto mode but not in user mode?

roninmedia 18-01-2003 14:09

Autonomous Mode can be turned ON by setting the RC to Team 0 (zero).

Neal Turett 19-01-2003 15:03

Work-around
 
Before we built a dongle, I just took an extra var (size = 1bit) and initialized it to 1. Then i'd have:

autom = 1

MainLoop:

if autom (my var) = 0 then endauto
if p1_sw_top = 1 then endauto

goto endmainloop:

autonomous code....

endauto:

autom = 0

normal code....

endmainloop:
serout(...)

goto mainloop:

That worked well enough, especially since it gave you a easily reachable kill-switch. Only thing to note is that if you use dead-reackoning, you need to tie the beginning of your autonomous code to another button, lest it run while the robot is disabled while the RC is not plugged in and your timer-count increase.

rbayer 19-01-2003 15:12

Re: Work-around
 
Quote:

Originally posted by Neal Turett
Only thing to note is that if you use dead-reackoning, you need to tie the beginning of your autonomous code to another button, lest it run while the robot is disabled while the RC is not plugged in and your timer-count increase.
The only problem with that is that button presses don't get sent to the RC, so it would never know about it. You are definately correct that you need a way to "start" your autonomous code, but this is best done by looking at the comp_mode bit, as its state will tell you whether you are disabled or active.

Neal Turett 19-01-2003 15:29

I was using this code before I had a dongle. The RC was always running in normal mode.

I would just flip on the bot, flip on the OI, and then hit the start button. It would still be sent. Otherwise, the robot would be counting pointlessly until the OI was flipped on, and you;'d get unpredictable results (like the robot running into a glass pane.)

Since the bot never technically entered autonomous mode, it still recieves data from the OI.


All times are GMT -5. The time now is 04:29.

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