From c98f54dbbcc2cf806f34a58ad9658ac4844c8d97 Mon Sep 17 00:00:00 2001 From: Joe Ross Date: Sun, 23 Nov 2014 18:47:00 -0800 Subject: [PATCH] match templates with robot builder. Change-Id: Iedb8b9efc58ca73bc654b119d5d1aed5b4eb5553 --- .../resources/templates/command-based/Robot.cpp | 6 ++++-- .../resources/templates/command-based/Robot.java | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp index 90d48b3446..9fdbad39aa 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp @@ -23,7 +23,8 @@ private: void AutonomousInit() { - autonomousCommand->Start(); + if (autonomousCommand != NULL) + autonomousCommand->Start(); } void AutonomousPeriodic() @@ -37,7 +38,8 @@ private: // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. - autonomousCommand->Cancel(); + if (autonomousCommand != NULL) + autonomousCommand->Cancel(); } void TeleopPeriodic() diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.java/resources/templates/command-based/Robot.java b/eclipse-plugins/edu.wpi.first.wpilib.plugins.java/resources/templates/command-based/Robot.java index a4f7cf664b..8d0fbe7dba 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.java/resources/templates/command-based/Robot.java +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.java/resources/templates/command-based/Robot.java @@ -38,7 +38,7 @@ public class Robot extends IterativeRobot { public void autonomousInit() { // schedule the autonomous command (example) - autonomousCommand.start(); + if (autonomousCommand != null) autonomousCommand.start(); } /** @@ -53,7 +53,7 @@ public class Robot extends IterativeRobot { // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. - autonomousCommand.cancel(); + if (autonomousCommand != null) autonomousCommand.cancel(); } /**