mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[wpilib] Add robot callback that is called when the DS is initially connected (#5231)
This commit is contained in:
@@ -23,6 +23,9 @@ namespace frc {
|
||||
*
|
||||
* RobotInit() -- provide for initialization at robot power-on
|
||||
*
|
||||
* DriverStationConnected() -- provide for initialization the first time the DS
|
||||
* is connected
|
||||
*
|
||||
* Init() functions -- each of the following functions is called once when the
|
||||
* appropriate mode is entered:
|
||||
*
|
||||
@@ -67,6 +70,14 @@ class IterativeRobotBase : public RobotBase {
|
||||
*/
|
||||
virtual void RobotInit();
|
||||
|
||||
/**
|
||||
* Code that needs to know the DS state should go here.
|
||||
*
|
||||
* Users should override this method for initialization that needs to occur
|
||||
* after the DS is connected, such as needing the alliance information.
|
||||
*/
|
||||
virtual void DriverStationConnected();
|
||||
|
||||
/**
|
||||
* Robot-wide simulation initialization code should go here.
|
||||
*
|
||||
@@ -242,6 +253,7 @@ class IterativeRobotBase : public RobotBase {
|
||||
Watchdog m_watchdog;
|
||||
bool m_ntFlushEnabled = true;
|
||||
bool m_lwEnabledInTest = true;
|
||||
bool m_calledDsConnected = false;
|
||||
|
||||
void PrintLoopOverrunMessage();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user