|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
|||
|
|||
|
Re: Vision
Thanks. Does this command work with it?
package org.usfirst.frc.team1025.robot.commands; import org.usfirst.frc.team1025.robot.Robot; import org.usfirst.frc.team1025.robot.subsystems.Vision; import edu.wpi.first.wpilibj.command.Command; /** * */ public class VisionAuton extends Command { double centerX; public VisionAuton() { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); requires(Robot.visionSubsystem); requires(Robot.ChassisSubsystem); } // Called just before this Command runs the first time protected void initialize() { } // Called repeatedly when this Command is scheduled to run protected void execute() { synchronized (Robot.visionSubsystem.imgLock) { Robot.visionSubsystem.centerX = this.centerX; } double Turn = centerX - (Vision.IMG_WIDTH / 2 ); // ask // Robot.chassisSubsystem.SimpleDrive(leftSpeed, rightSpeed); Robot.ChassisSubsystem.getRobotDrive().arcadeDrive (-0.6, Turn * 0.005); } // Make this return true when this Command no longer needs to run execute() protected boolean isFinished() { return false; } // 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() { } } |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|