|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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 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. |
|
#2
|
||||
|
||||
|
Re: Will this work?
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!
![]() |
|
#3
|
||||
|
||||
|
Re: Will this work?
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. Code:
int i=25; 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()... Code:
JoyStick leftStick(0); JoyStick rightStick(1); Code:
TankDrive(leftStick.GetY(), rightStick.GetY()); roboBob |
|
#4
|
|||
|
|||
|
Re: Will this work?
Quote:
|
|
#5
|
|||||
|
|||||
|
Re: Will this work?
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|