Go to Post Enlighten a man who sometimes has difficulty understanding why others stray outside the box, when the box appears to be an optimized and elegant solution. - JVN [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-01-2004, 18:52
galewind's Avatar
galewind galewind is offline
... more like a temperate breeze
AKA: Chris Gregory
FRC #1089 (Team Mercury)
Team Role: Teacher
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Hightstown, NJ
Posts: 410
galewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond repute
Send a message via AIM to galewind
Multiple programs/autonomous routines

Being that we're no longer using banked code, is there an easy way to switch between autonomous routines using functions, or is it best to just re-download code after each match (a side-switch, for example) if we're using dead-reckoning?
__________________
Chris G
Advisor, Team Mercury (1089), Hightstown High School
  #2   Spotlight this post!  
Unread 09-01-2004, 19:07
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
Re: Multiple programs/autonomous routines

Personally, I would have a set of functions

//auton check
int program = 0;
//bit shift digital inputs to program var
doAutonomous(program);
//auton check


//misc funcs
#define REGULAR_AUTON 0

void doAutonomous(int program)
{
if (program == REGULAR_AUTON) regular_auton();
else if...
}

void regular_auton()
{
// blah regular auton
}
__________________
R
  #3   Spotlight this post!  
Unread 09-01-2004, 19:12
galewind's Avatar
galewind galewind is offline
... more like a temperate breeze
AKA: Chris Gregory
FRC #1089 (Team Mercury)
Team Role: Teacher
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Hightstown, NJ
Posts: 410
galewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond repute
Send a message via AIM to galewind
Re: Multiple programs/autonomous routines

Will the RC pick up inputs from the OI prior to the match starting so it knows which autonomous mode to use (if we used a set of digital switches at the OI to determine the autonomous code)
__________________
Chris G
Advisor, Team Mercury (1089), Hightstown High School
  #4   Spotlight this post!  
Unread 09-01-2004, 19:17
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
Re: Multiple programs/autonomous routines

I wouldn't use OI digital inputs, last year they were cleared and autonomous started with no initial communication from OI I believe. Last year, our team put digital switches on our robot and used that and it worked fine.

Programs per switch
1 2 - 0, 1
2 4 00, 01, 10, 11
3 8 000, 001, 010, 011, ...
4 16
__________________
R
  #5   Spotlight this post!  
Unread 09-01-2004, 19:21
Koci Koci is offline
Registered User
#0624 (CRyptonite)
Team Role: College Student
 
Join Date: Feb 2003
Location: Katy, TX
Posts: 62
Koci is an unknown quantity at this point
Re: Multiple programs/autonomous routines

Actually, you could use digital inputs on the OI, as there are two variables, one for autonomous, and one for competition. Communication exists between the OI and the RC, although no outputs may be changed. However, inputs can still be received.

It's better to have the controls connected to the OI, because a situation may occur where you may notice a different setup by the opposing robots (especially during finals, when you don't know which 2 robots are selected, or which side they're on), and you can change your own autonomous immediately.
__________________
2001 Highest Ranking Rookie at Lone Star Regional
2002 Imagery Award at Lone Star Regional
2003 Delphi's Driving Tomorrow's Technology Award at Arizona Regional
2003 Delphi's Driving Tomorrow's Technology Award at Lone Star Regional

Last edited by Koci : 09-01-2004 at 19:28.
  #6   Spotlight this post!  
Unread 09-01-2004, 19:34
galewind's Avatar
galewind galewind is offline
... more like a temperate breeze
AKA: Chris Gregory
FRC #1089 (Team Mercury)
Team Role: Teacher
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Hightstown, NJ
Posts: 410
galewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond repute
Send a message via AIM to galewind
Re: Multiple programs/autonomous routines

See, that's what I thought -- I knew that your outputs couldn't be changed, but I thought there was still communication and variables could be changed. that's good news to hear.
__________________
Chris G
Advisor, Team Mercury (1089), Hightstown High School
  #7   Spotlight this post!  
Unread 09-01-2004, 21:46
IrisLab's Avatar
IrisLab IrisLab is offline
Mentor
AKA: Dave Page
#1466 (Webb School)
Team Role: Mentor
 
Join Date: Dec 2003
Location: Knoxville, Tennessee
Posts: 33
IrisLab will become famous soon enough
Re: Multiple programs/autonomous routines

Quote:
Originally Posted by Koci
Actually, you could use digital inputs on the OI, as there are two variables, one for autonomous, and one for competition. Communication exists between the OI and the RC, although no outputs may be changed. However, inputs can still be received.

It's better to have the controls connected to the OI, because a situation may occur where you may notice a different setup by the opposing robots (especially during finals, when you don't know which 2 robots are selected, or which side they're on), and you can change your own autonomous immediately.

I want to make sure I understand this point. It seems very important to emphasize. I would be interested to hear more view points in particular.

So, PRIOIR TO autonomous mode (i.e. while the robot is disabled), your OI and RC are still communicating and your OI is accepting signals from its inputs and passing those along to the RC?

BUT, the RC can not change its outputs? Right? The disabled mode cancels outputs?

This seems like a critical point and I'd be interested to hear some folks chime in.



Another question, can
__________________
David Page
  #8   Spotlight this post!  
Unread 09-01-2004, 21:50
Koci Koci is offline
Registered User
#0624 (CRyptonite)
Team Role: College Student
 
Join Date: Feb 2003
Location: Katy, TX
Posts: 62
Koci is an unknown quantity at this point
Re: Multiple programs/autonomous routines

Yes, this is true. We did it last year, along with many teams. You can store a variable that is based on inputs from the OI, and that can be used during the autonomous running of the program. We had switches on our control board that were used to tell the robot which autonomous program to run. Many teams got much more complicated than we did, and had analog inputs (pots) to have many different autonomous programs.

[edit]I guess I should make references. Page 26 of the Programming Reference Guide explains the competition mode.

Quote:
When Disabled, all PWM and Relay outputs are disabled, but program execution continues.
It was explained very vividly last year in one of the updates. Just have an

if (competition_mode == 0)

and put your code there.[/edit]
__________________
2001 Highest Ranking Rookie at Lone Star Regional
2002 Imagery Award at Lone Star Regional
2003 Delphi's Driving Tomorrow's Technology Award at Arizona Regional
2003 Delphi's Driving Tomorrow's Technology Award at Lone Star Regional

Last edited by Koci : 09-01-2004 at 22:02.
  #9   Spotlight this post!  
Unread 09-01-2004, 22:02
RoboCoder RoboCoder is offline
Registered User
#1002 (Circuit Runner)
 
Join Date: Jan 2003
Location: Wheeler High School, Marietta Ga
Posts: 65
RoboCoder is on a distinguished road
Send a message via AIM to RoboCoder Send a message via Yahoo to RoboCoder
Re: Multiple programs/autonomous routines

This was functionality that FIRST made clear partway through the build season. At the beginning of the year, it was not believed that you could do this. My point? rules change. Especially year to year. Once the rules are released tomorrow, check and see if you can do this, I wouldnt count on it from the beginning without consulting the rules. If it isnt specified, then we'll just have to ask for a clarification Good luck all, and let me know if you have any further questions
__________________
You might be an Engineering Major....

if you'll assume that a "horse" is a "sphere" in order to make the math easier

if you know vector calculus but you cant remember how to do long division

if it is sunny and 70 degrees outside, and you are working on a computer
  #10   Spotlight this post!  
Unread 09-01-2004, 22:03
Damian Manda's Avatar
Damian Manda Damian Manda is offline
The Damian
no team
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Fort Collins, CO
Posts: 154
Damian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud of
Send a message via AIM to Damian Manda
Re: Multiple programs/autonomous routines

The manual has this to say in the RC Manual is this:
Quote:
Autonomous Mode means that the RC will ignore all data from the Operator Interface and it will not
require a link with the Operator Interface to execute code.
And the OI manual has this:
Quote:
Operator Interface inputs (joystick, buttons, etc.) are transmitted to the Robot Controller in their
default state(analog inputs at neutral and digital inputs disabled).
• User code is executing.
• User code input, local inputs (switches, pots, etc), including Operator Interface default inputs are
read in by the User processor.
• Robot Controller feedback is transmitted to the Operator Interface.
• For more information on programming Autonomous Mode, see the Programming Reference
Guide.
From this it seems that OI imputs will be ignored as to thier state in autonomous mode, but RC imputs will be read in as they are set. Is it true that an OI switch worked last year, as that would not seem to be that way this time?

--Damian Manda
  #11   Spotlight this post!  
Unread 09-01-2004, 22:04
Koci Koci is offline
Registered User
#0624 (CRyptonite)
Team Role: College Student
 
Join Date: Feb 2003
Location: Katy, TX
Posts: 62
Koci is an unknown quantity at this point
Re: Multiple programs/autonomous routines

Rules may change, but this is the way the software works, and FIRST cannot change that mid-season. It is stated in the reference guide that it is functional the same as last year, so unless this is a typo (it has been reworded since last year), you can be quite sure it is still available.

Prior to the game, the auton_mode is set to 0, but competition_mode is also set to 0, and there IS contact between the two. It is only once autonomous has begun that they no longer interact.
__________________
2001 Highest Ranking Rookie at Lone Star Regional
2002 Imagery Award at Lone Star Regional
2003 Delphi's Driving Tomorrow's Technology Award at Arizona Regional
2003 Delphi's Driving Tomorrow's Technology Award at Lone Star Regional
  #12   Spotlight this post!  
Unread 09-01-2004, 22:22
IrisLab's Avatar
IrisLab IrisLab is offline
Mentor
AKA: Dave Page
#1466 (Webb School)
Team Role: Mentor
 
Join Date: Dec 2003
Location: Knoxville, Tennessee
Posts: 33
IrisLab will become famous soon enough
Re: Multiple programs/autonomous routines

Quote:
Originally Posted by Damian Manda
The manual has this to say in the RC Manual is this:
And the OI manual has this:


From this it seems that OI imputs will be ignored as to thier state in autonomous mode, but RC imputs will be read in as they are set. Is it true that an OI switch worked last year, as that would not seem to be that way this time?

--Damian Manda

I think there's a point to clarify here...

I'm refering to the time before the autonomous mode when you plug your OI into the driving station and you have live link before the contest begins. I believe that a "disabled" it is set at this time.

This disabled bit keeps the bot from moving before the contest starts, right?

But, if I understand previous posts from last year, that disabled just means no output at the RC. You do however have inputs from the OI that are passed onto the RC.

IF THIS IS TRUE, then you can set an switch to designate an automous program just moments before the game begins as you are setting up your robot at the driver station.

THEN once the contest begins and autonomous mode starts, the "disable" bit becomes false, but the auotonomous bit becomes true.

Can anyone verify the above?
__________________
David Page
  #13   Spotlight this post!  
Unread 09-01-2004, 22:25
Damian Manda's Avatar
Damian Manda Damian Manda is offline
The Damian
no team
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Fort Collins, CO
Posts: 154
Damian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud of
Send a message via AIM to Damian Manda
Re: Multiple programs/autonomous routines

The manual says that there is transmission during disabled status:
Quote:
When the Disabled LED is ON solid, the Robot Controller’s PWM and RELAY outputs are disabled.
The following functions are still active when the Disabled LED is solid ON:
• Operator Interface inputs (joystick, buttons, etc.) are transmitted to the Robot Controller.
• User code is executing.
• User code input, including Operator Interface inputs and local inputs (switches, pots, etc) are
read in by the User processor.
• Robot Controller feedback is transmitted to the Operator Interface.
If the robot is in disabled before switching to autonomous then I would say that it is correct that you could transmit during that time. This seems to be the logical explanation for how this worked last year, and probably will this year too.
Closed Thread


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
Attending Multiple Regionals WakeZero General Forum 11 19-11-2003 16:23
Multiple Programs goegan31 Programming 3 17-03-2003 22:56
question for teams created among multiple high schools archiver 2001 20 24-06-2002 03:58
3 teams win multiple regionals! archiver 2000 0 23-06-2002 22:38
Proposal for 2001 - Multiple Leagues archiver 2000 2 23-06-2002 22:18


All times are GMT -5. The time now is 19:59.

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