View Full Version : Autonomous
Whitetail Freak
12-02-2009, 16:14
Does your team have three autonomous modes for each starting position on the field?
xtreampb
12-02-2009, 22:34
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:
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
...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
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
That means supplying your own RobotMain() procedure, I think.
no, you can say something like this:
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()
{
}
}
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.