diff --git a/wpilibcExamples/src/main/cpp/templates/iterative/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/iterative/cpp/Robot.cpp deleted file mode 100644 index 942fc9a922..0000000000 --- a/wpilibcExamples/src/main/cpp/templates/iterative/cpp/Robot.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2017-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. */ -/*----------------------------------------------------------------------------*/ - -#include "Robot.h" - -#include - -#include - -void Robot::RobotInit() { - m_chooser.SetDefaultOption(kAutoNameDefault, kAutoNameDefault); - m_chooser.AddOption(kAutoNameCustom, kAutoNameCustom); - frc::SmartDashboard::PutData("Auto Modes", &m_chooser); -} - -/** - * This function is called every robot packet, no matter the mode. Use - * this for items like diagnostics that you want ran during disabled, - * autonomous, teleoperated and test. - * - *

This runs after the mode specific periodic functions, but before - * LiveWindow and SmartDashboard integrated updating. - */ -void Robot::RobotPeriodic() {} - -/** - * This autonomous (along with the chooser code above) shows how to select - * between different autonomous modes using the dashboard. The sendable chooser - * code works with the Java SmartDashboard. If you prefer the LabVIEW Dashboard, - * remove all of the chooser code and uncomment the GetString line to get the - * auto name from the text box below the Gyro. - * - * You can add additional auto modes by adding additional comparisons to the - * if-else structure below with additional strings. If using the SendableChooser - * make sure to add them to the chooser code above as well. - */ -void Robot::AutonomousInit() { - m_autoSelected = m_chooser.GetSelected(); - // m_autoSelected = SmartDashboard::GetString( - // "Auto Selector", kAutoNameDefault); - std::cout << "Auto selected: " << m_autoSelected << std::endl; - - if (m_autoSelected == kAutoNameCustom) { - // Custom Auto goes here - } else { - // Default Auto goes here - } -} - -void Robot::AutonomousPeriodic() { - if (m_autoSelected == kAutoNameCustom) { - // Custom Auto goes here - } else { - // Default Auto goes here - } -} - -void Robot::TeleopInit() {} - -void Robot::TeleopPeriodic() {} - -void Robot::TestPeriodic() {} - -#ifndef RUNNING_FRC_TESTS -int main() { return frc::StartRobot(); } -#endif diff --git a/wpilibcExamples/src/main/cpp/templates/iterative/include/Robot.h b/wpilibcExamples/src/main/cpp/templates/iterative/include/Robot.h deleted file mode 100644 index 2c70b8f254..0000000000 --- a/wpilibcExamples/src/main/cpp/templates/iterative/include/Robot.h +++ /dev/null @@ -1,30 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2017-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 - -#include -#include - -class Robot : public frc::IterativeRobot { - public: - void RobotInit() override; - void RobotPeriodic() override; - void AutonomousInit() override; - void AutonomousPeriodic() override; - void TeleopInit() override; - void TeleopPeriodic() override; - void TestPeriodic() override; - - private: - frc::SendableChooser m_chooser; - const std::string kAutoNameDefault = "Default"; - const std::string kAutoNameCustom = "My Auto"; - std::string m_autoSelected; -}; diff --git a/wpilibcExamples/src/main/cpp/templates/templates.json b/wpilibcExamples/src/main/cpp/templates/templates.json index 71798c9ece..c220fbc3d0 100644 --- a/wpilibcExamples/src/main/cpp/templates/templates.json +++ b/wpilibcExamples/src/main/cpp/templates/templates.json @@ -1,13 +1,4 @@ [ - { - "name": "Iterative Robot", - "description": "Iterative style", - "tags": [ - "Iterative" - ], - "foldername": "iterative", - "gradlebase": "cpp" - }, { "name": "Timed Robot", "description": "Timed style", diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Main.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Main.java deleted file mode 100644 index d7f6e265b2..0000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Main.java +++ /dev/null @@ -1,29 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 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. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.templates.iterative; - -import edu.wpi.first.wpilibj.RobotBase; - -/** - * Do NOT add any static variables to this class, or any initialization at all. - * Unless you know what you are doing, do not modify this file except to - * change the parameter class to the startRobot call. - */ -public final class Main { - private Main() { - } - - /** - * Main initialization function. Do not perform any initialization here. - * - *

If you change your main robot class, change the parameter type. - */ - public static void main(String... args) { - RobotBase.startRobot(Robot::new); - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java deleted file mode 100644 index 630be9a4d7..0000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java +++ /dev/null @@ -1,99 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2017-2019 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. */ -/*----------------------------------------------------------------------------*/ - -package edu.wpi.first.wpilibj.templates.iterative; - -import edu.wpi.first.wpilibj.IterativeRobot; -import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; - -/** - * The VM is configured to automatically run this class, and to call the - * functions corresponding to each mode, as described in the IterativeRobot - * documentation. If you change the name of this class or the package after - * creating this project, you must also update the build.gradle file in the - * project. - */ -@SuppressWarnings("deprecation") -public class Robot extends IterativeRobot { - private static final String kDefaultAuto = "Default"; - private static final String kCustomAuto = "My Auto"; - private String m_autoSelected; - private final SendableChooser m_chooser = new SendableChooser<>(); - - /** - * This function is run when the robot is first started up and should be - * used for any initialization code. - */ - @Override - public void robotInit() { - m_chooser.setDefaultOption("Default Auto", kDefaultAuto); - m_chooser.addOption("My Auto", kCustomAuto); - SmartDashboard.putData("Auto choices", m_chooser); - } - - /** - * This function is called every robot packet, no matter the mode. Use - * this for items like diagnostics that you want ran during disabled, - * autonomous, teleoperated and test. - * - *

This runs after the mode specific periodic functions, but before - * LiveWindow and SmartDashboard integrated updating. - */ - @Override - public void robotPeriodic() { - } - - /** - * This autonomous (along with the chooser code above) shows how to select - * between different autonomous modes using the dashboard. The sendable - * chooser code works with the Java SmartDashboard. If you prefer the - * LabVIEW Dashboard, remove all of the chooser code and uncomment the - * getString line to get the auto name from the text box below the Gyro - * - *

You can add additional auto modes by adding additional comparisons to - * the switch structure below with additional strings. If using the - * SendableChooser make sure to add them to the chooser code above as well. - */ - @Override - public void autonomousInit() { - m_autoSelected = m_chooser.getSelected(); - // autoSelected = SmartDashboard.getString("Auto Selector", - // defaultAuto); - System.out.println("Auto selected: " + m_autoSelected); - } - - /** - * This function is called periodically during autonomous. - */ - @Override - public void autonomousPeriodic() { - switch (m_autoSelected) { - case kCustomAuto: - // Put custom auto code here - break; - case kDefaultAuto: - default: - // Put default auto code here - break; - } - } - - /** - * This function is called periodically during operator control. - */ - @Override - public void teleopPeriodic() { - } - - /** - * This function is called periodically during test mode. - */ - @Override - public void testPeriodic() { - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/templates.json b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/templates.json index e4dbc1d3c2..ded6e3d079 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/templates.json +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/templates.json @@ -1,14 +1,4 @@ [ - { - "name": "Iterative Robot", - "description": "Iterative style", - "tags": [ - "Iterative" - ], - "foldername": "iterative", - "gradlebase": "java", - "mainclass": "Main" - }, { "name": "Timed Robot", "description": "Timed style",