import nddsJava.*;
import Telemetry.*;
import tools.*;

public class kvhDerivedStateCallback extends nddsCallback {
  // This constructor is required for any class that extends nddsCallback
  public kvhDerivedStateCallback(kvhDerivedState msg) {
    super(msg);
  }

  public void exec(Object o) {
    kvhDerivedState m = (kvhDerivedState) msg;
    NomadFrame nframe = (NomadFrame)o;

    // roll/pitch come in as 100*radians (int)... convert to degrees (double)
    nframe.setRoll(Format.round(Math.toDegrees(((double)m.roll)/100.0),1));
    nframe.setPitch(Format.round(Math.toDegrees(((double)m.pitch)/100.0),1));
  }
}
