The 2nd Joystick must DIE

it still doesnt work i must have tried one hundred ways now heres my code.

and the teleop vi

HELP! if you could post a tank drive program it would help alot!!

What does and doesn’t work? Does it move at all, only left side works, etc?

Greg McKaskle

Your begin.vi looks fine, although, you need to move your drive code in the telop.vi outside of the case it is in now, and put it into the larger case structure. The case you have it in now, I believe is for camera tracking. Also, I only see “joystick 2” being referenced, you’ll need to reference “joystick 1” as well instead of using the “joystick read” block.

Furthermore, don’t forget to close the “Joystick 2” in your final.vi, everything else should be closed already.

The case it is in is the case when not camera tracking, so it’s correct. Joystick 1 is referenced in the Joystick Read VI from the default framework. I do not see anything wrong with the code.

John, It appears that you have similar problems in this thead. I wonder if the problem isn’t with the code, but how you are running it. How are you running the code?

It also looks like you are using Windows 7. Have you tried it on a supported operating system?

@Joe tried XP as well, i when i want to try the code i richt click boot time device and select run as startup after the changes I make.

@Greg Only the USB1 stick responds left side. I even tried a program where instead of you separte joysticks it was one daul action usb and i set the axis’s to axis 2 and axis 5 and still only the axis 2 worked.

I assume you chose build before run as startup?

Do you have any errors on the diagnostics tab of the DS?

Yes i do, do you have to rebuild it every time?. When i do have errors they are in reference to the camera, some times a watchdog timeout but it doesn’t effect the controller 1 and never gives me any error in reference to controller 2. The Dashboard PWM ports where the 2nd controller would be controlling dont respond either.

Yes, you must build after every change if you want to run it as startup.

Alternately, you can click the run button in robot main to run in debug mode. Then you can use debug tools like probes to see what is actually happening in the code. For example, you can probe the value from the joystick and see if it is doing what you expect or if the problem is somewhere downstream.

Could it be that your joystick assignments are reversed? (ie the one you’re assigning to USB1 ends up being joystick 2 and vice versa). It seemed like for us the USB port assignments weren’t stable. The students seem to have figured out how to go with the flow, so I don’t have a better description of this.

Can someone look at my telop code and let me know if this is correct. I thought I was on the right track, but from other posts on here, I decided to go another route. The image of the telop.vi is attached. Sorry for the poor resolution, but i had to make the file size small enough. Thanks…

holonomic3.bmp (73.5 KB)


holonomic3.bmp (73.5 KB)

It looks reasonable, but there is an easier way to convert from cartesian to polar (the magnitude and direction). In the palette under Programming >> Numeric >> Complex choose “Re/Im to Polar”. This VI does all that math internally. The output is in radians, so you still need the conversion to degrees.

In the next update there will also be a VI that takes cartesian inputs so you can wire your joystick up directly.

As for the poor resolution, you should use jpg or png, not bmp. bmp is basically just a raw image with no compression.

The help implies that some of the inputs should be in degrees. However, when I dug in, it looks like it limits the values to -1 to 1, which implies they should not be degrees, but joystick values. Am I reading that right?

Also, wouldn’t putting the gyro in as an input cause positive feedback? Shouldn’t that also be a joystick value?

I assume you are talking about digging into the HolonomicDrive VI. It takes 3 inputs… Magnitude (which is from 0.0 - 1.0), Direction (which is in degrees) and Rotation (which is -1.0 to 1.0, but has errant documentation claiming it is in degrees/sec).

Who’s putting the Gyro in? I’m guessing you mean into the Direction input. The Gyro only comes into play if you want field oriented control, in which case you would subtract the gyro angle from the desired direction coming from the cartesian to polar conversion.

-Joe

Nevermind, I didn’t follow the wires correctly.