Issue using code w/ multiple classes

So today we finally reimaged our cRIO to the latest v47 Java image and got a chance to compile our code.

Originally our code had two classes, one being the usual main class that all teams would be using to control their robots and the other being a custom DriveTrain class our lead programmer wrote to handle our Mecanum Drive.

When we tested our code 3 of the 4 jags were not initialized. The 4th jag that was initialized would not give input to the motor it was connected to. In troubleshooting we found that only the port on the Digital Sidecar that the 4th jag seemed to be initializing its respect jaguar. We tested all of our jags on that port and they all got initialized, but still would not take input. At that point, we swapped sidecars and the same issue still popped up.

Then we figured that it must have been something in the code. We implemented the same algorithms in the custom DriveTrain class in a single class and somehow everything seemed to work as it should. The thing that bugs me about all this is that one port on the Digital Sidecar was working with the multiple classes and I have absolutely no idea why that would be the case.

Any ideas on why that may have been the case? Is there something about how FRC Java supports classes that I’m missing here?

We’ve run FRC Java code with 60 classes. I suspect there is a bug in your code. If you posted your code, we could help better.

Problem solved : )

The problem wasn’t obvious off-hand, but you might try a few things:

  1. Use Test mode to verify that the motors are all working. Run SmartDashboard then using the Driver Station, put the robot in Test mode. You’ll see sliders for each of the motors. You can move them to make sure that the motors are properly connected. Be sure you have the most recent update to the Netbeans plugin for this to work. Look here for some help: http://wpilib.screenstepslive.com/s/3120/m/7932/l/92264-enabling-test-mode-livewindow
  2. You might consider using the WPILib RobotDrive object. It will support mecanum drive, tank drive, and arcade drive and has been used successfully by many teams. Look at the example here:
    http://wpilib.screenstepslive.com/s/3120/m/7912/l/95588-getting-your-robot-to-drive-with-the-robotdrive-class

Brad