NavX get YRPHfH not responding

Using the NavX MXP in Autonomous we noticed that as the robot is spinning none of the values in the output cluster of the get YRPHfH VI were updating. I can’t think of why this is happening so I attached some of the code here for review.







One thing I didn’t see as I reviewed the two files you’ve shown is the “navX Main” vi. This is required to initialize communication w/the navX-MXP.

Please review the navX-AE Getting Started page, there’s a video there that guides you through the basic configuration, and there’s a section there that discusses navX-Main.vi.

  • scott

Should be it at the bottom left of the robot main snippet.

Ah, I see it now; can you please try I2C instead of SPI, and let me know if that works for you?

I also noticed that you are using vision on your robot. What is the processor utilization for the roborio? I am concerned that you are maxing out the capabilities of the roborio. I think you have two processes fighting over resources. The roborio is trying to keep up but can’t.

Try moving the vision to the desktop. I did that for our team and we are running at 320X240 at 33 FPS with 15% compression with all of the processing. We get beautiful video and great vision processing. Your desktop computer will need to be a decent computer. The FIRST provided laptop will not work very well.

It looks to me like your code is implemented correctly. You are only showing us the part that uses the navX so I can not tell if there is something wrong somewhere else. The code that you are showing looks like it should work just fine. In auton mode you can take the 5 msec wait out of your code. That should be the only code running so you want to use the processor as much as possible and execute as quickly as possible. I do not have any waits in my code for auton.

We aren’t processing camera images just setting up a live feed for the drivers. I should mention that the navX has been working on this robot before. When we placed the get yaw in a loop in periodic tasks it was fine. We cleaned up our code and we only use the gyro data in Autonomous so we put it there.

I posted a simplified version of our auto code to give more context to our implementation.





If you deploy the code, using the white arrow at the top of the front panel, and probe the output from the YRPHfH.vi do you see a value when it is running? I would also still like to know what your CPU utilization is when you have the robot running in auton. From what I can see you are doing everything correct.

Where did you place the navX main vi? That could also cause you to not get a reading from the YRPHfH.vi. Make sure that when you place the navX main vi that you do not put it in a loop or inside something that will not get executive right away.

Figured it out just before the Albany qualifier.
#1 power rail on the rio was shorted because of an aluminum shaving (kill me) and the NavX wasn’t powered. Noticed the power light/DS warning in a timely manner I promise.

#2 we were running at 92% cpu and greater. Correct me if I’m wrong but cpu spikes coincided with the get VI not responding. Cut out the camera loops and now we’re (inexplicably) running in the mid to low 80’s but it all works.

We can hit the side pegs in auto now so thanks everyone!