We are trying to read the “pitch” value that is build into the YPRHfH vi in autonomous but have been unsuccessful so far. We are using it to find when the bot has driven over a defense or has gotten on the batter. We’re able to read “yaw” just fine. We enable the sensor in begin as YPRH. Any insight?
Can you please clarify what “have been unsuccessful so far” means?
If just starting out using pitch, it’s good to review the terminology. As discussed in the navX-MXP “Terminology” page, pitch is defined as rotation about the “X” axis.
Then, it’s good to review the different axes to make sure it’s clear which is the X axis and what it means to rotate around that axis. Take a look closely at the navX-MXP; there’s indication of the X axis there. As rotation about this axis occurs, the pitch angle will change.
Depending upon how your navX-MXP/RoboRIO are mounted, the pitch angle could be measuring different things.
To clarify, the value being fed out of the unbundle by name vi is always 0. 0E-3 to be exact. The pitch angle is definitely the value we want. I know it’s not working properly because the value never changes from 0 during teleop driving or auto.
Can you please confirm that you are using the most recent version of the LabView library for the navX-MXP? The latest version of this is 2.0.5.0, and a release is available here:
One you have verified that your release is current, I’d encourage you to run in LabView the “navX Example v2.vi”, which is in the “Examples\Functions” folder once you open the “navX Library.lvproj” project in LabView . This provides a monitor on the navX-MXP and will display the Yaw, Pitch and Roll values from the sensor, along with a lot of other information. This will verify that your board is correctly sending pitch/roll values to a labview application.
As you run this test, be sure to select the appropriate interface (SPI, I2C or TTL UART) in the example, to match what you use in your robot application.
Please let us know what you find.
Try reading the “roll” value. Depending on how your NavX is mounted, your robot pitch and roll could be flipped compared to the NavX board axes.
First of all, your example vi that contains all the readouts from the NavX is amazing. It turns out that the Roll value was what I needed instead of Pitch. I’ll mess around with the bot tonight and tomorrow and let you know if we have any other issues.
Thank you very much for your helpful advice! Your product is an awesome tool to have. No FRC team should go without it!
Glad to hear you’ve got it worked out.
Actually, all credit for the LabView Library and the Example VI goes to James Parks, FRC team 900 (Zebracorns) - he goes by “Caboose” on ChiefDelphi.
James and others in the FRC community have volunteered their valuable time to work together with KauaiLabs to get things to where they are today. Couldn’t have done it without folks like James.
Not only did James port Joe Ross’ original nav6 LabView library from the CRIO to the RoboRio navX-MXP library for the 2015 season, he then completely rewrote the library for 2016, adding support for things like multiple navX devices on a robot as well as velocity and displacement estimation.