package adaptive.ports;

/************************************************************
 This class is more or less a wrapper for the Pioneer commands.

 Methods in this class allow construction, setting, reading.

 ***********************************************************/
public class PioneerCommand implements java.io.Serializable{

  private float v;
  private float w;


  public PioneerCommand() {
    v=0.0f;
    w=0.0f;
    return;
  }

  public PioneerCommand(float vinit, float winit) {
    this.v = vinit;
    this.w = winit;
    return;
  }

  public PioneerCommand(PioneerCommand tc) {
    this.v = tc.v;
    this.w = tc.w;
    return;
  }



  public void setCommand(float vcmd, float wcmd) {
    this.v = vcmd;
    this.w = wcmd;
    return;
  }

  public void setCommand(PioneerCommand tc) {
    this.v = tc.getV();
    this.w = tc.getW();
    return;
  }


  public float getV() {
    return this.v;
  }

  public float getW() {
    return this.w;
  }

  public PioneerCommand getCurrent () {
    return new PioneerCommand(this);
  }

  public String toString () {
    return new String("v="+v+"  w="+w);
  }

} //end class PioneerCommand
