Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Autonomous (http://www.chiefdelphi.com/forums/showthread.php?t=74256)

Whitetail Freak 12-02-2009 16:14

Autonomous
 
Does your team have three autonomous modes for each starting position on the field?

xtreampb 12-02-2009 22:34

Re: Autonomous
 
yall have inputs on your Driver Station correct. Can yall tell me how to program these when my team finally relizes that we need a few of those :rolleyes:

Redneck 13-02-2009 17:20

Re: Autonomous
 
Quote:

Originally Posted by xtreampb (Post 819662)
yall have inputs on your Driver Station correct. Can yall tell me how to program these when my team finally relizes that we need a few of those :rolleyes:

The DriverStation class has GetDigitalIn() and GetAnalogIn() functions to return those inputs. However, if you're trying to set up autonomous mode selector switches you're going to need to put them on the robot itself (connected to a digital sidecar) instead of using the DS.

Alan Anderson 14-02-2009 02:19

Re: Autonomous
 
Quote:

Originally Posted by Redneck (Post 820164)
...if you're trying to set up autonomous mode selector switches you're going to need to put them on the robot itself (connected to a digital sidecar) instead of using the DS.

No, you can use the Driver Station's inputs to select autonomous behavior. You just have to read them before Autonomous Mode begins, and save the values for use during Autonomous. (That means supplying your own RobotMain() procedure, I think.)

waialua359 14-02-2009 02:37

Re: Autonomous
 
Quote:

Originally Posted by Alan Anderson (Post 820430)
No, you can use the Driver Station's inputs to select autonomous behavior. You just have to read them before Autonomous Mode begins, and save the values for use during Autonomous. (That means supplying your own RobotMain() procedure, I think.)

Yes, and we are happy too that we didn't have to make dip switches for the different modes directly on our robot this year. :)

byteit101 14-02-2009 07:35

Re: Autonomous
 
Quote:

Originally Posted by Alan Anderson (Post 820430)
That means supplying your own RobotMain() procedure, I think.

no, you can say something like this:
Code:

class RobotDemo: public SimpleRobot
{
        DriverStation *ds;
int pos;
    public:
        RobotDemo()
        {
            ds = DriverStation::GetInstance();
            if (ds->Get...
            //switch code here and assign pos 1,2, or 3
        }

        void Autonomous()
        {
            switch(pos)
{
case 1:
              Auto1();
...
}
        }
        void Auto1()
        {

        }
        void Auto2()
        {

        }
        void Auto2()
        {

        }
}



All times are GMT -5. The time now is 02:21.

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