View Single Post
  #8   Spotlight this post!  
Unread 06-02-2017, 08:41
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 135
aeastet is an unknown quantity at this point
Re: How do you program the navx mxp in labview?

Quote:
Originally Posted by mshafer1 View Post
Breakaway has done this for a couple of years now.
Because we use the gyro in both modes, we put Get_YPRHfH.vi and store the gyro's position (yaw) into a global in Periodic tasks, and use that global in auto.



The basic principal is that WPI has already provided great algorithms for a x/y control algorithm (Arcade drive). So we use a PID (target gyro angle as the setpoint, the global from the gyro for the process variable, and work out the tuning) as the x input to the Arcade Drive vi, and usually a constant into the y value. We have found that the gyro updates rapidly enough to support this (we've even translated vision analysis into a desired gyro angle because the gyro was updating fast enough and the vision was not.)

The NavX library has updated some since we did this. You could combine this idea with the TeleopRotateToAngle.vi in the navX\Examples folder.
I just wanted to let you know that you do not need to store the yaw value in a global variable. If you place the Get_YPRHfH.vi directly into the auton it will read automatically if you have the navX main vi placed properly. This is the reason we moved to the action engine for all of our parameters. You can place this vi in as many locations as you need to get the value. This allows you to only read the value when you need it.

If you have questions please let me know.
__________________
Team 6043 Allegan Tigers
LabVIEW Developer for Kauai Labs (navX and SF2 Libraries)
http://www.kauailabs.com/
Reply With Quote