Go to Post Anyone riding a Segway looks cool...ask Andy Baker - Kyle Love [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-02-2009, 18:35
Pausert Pausert is offline
Registered User
FRC #1727 (REX)
Team Role: Leadership
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Maryland
Posts: 69
Pausert is an unknown quantity at this point
Re: adding a second joystick to TeleOp Init

We are having a problem related to this. After we create a new joystick devref, build, and then deploy the code motors won't be controlled by only their own joystick or button. The inputs from one joystick sort of mix with those of the other. IE. the drive joystick starts to control the device at random.
Reply With Quote
  #2   Spotlight this post!  
Unread 14-02-2009, 18:58
airnate airnate is offline
Registered User
FRC #0236 (Techno Ticks)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: southeastern CT
Posts: 93
airnate is a jewel in the roughairnate is a jewel in the roughairnate is a jewel in the rough
Re: adding a second joystick to TeleOp Init

I presume you are opening two separate joystick channels, correct?

Can you post the code?

Are you rebundling the device references back into the cluster? If so, you need to be careful to rebundle them into the correct device references. If they are mixed, you will end up with the type of behavior that you are describing.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2009, 19:15
Pausert Pausert is offline
Registered User
FRC #1727 (REX)
Team Role: Leadership
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Maryland
Posts: 69
Pausert is an unknown quantity at this point
Re: adding a second joystick to TeleOp Init

Here is the code. I don't see where the bundling can mixed up in the Teleop file. Also, I have made sure to have the joysticks on separate USB ports.

Is there a way to create a devref that does not require copy and pasting or cloning using ctrl? That is the only way I or the other programmers know...

Finally, is there a need to initialize another joystick devref inside of the Joystick.lvlib's Open VI and Close VI?
Attached Files
File Type: zip REX build up.zip (339.0 KB, 31 views)
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2009, 21:57
Pausert Pausert is offline
Registered User
FRC #1727 (REX)
Team Role: Leadership
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Maryland
Posts: 69
Pausert is an unknown quantity at this point
Re: adding a second joystick to TeleOp Init

Sorry to double post, but I though that this may make it easier to see:

This is does exactly the same thing as the posted code, but uses the basic structure rather than the advanced structure. There is a 2 wired to the second "OpenJoysick.vi" because I was messing around and hoped that it might fix it.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-02-2009, 23:11
airnate airnate is offline
Registered User
FRC #0236 (Techno Ticks)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: southeastern CT
Posts: 93
airnate is a jewel in the roughairnate is a jewel in the roughairnate is a jewel in the rough
Re: adding a second joystick to TeleOp Init

I believe the problem is that in your Teleop.vi you never initialized the Joystick DevRef 2. You definitely ought to Open the joystick and assign the Joystick DevRef 2 before using it.
Reply With Quote
  #6   Spotlight this post!  
Unread 14-02-2009, 23:33
smcmahon's Avatar
smcmahon smcmahon is offline
The Architect
AKA: Sean McMahon
FRC #2656 (QUASICS)
Team Role: Coach
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Pittsburgh, PA
Posts: 197
smcmahon is an unknown quantity at this point
Re: adding a second joystick to TeleOp Init

OK, looking back at the image I posted at the top...

I created the second DevRef as instructed. I added it and set it for USB2. I expanded the bundle on the left to now show "JoystickDevRef2" and sent the brownish wire out of that into the case structure (Init). Then I branched in the pink line (RobotData In) as the input cluster. However, if I try to send the output cluster to RobotData Out I get an error that states: Wire connects to an undirected tunnel.

So, the question: once I create the second JoystickDevRef, how do I get it's output to continue on and be used in the RobotData Out?

PS: With it configured as above, the RUN arrow is not broken...
Attached Thumbnails
Click image for larger version

Name:	RobotData_Out.png
Views:	45
Size:	28.0 KB
ID:	7446  

Last edited by smcmahon : 14-02-2009 at 23:36.
Reply With Quote
  #7   Spotlight this post!  
Unread 14-02-2009, 23:50
airnate airnate is offline
Registered User
FRC #0236 (Techno Ticks)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: southeastern CT
Posts: 93
airnate is a jewel in the roughairnate is a jewel in the roughairnate is a jewel in the rough
Re: adding a second joystick to TeleOp Init

You can do this one of two ways:

(by the way bundle refers to the operation of putting values into a cluster. Unbundle refers to the operation of getting values out of a cluster).

1. bundle them one at a time (see 2nd picture)

If you bundle each value one at a time as you are doing, you need to wire the output of one bundle (the right most connector of the bundle) into the input of the next one (the middle connector of the bundle).

2. bundle them both using the same bundle function. (see 1st picture) Assuming that the cluster has more than one value in it, you can stretch your Bundle By Name function so that it has more than one input. Then for each bundle value, you can select the name of the value that you want to bundle.
Attached Thumbnails
Click image for larger version

Name:	2_joystick_bundle.png
Views:	41
Size:	8.6 KB
ID:	7448  Click image for larger version

Name:	2_joystick_bundles.png
Views:	41
Size:	8.4 KB
ID:	7449  
Reply With Quote
  #8   Spotlight this post!  
Unread 15-02-2009, 00:07
smcmahon's Avatar
smcmahon smcmahon is offline
The Architect
AKA: Sean McMahon
FRC #2656 (QUASICS)
Team Role: Coach
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Pittsburgh, PA
Posts: 197
smcmahon is an unknown quantity at this point
Re: adding a second joystick to TeleOp Init

Thank you airnate. You are a wise and powerful LabView master. I shall test this tomorrow.
Reply With Quote
  #9   Spotlight this post!  
Unread 15-02-2009, 09:06
Pausert Pausert is offline
Registered User
FRC #1727 (REX)
Team Role: Leadership
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Maryland
Posts: 69
Pausert is an unknown quantity at this point
Re: adding a second joystick to TeleOp Init

Quote:
Originally Posted by airnate View Post
You can do this one of two ways:

(by the way bundle refers to the operation of putting values into a cluster. Unbundle refers to the operation of getting values out of a cluster).

1. bundle them one at a time (see 2nd picture)

If you bundle each value one at a time as you are doing, you need to wire the output of one bundle (the right most connector of the bundle) into the input of the next one (the middle connector of the bundle).

2. bundle them both using the same bundle function. (see 1st picture) Assuming that the cluster has more than one value in it, you can stretch your Bundle By Name function so that it has more than one input. Then for each bundle value, you can select the name of the value that you want to bundle.
My init case looks exactly the same as yours. The problem must lie deeper... When I get accesses to the robot I'm going to start checking for physical issues. I already have checked the robot wiring, so I suspect that there may be something wonky with our O/I station.
Reply With Quote
  #10   Spotlight this post!  
Unread 15-02-2009, 13:22
airnate airnate is offline
Registered User
FRC #0236 (Techno Ticks)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: southeastern CT
Posts: 93
airnate is a jewel in the roughairnate is a jewel in the roughairnate is a jewel in the rough
Re: adding a second joystick to TeleOp Init

Pausert,

The REX build up zip that you posted yesterday at 07:15 pm is missing a Joystick Open in the Teleop.vi Init case. The USB 1 Joystick is opened and assigned to JoystickDevRef, but the JoystickDevRef 2 is unassigned.

This could certainly create strange behavior.

-Nate
Reply With Quote
  #11   Spotlight this post!  
Unread 15-02-2009, 19:27
Pausert Pausert is offline
Registered User
FRC #1727 (REX)
Team Role: Leadership
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Maryland
Posts: 69
Pausert is an unknown quantity at this point
Re: adding a second joystick to TeleOp Init

Thank you for all your help! It appears that there were some code issues, but also there were problems with how Labview handles Victors. Once we cleaned up the code and changed to Spikes the code worked as intended. Thanks!
Reply With Quote
  #12   Spotlight this post!  
Unread 15-02-2009, 20:38
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: adding a second joystick to TeleOp Init

Wanna elaborate on the victor issue?

Greg McKaskle
Reply With Quote
  #13   Spotlight this post!  
Unread 17-02-2009, 20:43
Pausert Pausert is offline
Registered User
FRC #1727 (REX)
Team Role: Leadership
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Maryland
Posts: 69
Pausert is an unknown quantity at this point
Re: adding a second joystick to TeleOp Init

Sure. Essentially, whenever we used a Victor, it would receive some form of crosstalk from joystick 1 even though it was supposed to be received by joystick 2. If we changed the motor VIs to Jaguar ones and put a Jaguar into the electronics the code would run fine, otherwise one of our 2 Victors would start to move with both of the 2 Jaguars we had. If we unplugged the Victor that was receiving the crosstalk, the other Victor would start to move in response to the crosstalk. That behavior alerted us to something odd with the Victors or Victor VIs. Because we didn't really need analog control where the Victors were and we didn't have any extra Jaguars we replaced them with Spikes and used the Relay library.

In short, I have no idea what is actually wrong with the Victors or their associated code, but something is weird about it.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding all devices to Typedef increases Teleop by 100 ms per iteration rwood359 NI LabVIEW 1 07-02-2009 22:11
adding second camera iwdu15 Electrical 1 01-02-2007 20:53
Wierd basic init Jeremy J Programming 5 06-02-2003 11:42
Basic Init Error yan184 Programming 5 14-12-2002 13:10
Programming the second joystick in PBASIC archiver 2001 2 24-06-2002 00:25


All times are GMT -5. The time now is 21:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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