|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Robot Drive
Our team does not use the robot drive method. Instead we use a hand written drive method.
PHP Code:
|
|
#2
|
|||
|
|||
|
Re: Robot Drive
Quote:
|
|
#3
|
||||
|
||||
|
Re: Robot Drive
Make sure though that you have the motors in the right places... also, you may already known this but the joysticks are really sensitivity so if you have an issue of minor movements of the driver cause the robot to fidget then it might be a good idea to add a sort of sensitivity method to output if the joysticks only passed acertain y value... i suggest using Math.abs(...);
|
|
#4
|
||||
|
||||
|
Re: Robot Drive
Quote:
Last edited by eddie12390 : 10-02-2012 at 11:35. |
|
#5
|
|||
|
|||
|
Re: Robot Drive
I think he intends to do tank drive with two joysticks.
I would however recommend saving stick.getY into a temporary variable first and then write it to the motors. Since this is a real time system, the value of the joystick may change between the two reads and then you will be writing different speeds to the front and back wheels. Probably not a huge issue, but may cause excess wear on the drive train. |
|
#6
|
|||
|
|||
|
Re: Robot Drive
Quote:
The loop will run through much much faster than you can humanly move the joystick, and possibly faster than the amount of time it takes to query the value from the joystick. Also, if they built the robot right, moving the two wheels at different speeds shouldn't be a big issue.So no, no direct disadvantages of doing this manually. It's also a lot easier to fine tune as somebody said. It is kind of like re-inventing the wheel if you're not using any lower level jaguar functions that are inaccessible with the RobotDrive class, but that said, it's always a good idea to be familiar with your code, so whatever you think looks better will probably end up being better for you. If you wanted arcade drive / meccanum drive, you can do some math and figure it out. Or you can go into the RobotDrive class and copy the math over. |
|
#7
|
||||
|
||||
|
Re: Robot Drive
ssirovica: You can always look at WPILIB RobotDrive.java to compare. One thing the RobotDrive tankDrive() does is to square the joystick input magnitude value to change the handling of the robot at smaller joystick movements. This isn't a significant code change, but it has some other benefits (joystick deadband, slightly implements a smoothing filter).
shuhao: How are you implementing a low pass filter? I am curious what you objective is? gpetilli: That is a good observation about real time systems, but I don't think it applies here. Look at WPILIB IterativeRobot.java line 144. I believe this is where WPILIB object states are updated prior to the execution of teleopPeriodic(). |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|