Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   The 2nd Joystick must DIE (http://www.chiefdelphi.com/forums/showthread.php?t=81412)

JohnFogarty 29-01-2010 07:26

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!!

Greg McKaskle 29-01-2010 08:00

Re: The 2nd Joystick must DIE
 
What does and doesn't work? Does it move at all, only left side works, etc?

Greg McKaskle

Hadi379 29-01-2010 08:35

Re: The 2nd Joystick must DIE
 
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.

Joe Ross 29-01-2010 09:43

Re: The 2nd Joystick must DIE
 
Quote:

Originally Posted by Hadi379 (Post 909149)
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..

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?

JohnFogarty 29-01-2010 11:33

Re: The 2nd Joystick must DIE
 
@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.

Joe Ross 29-01-2010 11:51

Re: The 2nd Joystick must DIE
 
Quote:

Originally Posted by John_1102 (Post 909255)
@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.

I assume you chose build before run as startup?

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

JohnFogarty 29-01-2010 11:59

Re: The 2nd Joystick must DIE
 
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.

Joe Ross 29-01-2010 12:38

Re: The 2nd Joystick must DIE
 
Quote:

Originally Posted by John_1102 (Post 909269)
Yes i do, do you have to rebuild it every time?.

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.

fritzdejongh 29-01-2010 12:55

Re: The 2nd Joystick must DIE
 
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.

Hadi379 29-01-2010 14:04

Re: The 2nd Joystick must DIE
 
1 Attachment(s)
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....

jhersh 31-01-2010 02:27

Re: The 2nd Joystick must DIE
 
Quote:

Originally Posted by Hadi379 (Post 909350)
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....

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.

Joe Ross 31-01-2010 09:50

Re: The 2nd Joystick must DIE
 
Quote:

Originally Posted by jhersh (Post 910433)
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.

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?

jhersh 31-01-2010 16:16

Re: The 2nd Joystick must DIE
 
Quote:

Originally Posted by Joe Ross (Post 910497)
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??

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).

Quote:

Originally Posted by Joe Ross (Post 910497)
Also, wouldn't putting the gyro in as an input cause positive feedback? Shouldn't that also be a joystick value?

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

Joe Ross 31-01-2010 16:23

Re: The 2nd Joystick must DIE
 
Quote:

Originally Posted by jhersh (Post 910719)
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.


All times are GMT -5. The time now is 01:54.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi