![]() |
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. |
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! :rolleyes:
|
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);Code:
TankDrive(leftStick.GetY(), rightStick.GetY());roboBob |
Re: Will this work?
Quote:
|
Re: Will this work?
Quote:
|
| All times are GMT -5. The time now is 13:31. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi