Go to Post Besides, if you look back on anything you've already made and can't find any flaws that can be improved, you're doing it wrong. - artdutra04 [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
  #16   Spotlight this post!  
Unread 27-02-2006, 08:34
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: EasyC autonomous modes

All I can say is too cool, too elegant, and too late at night.

Thanks for fixing the example.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #17   Spotlight this post!  
Unread 09-03-2006, 15:15
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
Re: EasyC autonomous modes

Can't you also just put a couple of switches right on the robot using the digital in ports. That way they can be read right at the begining of autonomous mode. Rather than risking getting stuck. This is what my team plans on doing. Hopefully it won't have too many bugs to have to deal with.
  #18   Spotlight this post!  
Unread 09-03-2006, 17:03
Dillon Compton Dillon Compton is offline
Jack-Of-All-Trades
FRC #1391 (Metal Moose)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Malvern, PA
Posts: 186
Dillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud of
Send a message via AIM to Dillon Compton
Re: EasyC autonomous modes

Quote:
Originally Posted by JJMax7
Can't you also just put a couple of switches right on the robot using the digital in ports. That way they can be read right at the begining of autonomous mode. Rather than risking getting stuck. This is what my team plans on doing. Hopefully it won't have too many bugs to have to deal with.
That should also be fine JJ- I prefer having the auton. mode set at the OI, but either way will work, provided the code is properly written.
__________________
www.metalmoose.com
  #19   Spotlight this post!  
Unread 09-03-2006, 19:00
Dad1279 Dad1279 is offline
Registered User
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: NJ
Posts: 511
Dad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud of
Re: EasyC autonomous modes

Quote:
Originally Posted by JJMax7
Can't you also just put a couple of switches right on the robot using the digital in ports. That way they can be read right at the begining of autonomous mode. Rather than risking getting stuck. This is what my team plans on doing. Hopefully it won't have too many bugs to have to deal with.
To keep it simple, and use only one port, we use a radio shack 6 position switch, with 5 resistors as dividers connected to an analog input on the RC.
  #20   Spotlight this post!  
Unread 06-04-2006, 12:09
Dillon Compton Dillon Compton is offline
Jack-Of-All-Trades
FRC #1391 (Metal Moose)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Malvern, PA
Posts: 186
Dillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud of
Send a message via AIM to Dillon Compton
Re: EasyC autonomous modes

Hmm. I attempted to use the code on the first page, after all the bugs were worked out and all, and it wont display to my userbyte on the OI- any ideas?
__________________
www.metalmoose.com
  #21   Spotlight this post!  
Unread 06-04-2006, 17:43
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: EasyC autonomous modes

Quote:
Originally Posted by Dillon Compton
Hmm. I attempted to use the code on the first page, after all the bugs were worked out and all, and it wont display to my userbyte on the OI- any ideas?
Well my final version worked ok so here it is:

Code:
while ( !IsEnabled() )
      {
            p4_trig = GetOIDInput ( 4 , 1 ) ;
            if ( p4_trig )
            {
                  if ( autoProgram < 8 )
                  {
                        autoProgram ++ ;
                  }
                  else
                  {
                        autoProgram = 0 ;
                  }
                  while ( p4_trig )
                  {
                        p4_trig = GetOIDInput ( 4 , 1 ) ;
                  }
            }
            SetUserDisplay ( autoProgram ) ;
      }
Uh, just to ask a dumb question: Did you switch the OI to u-mode? I'm sure you did, just checking though. Also make sure the variable "autoProgram" is set as a global unsigned char.

Last edited by TubaMorg : 06-04-2006 at 17:53.
  #22   Spotlight this post!  
Unread 07-04-2006, 13:19
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: EasyC autonomous modes

IS the OI set in the correct mode. Eg when you get set to user mode it should
first display u012 then u000 until you chage modes.
  #23   Spotlight this post!  
Unread 09-04-2006, 11:24
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,611
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: EasyC autonomous modes

When configuring globals to be either on or off (i.e. only two conditions) such as the "isEnabled" global mentioned above. You might want to instead use a

#define ISENABLED 1 // instead of defining a global

//later in the program put
#ifdef ISENABLED
//put autonomous code here
#endif

This page is a good tutorial on using MACROS, http://vergil.chemistry.gatech.edu/r...al/basic2.html
__________________
History: 624 - Cryptonite --> 118 - Robonauts --> 2158 - AusTIN CANS --> 2587 DiscoBots
Bio: Andrew Lynch "How I Work" ---- LinkedIn , Facebook, Twitter

Last edited by lynca : 09-04-2006 at 11:27.
  #24   Spotlight this post!  
Unread 09-04-2006, 13:13
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: EasyC autonomous modes

Quote:
Originally Posted by lynca
When configuring globals to be either on or off (i.e. only two conditions) such as the "isEnabled" global mentioned above. You might want to instead use a

#define ISENABLED 1 // instead of defining a global

//later in the program put
#ifdef ISENABLED
//put autonomous code here
#endif

This page is a good tutorial on using MACROS, http://vergil.chemistry.gatech.edu/r...al/basic2.html
Pretty good advice if not using EasyC, which is what this discussion is about.
  #25   Spotlight this post!  
Unread 12-04-2006, 01:06
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Re: EasyC autonomous modes

I believe that all your creative solutions using !IsEnabled() are actually moot.

Input from the competition port overrides code loops. In other words, even if you have a while(1) in your autonomous code, when your dongle (or whoever's running the match) switches off autonomous, your code drops whatever it's doing, and the Operator Control code starts.

Our code has a while(1) in Autonomous() and it works fine. I can't remember if I've tried it in Initialize(), but I have every reason to think it should work the same. Still, test it with a dongle, just to be triple sure.


On the other hand, the simple way (the way I used) is to have a switch (or several, or an analog input as described above), set it before you power on the bot, and just read it once (no loops).
  #26   Spotlight this post!  
Unread 12-04-2006, 22:53
Dillon Compton Dillon Compton is offline
Jack-Of-All-Trades
FRC #1391 (Metal Moose)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Malvern, PA
Posts: 186
Dillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud of
Send a message via AIM to Dillon Compton
Re: EasyC autonomous modes

The advantage to this is that it allows us to use the pre-existing joystick; something I much prefer. I got this working on last years robot, so it should be fine; no reason to mess with the safety measures in place- redundancy is my friend. I'd rather have something I know that I wrote backing it up than mystical field-happenings.

Thanks for the info, nonetheless.
__________________
www.metalmoose.com
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
White Paper Discuss: C Programming and Autonomous Modes for Newbies cbolin Extra Discussion 3 09-01-2008 19:32
Rookie autonomous modes StephLee General Forum 6 30-04-2005 13:16
Question about switching autonomous modes DemonYawgmoth Programming 2 23-03-2005 17:02
Alternative autonomous modes Jon Reese Programming 1 14-01-2004 13:17


All times are GMT -5. The time now is 10:30.

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