Go to Post "Who needs finesse when you have air pressure?!" - neelpatel1710 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-03-2009, 14:28
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 03-03-2009, 14:40
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
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.
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
Reply With Quote
  #3   Spotlight this post!  
Unread 03-03-2009, 22:58
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
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
}
I know that GetAnalogIn() does not return a "float" voltage like GetVoltage() does, so auto_v_now will need scaling. The robot will use autonomousmode to select one of six modes during the autonomous period.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-03-2009, 13:40
Analog's Avatar
Analog Analog is offline
Registered User
AKA: Bob Most
FRC #2619 (The Charge)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Midland, Michigan
Posts: 53
Analog will become famous soon enoughAnalog will become famous soon enough
Re: team update #9 "Autonomous - Disabled" - what?

Quote:
Originally Posted by oddjob View Post
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
}
I know that GetAnalogIn() does not return a "float" voltage like GetVoltage() does, so auto_v_now will need scaling. The robot will use autonomousmode to select one of six modes during the autonomous period.
This should work, you're using the 6 position switch as an indicator what the start position is on the field, correct?
Reply With Quote
  #5   Spotlight this post!  
Unread 04-03-2009, 15:17
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stay in "Search-Begin" while disabled? billbo911 NI LabVIEW 1 17-02-2009 16:32
Alternative "Fix" for IR Sensor to Team Update 10 DarkJedi613 Electrical 6 16-02-2008 22:04
"TEAM in a BOX" : Shipping Update!! OZ_341 General Forum 1 02-10-2005 21:32
Help us Update "Team in a Box" OZ_341 General Forum 20 06-09-2005 01:26
Team Update #19 - "Double Play" George1902 General Forum 31 11-04-2005 01:17


All times are GMT -5. The time now is 14:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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