Go to Post A constant awareness of safety is a plague I would welcome. - Alan Anderson [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #20   Spotlight this post!  
Unread 01-05-2010, 16:03
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Older FRC autonomous code

Yes, it connects to the Operator Interface at the driver controls.
I've attached a photo of a Disable/Auto switch on our '08 robot controls.
It happens to be out in my van for an appearance at the Special Olympics tomorrow.

If you want to use one of the joystick buttons to trigger it as well, the Autonomous routine can be rewritten slightly to accommodate being called two different ways. I'd prefer not to flat-out clobber the autonomous mode flag, but to structure the code such that either way will trigger the auto routine.
Had one team fail year after year on the playing field whenever a particular mentor would return every-other year to help them. Always turned out he would overwrite the autonomous mode flag with a joystick switch so the real flag would never work. It's a bad habit to start.

Maybe something along the lines of (in User_Autonomous_Code and main.c):
Code:
while (autonomous_mode || (p1_sw_trig == 1) )   /* DO NOT CHANGE! */
You'd also need to modify main.c with the same statement modification to get it to start and the joystick button would act as a dead-man switch. You'd have to hold it to keep autonomous running. Letting go would stop it.

What might be simpler for you right now is to just call an auto routine like that in post #14 directly from user_routines.c whenever the button is held down. a la,
Code:
void Process_Data_From_Master_uP(void)
{
  static unsigned char i;

  Getdata(&rxdata);   /* Get fresh data from the master microprocessor. */

    if (p1_sw_trig == 1)
    {
       Autonomous();
    }
    else 
        Default_Routine();  /* Optional.  See below. */
You don't have to be in Autonomous Mode to run some autonomous routine in teleop.

P.S. If you add a new routine like Autonomous(), depending on where you add it you may need to declare it in one of the header files (.h) so the compiler knows where to find it.
Attached Thumbnails
Click image for larger version

Name:	Kill-08-2.jpg
Views:	25
Size:	139.0 KB
ID:	9076  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 02-05-2010 at 08:09.
 


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
Autonomous 2010 FRC Drucifur Java 10 14-02-2010 08:06
FRC...autonomous or driver-controlled competition? tribotec_ca88 General Forum 28 10-03-2005 14:47
Autonomous code PBoss Programming 7 14-01-2003 15:29
Autonomous Code Adrian Wong Robotics Education and Curriculum 1 18-11-2002 22:34


All times are GMT -5. The time now is 03:47.

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