![]() |
Problematic Java code
Hi, I'm trying to start using Java for my team. I haven't had success yet, so we're probably using LabVIEW again. Nevertheless, I'd like to know what went wrong with this code:
Code:
/*----------------------------------------------------------------------------*/ |
Re: Problematic Java code
-You don't need to feed the watchdog.
-It seems that you should be using MecanumDrivePolar as opposed to cartesian as you are just giving it a 0 for the Gyro angle. -The magnitude and direction degrees values of mecanumDrive do not work the way that you are supplying them values. They take an actual value for magnitude and directionDegrees. You can just use mainPad.getMagnitude() and mainPad.getDirectionDegrees() I'll look more in depth and tell you if I find any other issues. The following are not so much problems but can be useful: -Try to name your motors things that make sense. "motor1" may be something useful to you but to anyone else who looks at it is impossible to tell what this is without going to the robot and checking out the wiring. Things like FRONT_LEFT_JAG make more sense to everyone. This code will be enough to get your robot moving from the one game pad in a typical mecanum drive type of way. Code:
|
Re: Problematic Java code
I picked Cartesian because you can give it x and y values from the joystick directly (at least, to my understanding), though I could give polar a shot. Right now, though, we're having issues with the robot doing nothing at all once it gets into teleop, so that might be hardware...
|
Re: Problematic Java code
Quote:
I was unaware that you could just supply an X and Y value to Cartesian. I probably should have looked before I suggested a change. That being said, it is still worth a try. |
| All times are GMT -5. The time now is 09:01 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi