From: EvanYap Date: Mon, 15 Feb 2016 21:42:27 +0000 (-0800) Subject: Make a getDistance() method in shooter to return value of lidar's distance from a... X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=4b29730e0f3ca76a37b2fb38222abbcd6d360b7a Make a getDistance() method in shooter to return value of lidar's distance from a target --- diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index bbbbe57b..f164ddfa 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -56,6 +56,13 @@ public class Shooter extends Subsystem { shooter.set(speed); } + // This getDistance() will return the distance using the lidar from the + // desired target during match. + public double getDistance() { + double distance = lidar.getDistance(); + return distance; + } + public void stop() { this.setSpeed(0.0); }