Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Added Command that checks fieldPosition. #67

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package org.usfirst.frc.team2231.robot.commands;

import org.usfirst.frc.team2231.robot.FieldPositions;

import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.command.Command;

/**
*
*/
public class CheckFieldPositions extends Command {

private FieldPositions m_fieldPositions;

public CheckFieldPositions() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);

}

// Called just before this Command runs the first time
protected void initialize() {

}

// Called repeatedly when this Command is scheduled to run
protected void execute() {
String gameData = DriverStation.getInstance().getGameSpecificMessage();
m_fieldPositions = FieldPositions.createFieldPositions(gameData);
}

// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return m_fieldPositions.equals(null);
}

// Called once after isFinished returns true
protected void end() {
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
}
}