mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
Update to 2018_v4 image and new build system. (#598)
* Revert "Force OpenCV to 3.1.0 (#602)"
This reverts commit 50ed55e8e2.
* Removes Simulation
* Removes old build system
* Removes old gtest
* Adds new gmock and gtest
* Updates to new ni-libraries
* removes MyRobot (to be replaced)
* moves files to new location
* Adds new sim backend and new test executables
* updates .styleguide and .gitignore
* Changes cpp WPILibVersion to a function
MSVC throws an AV with the old version.
* Disables USBCamera on all systems except for linux
* 2018 NI Libraries
* New build system
This commit is contained in:
committed by
Peter Johnson
parent
50ed55e8e2
commit
e1195e8b9d
69
wpilibc/src/main/native/include/IterativeRobotBase.h
Normal file
69
wpilibc/src/main/native/include/IterativeRobotBase.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RobotBase.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
/**
|
||||
* IterativeRobotBase implements a specific type of robot program framework,
|
||||
* extending the RobotBase class.
|
||||
*
|
||||
* The IterativeRobotBase class does not implement StartCompetition(), so it
|
||||
* should not be used by teams directly.
|
||||
*
|
||||
* This class provides the following functions which are called by the main
|
||||
* loop, StartCompetition(), at the appropriate times:
|
||||
*
|
||||
* RobotInit() -- provide for initialization at robot power-on
|
||||
*
|
||||
* Init() functions -- each of the following functions is called once when the
|
||||
* appropriate mode is entered:
|
||||
* - DisabledInit() -- called only when first disabled
|
||||
* - AutonomousInit() -- called each and every time autonomous is entered from
|
||||
* another mode
|
||||
* - TeleopInit() -- called each and every time teleop is entered from
|
||||
* another mode
|
||||
* - TestInit() -- called each and every time test is entered from
|
||||
* another mode
|
||||
*
|
||||
* Periodic() functions -- each of these functions is called on an interval:
|
||||
* - RobotPeriodic()
|
||||
* - DisabledPeriodic()
|
||||
* - AutonomousPeriodic()
|
||||
* - TeleopPeriodic()
|
||||
* - TestPeriodic()
|
||||
*/
|
||||
class IterativeRobotBase : public RobotBase {
|
||||
public:
|
||||
virtual void RobotInit();
|
||||
virtual void DisabledInit();
|
||||
virtual void AutonomousInit();
|
||||
virtual void TeleopInit();
|
||||
virtual void TestInit();
|
||||
|
||||
virtual void RobotPeriodic();
|
||||
virtual void DisabledPeriodic();
|
||||
virtual void AutonomousPeriodic();
|
||||
virtual void TeleopPeriodic();
|
||||
virtual void TestPeriodic();
|
||||
|
||||
protected:
|
||||
IterativeRobotBase();
|
||||
virtual ~IterativeRobotBase() = default;
|
||||
|
||||
void LoopFunc();
|
||||
|
||||
private:
|
||||
enum class Mode { kNone, kDisabled, kAutonomous, kTeleop, kTest };
|
||||
|
||||
Mode m_lastMode = Mode::kNone;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
Reference in New Issue
Block a user