OCCRA
Go to Post We only ask that, when able, you too help other teams as we have helped you. It is this mentality of passing it forward that makes teams and FIRST great. - E. Wood [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media  
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 03-29-2018, 12:10 AM
MrSmith4810 MrSmith4810 is offline
Registered User
FRC #4810
 
Join Date: Feb 2018
Location: Michigam
Posts: 6
MrSmith4810 is an unknown quantity at this point
Help: Joysticks Overlay

Labview Help! Going to comp tomorrow and still having this problem.

I am a programmer on team 4810 posting under the account of one of my mentors.

We are using two xbox one joysticks to control our robot. We have been having the problem where every once in a while the first controller does what a corresponding button or axis on the secondary controller is supposed to do. The secondary controller now does nothing; its function has been taken by the first. It is like the functions of the second controller have been stripped and overlaid onto the first. Then, after a while, they will revert to normal.

The driver station still reads the controllers correctly, as does the dashboard which we write to in teleop by "get joystick values". When we receive the joystick values, we write them to global variables which we receive in periodic tasks, where we do the actual driving of the motors.

The overlaying does not seem to be triggered by anything. We have gotten new controllers, and are using the array to cluster and then unbundle by name instead of index array to get the joystick values outside of the array they come in.

Please respond with any suggestions, and if you would like to see specific parts of out code it is on github at
https://github.com/IAMRobot4810/2018PowerUp4810

Thank you so much in advance
Reply With Quote
  #2   Spotlight this post!  
Unread 03-29-2018, 12:58 AM
ngreen ngreen is online now
Mentor
AKA: Nelson Green
FRC #1108 (Panther Robotics)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Paola, KS
Posts: 1,067
ngreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond repute
Re: Help: Joysticks Overlay

I didn't spot a cause in your VIs. I'd focus attention toward the USB host and if the issue is there, making sure they don't sleep (power options) or are otherwise faulty (try other USB ports). Or swap the drive station computer.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-29-2018, 06:25 AM
Mr.R^2 Mr.R^2 is offline
Registered User
FRC #6762
 
Join Date: Apr 2017
Location: Hillsboro, NH
Posts: 51
Mr.R^2 is on a distinguished road
We have been noticing this too. The issue seems to be with either the usb host, the driver station, or most likely, both. For is, it seems to change when a stick is plugged into the computer while the driver station is still running. The solution is to switch the sticks in the driver station by clicking on the usb tab of the driver station and dragging the lower stick to the top. Then, do not unplug any usb perifferals from your computer.
Good luck at the event.
Reply With Quote
  #4   Spotlight this post!  
Unread 03-29-2018, 09:08 AM
MrSmith4810 MrSmith4810 is offline
Registered User
FRC #4810
 
Join Date: Feb 2018
Location: Michigam
Posts: 6
MrSmith4810 is an unknown quantity at this point
Re: Help: Joysticks Overlay

One thing I forgot to mention: the problem happened while connected to four different student laptops, as well as a dedicated driver station laptop that is clean of crapware and should have the USBs set to never sleep. We had heard that the Afterglow controllers we were using were buggy, so we bought two of the newest Xbox for windows controllers and the problem remained.

Thinking through some troubleshooting:
The problem is not in the controllers as we got new ones,
It is not in the physical driver's station, unless it is a default windows setting, as it happened on multiple controllers,
It is unlikely that it is the program "drivers station"'s issue because of the multiple laptops and I have heard of almost no other teams with this problem,
Re-imaging the Rio fixed the problem for almost two hours of drive time but it then reverted, and again I haven't heard complaints in the FRC community,
It is unlikely that it is the physical Rio because the same problem happened on our practice bot's electronics board,
The problem happens while using different radios.
This leads me to sadly think that the problem is in the code as it is a commonality.

Am I missing something above?

Possible issues with code:

Last night I noticed that we did not have shift registers on the motor refnums in periodic tasks. I added them, but would this change anything?

Could a problem be that we have a fair amount (~20) global variables? Sitting here thinking, I think that we could decrease the amount to about 15 without too many changes if it mattered.

Could it be that if our periodic tasks loops are running too fast the Rio could get confused? If 20 or 40 ms wait is too fast, what would you suggest?

Thanks again
Reply With Quote
  #5   Spotlight this post!  
Unread 03-29-2018, 09:45 AM
Xand10's Avatar
Xand10 Xand10 is offline
Team Captain
AKA: Xander
FRC #1023 (Bedford Express)
Team Role: Programmer
 
Join Date: Oct 2016
Rookie Year: 2012
Location: Temperence MI
Posts: 34
Xand10 is just really niceXand10 is just really niceXand10 is just really niceXand10 is just really niceXand10 is just really nice
Re: Help: Joysticks Overlay

I don't see a reason that to many global variables would make an issue, we have upwards of 100 with no issue. As well as with the loop timers being too fast shouldn't be an issue with flipping the controllers. We are using a similar architecture of reading the controllers in Teleop and putting those values into globals specific to each controller (One global for Driver Controller, one global for Manipulator Controller, one global as the standard Global data with robot specific info) and haven't had an issue.

I would double check that the refnums for your controllers are named the correct things as I recall at one point the get joystick values defaulting to USB 0 if lost.

I would also suggest probing the refnum going into each Get Joystick Values vi while it is running to see if they are flipping in code.

I don't have LabView on my computer right now so I can't look through your code, but those are some of the things I would check.
Reply With Quote
  #6   Spotlight this post!  
Unread 03-29-2018, 10:12 AM
ngreen ngreen is online now
Mentor
AKA: Nelson Green
FRC #1108 (Panther Robotics)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Paola, KS
Posts: 1,067
ngreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond reputengreen has a reputation beyond repute
Re: Help: Joysticks Overlay

There is a 20 ms wait hardcoded at the top of Teleop.vi that could potentially conflict with the robot main.vi scheduling loop.

The shift registers issue doesn't seem to fit your problem. I've seen teams with many more global variable, so that doesn't seem suspect.

And for drive station/usb problems that you'd see the change on the driver station, as joysticks are disconnected/flipped in order. I'm not sure if sleeping USBs is a default, but common enough to double-check.
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


All times are GMT -5. The time now is 07:46 PM.

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


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi