and quite possibly an intake if at all possible all posts should be to tell me yes or no and if no what to do to fix it so that my team can be almost done. ::rtm::
package org.usfirst.frc.team6051.robot;
import com.ni.vision.NIVision;
import com.ni.vision.NIVision.Image;
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
/**
*
The VM is configured to automatically run this class, and to call the
- functions corresponding to each mode, as described in the IterativeRobot
- documentation. If you change the name of this class or the package after
- creating this project, you must also update the manifest file in the resource
- directory.*/
public class Robot extends IterativeRobot {
private static final int Intake = 0;
RobotDrive myRobot;
Joystick stick;
int autoLoopCounter;
private Joystick leftstick;
private Joystick rightstick;
private GenericHID leftStick;
private GenericHID rightStick;
private Talon frontright;
private Talon frontleft;
private Talon rearright;
private Talon rearleft;
int currSession;
int sessionfront;
Image frame;
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
myRobot = new RobotDrive(0,1,2,3);
setLeftstick(new Joystick(0));
setRightstick(new Joystick(1));
frontright = new Talon(1);
frontright.set(.5);
frontleft = new Talon(2);
frontleft.set(.5);
rearright = new Talon(3);
rearright.set(.5);
rearleft = new Talon(4);
rearleft.set(.5);
frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);
sessionfront = NIVision.IMAQdxOpenCamera("cam1", NIVision.IMAQdxCameraControlMode.CameraControlModeController);
currSession = sessionfront;
NIVision.IMAQdxConfigureGrab(currSession);
}
/**
* This function is run once each time the robot enters autonomous mode
*/
public void autonomousInit() {
autoLoopCounter = 0;
myRobot.drive(0.5, 0.0);
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
if(autoLoopCounter < 100) //Check if we've completed 100 loops (approximately 2 seconds)
{
myRobot.drive(0.5, 0.0); // drive forwards half speed
autoLoopCounter++;
} else {
myRobot.drive(0.0, 0.0); // stop robot
}
}
/**
* This function is called once each time the robot enters tele-operated mode
*/
public void teleopInit(){
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
myRobot.setSafetyEnabled(true);
while (isOperatorControl() && isEnabled()) {
myRobot.tankDrive(leftStick, rightStick);
System.out.println(leftStick.getY());
System.out.println(rightStick.getY());
leftStick.getRawAxis(0);
Timer.delay(0.005) ;
LiveWindow.run();
rightStick.getPOV(Intake);
}}
/**
* This function is called periodically during test mode
*/
public void testPeriodic() {
LiveWindow.run();
}
public Joystick getLeftstick() {
return leftstick;
}
public void setLeftstick(Joystick leftstick) {
this.leftstick = leftstick;
}
public Joystick getRightstick() {
return rightstick;
}
public void setRightstick(Joystick rightstick) {
this.rightstick = rightstick;
}
}