![]() |
Cross Mode Variables?
Do Variables carry over from autonomous to controlled and vice versa? I know they remain intact when disabled is on/off so it would stand to reason that they would carry over here as well.
Thanks |
Re: Cross Mode Variables?
It should, because between autonomous and user controlled mode, they just allow input from the OI to be read, and unset the Autonomous Mode bit, but other than that, it should be the same.
|
Re: Cross Mode Variables?
Global variables will work just as you expect. Local static variables, by design, are accessible only from within the functions they are defined in. Since the default code calls one function in teleoperated mode and a different function in autonomous mode, only global variables will be useful.
|
Re: Cross Mode Variables?
I believe that the question is 'If I update a variable, will that value be available to me in both modes?'
If you have defined a user variable, the values are NOT rewritten when modes are changed. OI related variables are cleared in the switch from user mdoe to autonomous. |
Re: Cross Mode Variables?
1 Attachment(s)
Rather than start another thread, and this one seemed pretty close.
Could folks comment on the following state diagram? We're trying to understand the flow of the game from the robot controller state perspective? Is this correct? Are there other states to be concerned with? Missing or incorrect state transitions? Thanks, DCBrown |
Re: Cross Mode Variables?
I know this sounds ignorant, but that's because it is. I got lost in that diagram about five seconds after I opened it. It could be perfectly fine, I just don't really know how to read it. :o
JBotAlan |
Re: Cross Mode Variables?
Hey this is my thread :)
It took me a second to understand that diagram, but for the most part it makes sense. I don't really think there's a disabled/autonomous mode but rather just 3 options.. -Disabled -Enabled - Autonomous -Enabled - User Control |
Re: Cross Mode Variables?
Quote:
|
Re: Cross Mode Variables?
Technically speaking, you can set it to "disabled autonomous," which as far as I know runs autonomous, but doesn't send the output out... just like in regular disabled.
|
Re: Cross Mode Variables?
Quote:
As soon as the Disabled bit is cleared, the robot runs the autonomous initialization and then runs the autonomous loop. |
Re: Cross Mode Variables?
Quote:
I'm hijacking this thread from the thread hijacker! :) I realized that in the default code, when autonomous starts, the User_Autonomous_Code (I think) enters into an infinite loop, where the Process_Data_From_Master_uP and Process_Data_From_Local_IO functions are not called. Now, I realize that I don't want to process I/O that isn't valid during auton, but all the camera initialization and tracking code is there in the functions that aren't called during auton. Do you forsee any problems with removing this loop and just processing auton every 26 ms? That's all I really need. It seemed to run fine on our system, but I don't know if there would be any issues with competition. Thanks, JBotAlan |
Re: Cross Mode Variables?
Quote:
Eldarion (above) says that autonomous holds until disable is removed. I don't know which way it is for sure. |
Re: Cross Mode Variables?
Quote:
->Disabled/not Autonomous ->Disabled/Autonomous ->Enabled/Autonomous ->Enabled/Not Autonomous |
Re: Cross Mode Variables?
Whether or not the two inputs can change simultaneously doesn't really matter here. The flags in the data packets can, and do. Regardless of the state of the autonomous input, if the disable input on the competition port is active, the robot is executing the teleoperated code, not the autonomous code.
This is true with a 2005 OI and RC, anyway. I'll discover if it's still true with the 2006 system as soon as we start scripting our autonomous routines. |
Re: Cross Mode Variables?
Quote:
It might seem esoteric, but what if you wanted to do something in the last 4 seconds of autonomous period... like gain a certain field position... to set up for manual play. Yeah, I know you might not have won the autonomous period so might be putting the robot in the WRONG position but that is part of the fun of selecting autonomous strategy. So, you'd like to know in the code how much time you have left. If you start counting when autonomous is enabled but disabled is still applied then you'd be counting time wrong. I suspect these two input changes happen very close together, but still I'd rather understand the risks associated with states we're ignoring vs get surprises during competition events. Regards, DCBrown |
| All times are GMT -5. The time now is 04:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi