|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
team update #9 "Autonomous - Disabled" - what?
I'm looking at the public member functions for IterativeRobot:
StartCompetition () RobotInit () DisabledInit () AutonomousInit () TeleopInit () DisabledPeriodic () AutonomousPeriodic () TeleopPeriodic () DisabledContinuous () AutonomousContinuous () TeleopContinuous () When the team update refers to "Autonomous - Disabled", which member function is that? There isn't an AutonomousDisabled() function. I'm wondering where to put the code to read DriverStation switches to select modes for autonomous. |
|
#2
|
||||
|
||||
|
Re: team update #9 "Autonomous - Disabled" - what?
The are two modes: Autonomous and Teleop. During each of the modes, the robot can be either Enabled or Disabled. This leads to four states:
Autonomous/Disabled Autonomous/Enabled Teleop/Disabled Teleop/Enabled IterativeRobot will call the DisabledContinuous and DisabledPeriodic functions whenever the robot is in a disabled state, regardless whether it is in Autonomous or Teleop. The others are called only when the robot is Enabled. You should read your switches in one of the Disabled routines, as they will not be available to read in Autonomous/Enabled. |
|
#3
|
|||
|
|||
|
Re: team update #9 "Autonomous - Disabled" - what?
Our robot has a six position switch on a DriverStation analog input, configured to read out 0V, 1V, 2V, 3V, 4V or 5V. I think this will work, can't test it until the regional:
Code:
static int auto_v = 0;
static int autonomousmode = 0;
void DisabledPeriodic(void) {
int auto_v_now;
auto_v_now = ((int)((m_ds->GetAnalogIn(1))+0.5)) + 1;
if(auto_v_now == auto_v)
{
autonomousmode = auto_v; // only shift when equal (stable voltage)
}
auto_v = auto_v_now; // always update current state
}
|
|
#4
|
||||
|
||||
|
Re: team update #9 "Autonomous - Disabled" - what?
Quote:
|
|
#5
|
|||
|
|||
|
Re: team update #9 "Autonomous - Disabled" - what?
Yes. It's a single (12 way?) rotary switch and we're using 6 positions. Originally the switch was wired to six digital inputs but we later needed those for other functions and reworked the switch to read out 6 different analog voltages. It will be tested tomorrow at Rochester NY. I've read here that on the last pass through the Disabled code it can report bad data on the DriverStation inputs, hence the slightly more complicated code.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stay in "Search-Begin" while disabled? | billbo911 | NI LabVIEW | 1 | 02-17-2009 04:32 PM |
| Alternative "Fix" for IR Sensor to Team Update 10 | DarkJedi613 | Electrical | 6 | 02-16-2008 10:04 PM |
| "TEAM in a BOX" : Shipping Update!! | OZ_341 | General Forum | 1 | 10-02-2005 09:32 PM |
| Help us Update "Team in a Box" | OZ_341 | General Forum | 20 | 09-06-2005 01:26 AM |
| Team Update #19 - "Double Play" | George1902 | General Forum | 31 | 04-11-2005 01:17 AM |