I haven't implemented code for any of this myself, but from what I can tell from the wpilib source and javadocs:
The
mechanumDrive_Cartesian (which you talk about using in the other thread) expects the x and y values you are passing in to be scaled from 1.0 to -1.0 implying that this method is driving the motor controllers open loop. So no encoders are being used by this method.
Furthermore the source calls the .set() method for the SpeedController. I'm not sure this will work if you're using the CANJaguar class.
.set() is deprecated. You're supposed to use .setX()
IF you are dead set on using a CANJaguar, with encoders wired to them, and use the mechanum cartesian method... you could always write your own implementation of the mecanumDrive_Cartesian method. The
source is here, it shouldn't be that hard to modify for your own uses.
The gyro should be wired in to the crio.
Also, using the
Encoder class, for encoders, implies that the encoder is wired to the DSC. There are many constructors for the Encoder class. Fore example you could just
pass in the pin numbers that the encoder is plugged into.
The constructors taking in DigitalSource objects would be used if you had already created a DigitalInput object for the specific pin your encoder is wired to.