From 4b29730e0f3ca76a37b2fb38222abbcd6d360b7a Mon Sep 17 00:00:00 2001 From: EvanYap Date: Mon, 15 Feb 2016 13:42:27 -0800 Subject: [PATCH] Make a getDistance() method in shooter to return value of lidar's distance from a target --- src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java | 7 +++++++ 1 file changed, 7 insertions(+) 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); } -- 2.30.2