Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Using throttle to manipulate Autonomous Mode (http://www.chiefdelphi.com/forums/showthread.php?t=103388)

ehochstein 20-02-2012 12:30

Using throttle to manipulate Autonomous Mode
 
1 Attachment(s)
I am attempting to help the students code in multiple autonomous modes for multiple different positions. We are currently testing two different ones and ran into a problem. Whenever we enable it tries to do both autonomous modes and kind of 'jumps' around. Are we doing something wrong?

Pirate programe 20-02-2012 12:34

Re: Using throttle to manipulate Autonomous Mode
 
Are the conditional terminals in the while loop set to Stop If True, or Continue If True?

If they're set to Stop, then that means that the while loop will run when the throttle isn't at 1/-1, which is the opposite of what you want.

ehochstein 20-02-2012 12:39

Re: Using throttle to manipulate Autonomous Mode
 
Ah, I see got it now... I knew it was something simple, we'll be testing it in a few minutes hopefully it will work now. Thanks!

rzoeller 20-02-2012 12:40

Re: Using throttle to manipulate Autonomous Mode
 
This may not be what your looking for, but we have found it easier to use inputs from the Driver Station itself instead of a joystick. It allows you to set multiple autonomi up and accurately pick which one to use, instead of relying on a throttle which may get bumped.

tilky 20-02-2012 14:56

Re: Using throttle to manipulate Autonomous Mode
 
instead of using axis=1 or axis=-1, use axis>0 and axis<0. It is (almost???) impossible to get it at exactly 1, so both would be false, meaning that both would run

Greg McKaskle 20-02-2012 20:15

Re: Using throttle to manipulate Autonomous Mode
 
The other comments will improve the code, but you will still find an odd jerk at the beginning as the while loops will both run at least once. You may find it even a bit better to surround the loop with a case statement and change the loops to run forever. The case can be the Boolean results of the compare, or you convert it to an enum or integer using scaling, and put the code in various frames of the case.

Greg McKaskle

MAldridge 20-02-2012 20:54

Re: Using throttle to manipulate Autonomous Mode
 
That has got to be the most creative use of the while loop I have ever seen! I would suggest that, since has already been mentioned, you put your code into a case structure, and you use the DS switches wired into a build array. Then you can do a boolean array to number and have up to 2^8 autonomous modes!


All times are GMT -5. The time now is 11:15.

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