There is lots to like about your code. It's well organized and generally easy to read. A couple specific comments:
1. We like to use constants in RobotMap.java, organized by kind of interface. We can then print this out and use it as instructions for wiring.
For example:
Code:
/**
* PWM */
public static final int CHASSIS_JAGUAR_FRONT_LEFT = 2;
public static final int CHASSIS_JAGUAR_BACK_LEFT = 3;
public static final int CHASSIS_JAGUAR_FRONT_RIGHT = 0;
public static final int CHASSIS_JAGUAR_BACK_RIGHT = 1;
public static final int BALL_SHOOTER_LEFT_SPEED_CONTROLLER = 4;
public static final int BALL_SHOOTER_RIGHT_SPEED_CONTROLLER = 5;
public static final int ARM_EXTEND_SPEED_CONTROLLER = 6;
public static final int CAMERA_TILT_MOTOR = 7;
I'd then recommend moving the declarations out of RobotMap and into the subsystem that owns the device/controller. We generally make each controller/encoder/gyro be owned by exactly one subsystem, and hide the reference inside the subsystem (make them private). This way we know that there's only one place to look for code that changes those entities.
You're almost there with your final references in the subsystems, but they are copies of reference and the actual controller/encoder/gyro is available to everyone.
2. In AvancerHerse, consider using more descriptive variable names:
Code:
int h1 = 950;
int h2 = 450;
and think about simplifying "!(Robot.bras.distPot() < h1)" a bit:
Code:
if (!Robot.pelle.herseAcotee()) {
// h1, h2 = hauteur pelle
if ((Robot.bras.distPot() > h1)) {
Robot.chassis.reculer(-0.4, 0);
} else if ((Robot.bras.distPot() > h2) && !(Robot.bras.distPot() < h1)) {
Robot.chassis.reculer(-0.6, 0);
} else {
Robot.chassis.reculer(-0.9, 0);
}
}
3. In BrasCommand, you say:
Code:
Timer.delay(0.005);
Wondering why this is necessary here and in the other places in the code. Delay like this is needed only in very specialized cases.
4. In BrasCommand, you didn't put this in braces:
Code:
} else
Robot.bras.controlBras(0);
For student code, I recommend that every block be enclose in braces as it's consistent and simple to think about.
5. Generally you want the same code in end() and interrupted() -- see Reculer.