-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestVision.java
50 lines (41 loc) · 1.41 KB
/
TestVision.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.usfirst.frc.team4541.robot.commands;
import org.usfirst.frc.team4541.robot.RobotLocation;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/**
* This command is a test to see if we can calculate the X and Y distance to the visual targets
*
* */
public class TestVision extends Command {
public TestVision() {
//requires(null);
}
// Called just before this Command runs the first time
@Override
protected void initialize() {
SmartDashboard.putBoolean("Test Vision Enabled", true);
}
protected void execute(){
// write the location data to the controller and read the motor data
// Get the current Robot Location */
RobotLocation.getRobotLocation(0);
SmartDashboard.putNumber("Robot X Location", RobotLocation.xlocation_robot);
SmartDashboard.putNumber("Robot Y Location", RobotLocation.ylocation_robot);
SmartDashboard.putNumber("Robot R Location", RobotLocation.rlocation_robot);
// Adjust the PID controller for coarse or fine adjustment
}
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return false ;
}
// Called once after isFinished returns true
@Override
protected void end() {
SmartDashboard.putBoolean("Test Vision Enabled", false);
}
}