mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Since https://github.com/wpilibsuite/allwpilib/issues/786 has been closed as not a legitimate concern, there is now no reason to use IterativeRobot over TimedRobot. It's a drop-in replacement that's strictly an improvement in terms of execution jitter. To migrate, one simply has to replace the IterativeRobot subclass in their robot code with TimedRobot.
44 lines
1.4 KiB
C++
44 lines
1.4 KiB
C++
/*----------------------------------------------------------------------------*/
|
|
/* Copyright (c) 2008-2018 FIRST. 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 "frc/IterativeRobotBase.h"
|
|
|
|
namespace frc {
|
|
|
|
/**
|
|
* IterativeRobot implements the IterativeRobotBase robot program framework.
|
|
*
|
|
* The IterativeRobot class is intended to be subclassed by a user creating a
|
|
* robot program.
|
|
*
|
|
* Periodic() functions from the base class are called each time a new packet is
|
|
* received from the driver station.
|
|
*/
|
|
class IterativeRobot : public IterativeRobotBase {
|
|
public:
|
|
WPI_DEPRECATED(
|
|
"Use TimedRobot instead. It's a drop-in replacement that provides more "
|
|
"regular execution periods.")
|
|
IterativeRobot();
|
|
virtual ~IterativeRobot() = default;
|
|
|
|
IterativeRobot(IterativeRobot&&) = default;
|
|
IterativeRobot& operator=(IterativeRobot&&) = default;
|
|
|
|
/**
|
|
* Provide an alternate "main loop" via StartCompetition().
|
|
*
|
|
* This specific StartCompetition() implements "main loop" behaviour synced
|
|
* with the DS packets.
|
|
*/
|
|
void StartCompetition() override;
|
|
};
|
|
|
|
} // namespace frc
|