I have used Labview on and off for a number of years. I’ve done a fair amount of experimental research but now I spend my days trying to prepare new mechanical engineers as a Lecturer at UMass Lowell.
My son just joined our local team (Team 138 Entropy) and I have signed on as a mentor. The team primarily uses Java for programming, but I want to have a working knowledge of all aspects of the FRC ecosystem, so I have been trying to bring myself up to speed on FRC Labview.
So…is it just me or are there others out there that find the existing sources of official documentation sorely lacking? I have been slogging my way through the process and believe that I have a pretty good handle on the basics, but I don’t see how high school student could ever get off of the proverbial square one.
I have found bits and pieces of documentation such as the very helpful document by Geoff Nunes of Team 1391, but I still run into things that have me banging my head on the table with frustration, such as trying to get the Default Dashboard Driver tab to acknowledge the second joystick on an Xbox one controller. The Driver Station USB tab shows me that everything works, but for the life of me, I can’t figure out how to get the second joystick plot to respond to the second joystick. I suspect that it is looking for another USB device that’s my next step, but its really frustrating not to have even that type of basic documentation.
Anyway - I hope that those of you on this forum won’t mind answering some questions as I continue to ascend this steep learning curve.
Without the code in front of me at work it’s tough to trouble shoot, but I have a couple basic questions.
First, I’m assuming this is just one xbox controller, and it’s the second stick that’s the problem. Have you gone to the robot code and checked that the second thumbstick is working correctly by probing its output wire?
Next, have you checked what network table variables those joystick values are being placed into and verify they are the ones attached to the graph you’re having trouble with?
Thanks for the reply. The image below shows the Driver Station and the Dashboard. The driver station shows that the controller has Axes (0-5). The default Dashboard only responds to Axes 0, 1, and 2.
If I open a Dashboard Main.vi, I see the Joystick Values that is broken out into the two sets using the Prepare Joy Data vi’s. But I am at a loss on how to modify these options.
It is a lot harder to find but there is tons of information there from NI about programming using LabVIEW.
For a change like this I would also recommend the Team 358 website with all of its examples
Things to make sure you check:
Did you open the second joystick in Begin?
Are you referencing both joysticks (with the names you set them to in Begin) in teleop? If you probe the array coming out of the Joystick get do you see values?
Are you sending the output values of both joysticks to the driver station?
The image didn’t come through for me can you post it as an attachment?
You shouldn’t have to do anything to Dashboard Main unless you are using a special controller that has different axis that you want to map to the dashboard.
Are you possibly trying to show both sticks of a single xbox controller on the dashboard?
I think that I have not been on the forum long enough to have permission to post images. You can access the image here:
Thanks for the links - I’ve been to both, but there is a certain depth that is lacking that I want to have before I would be comfortable using it as the main programming tool for the robot.
Are you possibly trying to show both sticks of a single xbox controller on the dashboard?
YES, that is exactly what I am trying to…
As I mentioned in my post, I was beginning to suspect that the Dashboard is configured such that the second joystick window expects to see a second joystick connected to a second USB port.
I now fully realize what you are trying to do. I have attached a picture and the dashboard main of what you wanted to do. I hope this helps explain things I apologize for misunderstanding your problem it seems like you were very close to solving it yourself.
Yes the default dashboard expects 2 traditional flight style joysticks. This year we actually used 1 flight joystick and 1 XBox controller so that is what I have coded for you. You can see on the image you posted that the XBox Controller has axis 0/1 as the left stick and 4/5 as the right stick. I am using pretty much the same code that is in the Prepare Joystick Data for Displays.vi but modifying it slightly. The index array function will noramlly give you the array elements starting at 0 for as far as you drag it down but in this case that was fine for the first two 0/1 but I needed 4/5 for the second 2 so I had to explicitly specify them (I really didn’t need to specify 5 as it was next in line but did for clarity).
As a quick mention, the joystick data is coming out in two arrays: double precision and boolean.
The boolean array represents all of the buttons on the joystick. The double is all of the axes you can use. If you know which 0-indexed button/axis you want to use from the driver station, you select that one using the Index Array.
That’s the heart of what Jason did to modify the base Dashboard. It’s a bit of a culture shock moving from LabVIEW to the FRC API. But, you’ll pick it up pretty quick if you understand LabVIEW.
I don’t think I’ve ever seen anyone in these forums get upset that someone is asking questions.
@navillus5, please feel free to PM or email me (I’ll give my phone number through one of those if you want) if you need help with something. I’ve got several years of FRC LabVIEW programming and mentoring, and if a bunch of contacts both through mentoring and through the site.