NavX Micro Throwing a Fit

Our NavX Micro is not connecting through the RoboRIO but connects to the computer just fine. What’s our list of things to check to see why it may not be connecting?

We are here to help and want to help - can you send more details so we can help you.? What symptoms are you seeing? Are error messages being reported? Send as much detail as you can. We want to help you and the details give us the clues so we can hopefully help you.

Since NavX supports C++, Java and LabVIEW, it helps to know which language to use.

And since NavX supports I2C, SPI , TTl UART and USB it helps to know which protocol is being used.

And since NavX provides so many types of data it helps to know which know types of data you are using.

Details really help.

What symptoms are you seeing?
No information showing up on the Smart Dashboard. No error messages through the drive station or debugging. It can connect to the NevX config program when connected to the laptop via USB. We’re programming using java. Here’s a link to our GitHub files, our code is in the NavX code is in our robot container.

This code from RobotContainer is probably not doing what you think it is:

   boolean zero_yaw_pressed = joystick.getTrigger(); {
      if (zero_yaw_pressed) {
        ahrs.zeroYaw();
      }
      } 

The first line up to the semicolon defines and initializes a boolean. The curly brace at the end of that line through the rest of this code defines an anonymous initialization block.

You probably want to move the code in that block into either a periodic function or into a command that runs when the reset button is pressed.

Second, and I think this is the cause of your no data to the dashboard issue, is that all your dashboard update code is in your RobotContainer constructor. That code will only run once. You will want to move it to a periodic method, either in Robot, or in one or more of the subsystems.

You may want to move the NavX, its usage, and its dashboard updates into your DriveTrainSub assuming you are using for driving.

Thank you so much, we’ll give these ideas a try.

If you still have troubles after following the great suggestions from @Waz, another thing you can do is run a basic sensor health check.

When the sensor is connected via I2C to the RoboRIO, run the factory test procedure and let us know if you see anything unexpected. This will ensure the sensor is powered correctly by the RoboRIO.

We got our problem solved, thank you so very much. We enabled logging and identified that it was working fine, it just wasn’t showing on the smart dashboard.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.