I don’t know how to designate the certain sticks of the controller to either moveStick or Rotate stick and also am confused on how to assign them in the declaration
myDrive = new RobotDrive(0,1,2,3);
moveStick = new Joystick(1);
rotateStick = new Joystick(2);
Any help appreciated; Ive already looked over the other chief delphi post over this subject but am still lost. Thanks!!
*/ RobotDrive myDrive;
Joystick moveStick;
Gyro gyro;
public void robotInit() {
Talon TalLF = new Talon(0);
Talon TalLR = new Talon(1);
Talon TalRF = new Talon(2);
Talon TalRR = new Talon(3);
myDrive = new RobotDrive(TalLF,TalLR,TalRF,TalRR);
moveStick = new Joystick(1);
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
//while(!isAutonomous() && isEnabled())
//{
//myDrive.mecanumDrive_Polar(moveStick.getRawAxis(1),moveStick.getRawAxis(2) , moveStick.getRawAxis(4));
myDrive.mecanumDrive_Cartesian(moveStick.getRawAxis(1), moveStick.getRawAxis(2), moveStick.getRawAxis(5), gyro.getAngle());
Timer.delay(0.01);
//}
}
Also, are you meaning to do field-oriented drive (pushing up on the left joystick makes the robot move away from you, no matter which way it’s pointing)?
Well you don’t create it, at least in the code you show here. If you don’t want field-oriented get rid of the gyro.getAngle() in the mecanumDrive constructor and replace with 0.