Will this work?

To set the drive to tankdrive I put this in my DriveWithJoysticks command file, right?
(had to put spaces on oi because it would make the :o face)
void DriveWithJoysticks::Execute() {
Robot::driveTrain->robotDrive41->TankDrive(
Robot:: oi->getopStick()->GetRawAxis(1),
Robot:: oi->getopStick()->GetRawAxis(5));
}

OR

Should I just create an if statement that checks if getrawaxis(1) > deadZone, then set left motor outputs to 1.

One of my pet peeves is a “binary” joystick. That is one where the sticks aren’t balanced well enough and you can’t really hold them part of the way (so it’s always close to either 0 or 1). Equally annoying is when someone uses an xbox 360 or xbox one controller as if it were binary. Essentially gunning the robot, realizing it’s going too fast, immediately stopping, then full speed again, and so on; speed control by manual switching (bad!). There’s actually a reason you want to use complicated motor controllers (instead of spikes) and high quality joysticks: because you don’t want to be going top speed all the time! :rolleyes:

Gavin,
First … feel free to use the ““CODE”]” and “”/CODE"]" markers (without the double-quotes) around anything that you want NOT formatted (smiles etc) - works like a champ.

int i=25;

Now for TankDrive, this is the drive mechanism where you (usually) want two joysticks - one is all about the left wheels and the other is all about the right wheels. Right? If that’s indeed what you’re looking for, then only the Y-Axis would be looked at for each of the joysticks. As such, TankDrive() would have inputs from two different sticks like:

BTW - I’m not familiar with your Robot:: class so I’m going to use my own ‘Joystick’ instances - if you have your own already, feel free to substitute…

Found somewhere like RobotInit()…


JoyStick leftStick(0);
JoyStick rightStick(1);


TankDrive(leftStick.GetY(), rightStick.GetY());

This is the gist of it. Does that make sense? Let me know if not.

roboBob

Yes it makes sense. Its just that we are using a logitech f310 so I have to use one port. Also last year we had it set up with the if statement, worked pretty well. Just didn’t know if we should keep doing that or go to the TankDrive().

If you’re going to stay with it, it doesn’t make a lot of difference. If you think you might want to change driving mode (e.g. to arcade drive), then coding it as tank drive at this point would make a much easier transition.