Subversion Repositories Projects

Rev

Rev 1540 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package dongfang.mkt.frames;

public class AttitudeDataResponseFrame extends ResponseFrame {
        private float[] attitude;
        private float[] rates;
        private float[] acc;
       
        public AttitudeDataResponseFrame(int address) {
                super(address);
        }

        @Override
        public boolean isResponseTo(RequestFrame r) {
                return r instanceof AttitudeDataRequestFrame;
        }

        public float[] getAttitude() {
                return attitude;
        }

        public void setAttitude(float[] attitude) {
                this.attitude = attitude;
        }

        public float[] getRates() {
                return rates;
        }

        public void setRates(float[] rates) {
                this.rates = rates;
        }

        public float[] getAcc() {
                return acc;
        }

        public void setAcc(float[] acc) {
                this.acc = acc;
        }
       
        public String toString() {
                String result =  "pitch: " + attitude[0] + ", roll: " + attitude[1] + ", yaw: " + attitude[2];
                result += ", pitchRate: " + rates[0] + ", rollRate: " + rates[1] + ", yawRate: " + rates[2];
                result += ", X: " + acc[0] + ", Y: " + acc[1] + ", Z: " + acc[2];
                return result;
        }
}