FIRST Robotics Competition Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

[Archived] 2015 FRC LabVIEW Additional Resources

Comments
Member LoriG
Member

It seems that the 2015 Joystick Palette has replaced the Get VI with a Get Value VI.  The Get Value VI outputs an array (instead of  the cluster output I saw last year).  Is there any documentation listing & accessing the position of each buttion/axis in the array?  If so where can I find it? 

Thanks.

Follow up

I found that I could map the buttons and joystick axises using the simulation tool.  I am still interested in knowing if there is any official documentation. 

DAQjr
NI Employee

There is also a VI in the Joystick Palette called Get Info that will tell you about your joystick.  We recommend you use that to find the Axes.

The buttons are simply in the same order as last year.  Naturally since the buttons are in an array (0-based index) you have to subtract 1 from the number printed on the joystick buttons (1-based index).

Member mavismay
Member
Member lambertj
Member

So we now have to manualy find the axes then use the index number instead of having labled clusters?

Member mavismay
Member

Yes, you now have to specify which index you want (assuming you know which index), and that is the only value you will receive. The programmers from my team and I felt this was a bit more error-pron than simply choosing the labeled index we want from a cluster of values, so we decided to ignore it. Fortunately, LabView has a built in tool that can convert an array to a cluster. We then unbundled that cluster, giving us a similar completely-labeled data layout like we had last year. Either approach works.

Hope this helps,

Nick May

Sent from my iPhone

DAQjr
NI Employee

In the past the labelled cluster was misleading.  It was always the same thing (static) and, depending on what joystick you have, it would be wrong.  The new method allows you to find the correct axis no matter what type of joystick you use since the DS will now send the list of axes so you know what index they are in.

Member IceGigDude
Member

I am having a trobling time with buttons in the 2015 LABVIEW. I looked at the porting guide from 2014 to 2015 and tried to program buttons with arrays. I had little success (The robot did what I programmed but it wasnt the right button I had to press, and with less power than programmed). Than I tried what mavismay(higher in the comments) said with converting the array to a cluster. Having the same amount of success as last time. I am wondering if anyone can help me with the buttons. It would be greatly appriciated.

-Calvin

Member mavismay
Member

So you tried both ways and neither worked? If you can upload some screenshots of the code in question, I can look and see for you. It's always hard to understand the problem without context.

Thanks,

Nick

Sent from my iPhone

Member IceGigDude
Member

Screenshot (2).png

Member IceGigDude
Member

Thank You for helping me. Here is example code of what I am trying to accomplish.

Much appreciated

-Calvin

Member mavismay
Member

Alright, sorry it took me so long to get back to you, but I finally got a

chance to take a quick look. Anyway, from what you've shown me, you are

using the "unbundle cluster" correctly, I think any problems you are having

are on the logic end of the program. So, for example, if your power is not

at what you desire, up the numerical values you are feeding to the motors.

Also, you probably noticed by now that you have to hold the buttons to get

them to work. That is because you are using simple case structures; these

reset every 10 milliseconds with the rest of the teleop VI. If the buttons

you assigned are not working correctly, that could also just be a simple

case of misunderstanding which button corresponds to which on your

controller (I've done that a million times).

I hope this all makes sense. Feel free to ask any more questions if you

still need help.

- Nick

Member IceGigDude
Member

It all makes sence and thank you for the help. Ill will play around with the code. This help means a lot to me.

-Calvin

Member IceGigDude
Member

Hello,

So Im messing around with our teams pratice bot in order to learn encoders and how they work, and I can't seem to get the program to work. The robot will drive but it will not stop at the set point. Does anyone know why?

Please see my attached Picture.

-CalvinScreenshot (4).png

Member MarkBalla-Tecnova
Member

How confident are you about the PID gains? If they are not tuned to the system I can see how you may never see a motor drive value of less than 0.1  What if instead of looking at the motor drive value you looked at the difference between the set value (50) and the encoder value typically called the error value. This value may give you a better indication of how close you are to the target.

Member IceGigDude
Member

I did do something like that than I found another example online that showed me that code. So I wanted to try it out to see if it would work. But here is what I origanally done.Screenshot (6).png

Member R^2
Member

Any word on when the updated version will be avaliable for the 2016 season?