|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Receiving info from OI to select autonomous mode
Quote:
This is what we have added into our program for now. But my question is that...if your program in main.c checks to see if disable_mode is on before autonomous_mode won't it still be able to recieve values from the joysticks? Even if it only does it one time? Or is there some other program in the master processor somewhere that prevents this from happening if both autonomous and disable are on at start up. |
|
#2
|
|||||
|
|||||
|
Re: Receiving info from OI to select autonomous mode
ok, so if we were to put the variables for autonomus switches in the Process_data_from_local_IO section the robot would never see these numbers while autonomus is enabled. im asking this becasue this is where i have the switches now and even there they are causing trouble. the way i have it set up, is that the values are read from four swiches. they are p4_sw_trig, p4_sw_aux1, p4_sw_aux2, and p1_sw_trig(due to that whole port duplication thing).
so if i had this code in Process_data_from_local_IO if(p4_sw_trig == 0 && p4_sw_aux==0 && p4_sw_aux2== 0 && p1_sw_trig == 0) { auton_state = 0; } would these values never acutally get to the rc? ive already lost to much sleep working on the code, i really want to finish it before atlanta comes around. |
|
#3
|
|||
|
|||
|
Re: Receiving info from OI to select autonomous mode
Quote:
Just a quick reply here, but... You need to make sure you grab the state of the switches in a seperate variable BEFORE autonomous mode is enabled or else you will lose your inputs. We did this in main.c last year and we are planning on doing it again this year. An example of this can be found at http://www.osufirst.org/twiki/pub/OS...nalCode/main.c Specifically: Code:
autonomous_on = ( winchPneuSwitch == 1 ) ? 0 : autonomous_on; |
|
#4
|
|||||
|
|||||
|
Re: Receiving info from OI to select autonomous mode
Earlier this year I got to our shop early one day, and a new person interested in programming was there too. So we busted out kitbot and I decided it would be cool to write a dead reckoning code that would just make it drive really fast, then spin in place (I had never written dead reckoning code before so yeah...). The point is that I used a counter to tell it when to do what, and it incremented the counter within the autonomous section. I worried that if both my autonomous switch, and my disabled switch were on the counter would start counting early, but it did not. To me this means that if the bot is in autonomous and disabled (at least using a dongle) the autonomous code doesnt run. Now I forget why that was important to this conversation, but I do remember that it was somehow.... Oh yeah and I cant 100% garuntee that I was using the latest firmware there either.
|
|
#5
|
|||||
|
|||||
|
Re: Receiving info from OI to select autonomous mode
Quote:
So, yes it appears that it is indeed technically possible to set switches/controls on the OI prior to the start of the match, and have the RC receive the information. However, before we all rush off to implement that capability, note Question #1598 just posted on the FIRST Q&A system: Quote:
-dave |
|
#6
|
|||
|
|||
|
Re: Receiving info from OI to select autonomous mode
One method I have used for the last two years is storing data in the EEProm while in disabled mode. This way the value is there independent of whatever method they choose to use on the field. There was some code posted last year with some routines for accessing the EEProm. Just load some autonomous Variables from EEProm in the initialization area. While in disabled mode use buttons or joystick position along with a button to select the autonomous variables.
|
|
#7
|
|||
|
|||
|
Re: Receiving info from OI to select autonomous mode
Thanks, that's a big relief.
If we couldn't use the switches we set up today on the OI, I'd have to grab some jumpers and hope that the person switching them on the digital input pins wouldn't break the RC. Or I might've tried using an EEPROM module. This is a lot easier. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A little question about the autonomous mode | Anton | Programming | 4 | 18-01-2005 14:08 |
| Future of Autonomous Mode | FadyS. | Programming | 41 | 24-05-2004 19:45 |
| Blue Man Group FIRST get-together? | Gui Cavalcanti | Chit-Chat | 11 | 16-09-2003 18:11 |
| autonomous mode problem on field | Chris_C | Programming | 17 | 26-03-2003 19:11 |