Ejemplo n.º 1
0
  /*
   * If vx=0 and vy=0, and omega=100 the robot will rotate
   * counterclockwise at roughly its maximum speed.  If vx=0 and
   * vy=100 and omega=0, the robot will go "north" at roughly
   * its maximum speed.
   */
  public void vectorDrive(int vx, int vy, int omega) {
    int bb = 72 * omega;
    int bx = 50 * vx;
    int by = 87 * vy;

    servoDirect.setPosition(scaleToServoSpeed(((-100 * vx) + bb) / 100), 0);
    servoDirect.setPosition(scaleToServoSpeed(((bx - by) + bb) / 100), 1);
    servoDirect.setPosition(scaleToServoSpeed(((bx + by) + bb) / 100), 2);
  }
Ejemplo n.º 2
0
 /*
  * Drive directly drives the servo's
  */
 public void drive(int x, int y, int z) {
   servoDirect.setPosition(scaleToServoSpeed(x), 0);
   servoDirect.setPosition(scaleToServoSpeed(y), 1);
   servoDirect.setPosition(scaleToServoSpeed(z), 2);
 }
Ejemplo n.º 3
0
 /**
  * TODO METHOD: DOCUMENT ME!
  *
  * @param value TODO PARAM: param description
  * @param servo TODO PARAM: param description
  */
 public void setServo(int value, int servo) {
   servoDirect.setPosition(value, servo);
 }