I'm assuming that the z-axis on your controller doesn't exist and that is why you want the triggers to rotate. So, here you go.
Code:
public final int rightTrigger = 4;
public final int leftTrigger = 5;
int rotationDirection;
if(stick.getRawButton(rightTrigger)) {
rotationDirection=1;
}
if(stick.getRawButton(leftTrigger)) {
rotationDirection=-1;
else{
rotationDirection=0;
}
robotDrive.mecanumDrive_Cartesian(-stick.getY(), -stick.getX(), rotationDirection, 1);
This will make it so that your robot rotates when you push the triggers but removes any functionality of the z-axis. I'm not sure if this is what you wanted. Also, just change around the button numbers for the triggers.
Btw, you wouldn't have to invert the Y and X axis if you put the ports in as 0-3 -- frontleft, rearLeft, frontRight, rearRight
Just found this:
https://github.com/FRC3571/2015/blob...ontroller.java
It might help but thank Team 3571.