
05-11-2016, 11:26
|
|
Registered User
 FRC #2989
|
|
Join Date: Nov 2016
Location: Minnesota
Posts: 1
|
|
|
Re: No Robot Code Driver station
Quote:
Originally Posted by Yildirim
DriveTrain(subsystem):
package org.usfirst.frc6429.NewDimension.subsystems;
import org.usfirst.frc6429.NewDimension.RobotMap;
import org.usfirst.frc6429.NewDimension.commands.*;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.VictorSP;
import edu.wpi.first.wpilibj.command.Subsystem;
/**
*
*/
public class DriveTrain extends Subsystem {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
private final SpeedController rightFrontMotor = RobotMap.driveTrainRightFrontMotor;
private final SpeedController rightRearMotor = RobotMap.driveTrainRightRearMotor;
private final SpeedController leftFrontMotor = RobotMap.driveTrainLeftFrontMotor;
private final SpeedController leftRearMotor = RobotMap.driveTrainLeftRearMotor;
private final RobotDrive robotDrive41 = RobotMap.driveTrainRobotDrive41;
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
// Put methods for controlling this subsystem
// here. Call these from Commands.
public SpeedController getLeftRearMotor() {
return leftRearMotor;
}
public SpeedController getLeftFrontMotor() {
return leftFrontMotor;
}
public SpeedController getRightRearMotor() {
return rightRearMotor;
}
public SpeedController getRightFrontMotor() {
return rightFrontMotor;
}
public void initDefaultCommand() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
// Set the default command for a subsystem here.
// setDefaultCommand(new MySpecialCommand());
}
public void takeJoystickInput(Joystick Left,Joystick Right) {
robotDrive41.tankDrive(Left,Right);
}
public void stop() {
robotDrive41.drive(0,0);
}
}
Tank Drive(command):
package org.usfirst.frc6429.NewDimension.commands;
import edu.wpi.first.wpilibj.command.Command;
import org.usfirst.frc6429.NewDimension.Robot;
/**
*
*/
public class TankDrive extends Command {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
public TankDrive() {
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
requires(Robot.driveTrain);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
}
// Called just before this Command runs the first time
protected void initialize() {
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
Robot.driveTrain.takeJoystickInput(Robot.oi.getLef tJoystick(),
Robot.oi.getRightJoystick());
}
// 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() {
Robot.driveTrain.stop();
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
end();
}
}
I can not figure out what the problem is
|
Code:
Robot.oi.getLef tJoystick(),
That could be it?
|