Subversion Repositories Projects

Rev

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

Rev Author Line No. Line
1540 - 1
package dongfang.mkt.frames;
2
 
3
public class AttitudeDataResponseFrame extends ResponseFrame {
1695 - 4
        private float[] attitude;
5
        private float[] rates;
6
        private float[] acc;
1540 - 7
 
8
        public AttitudeDataResponseFrame(int address) {
9
                super(address);
10
        }
11
 
12
        @Override
13
        public boolean isResponseTo(RequestFrame r) {
14
                return r instanceof AttitudeDataRequestFrame;
15
        }
16
 
1695 - 17
        public float[] getAttitude() {
18
                return attitude;
1540 - 19
        }
20
 
1695 - 21
        public void setAttitude(float[] attitude) {
22
                this.attitude = attitude;
1540 - 23
        }
24
 
1695 - 25
        public float[] getRates() {
26
                return rates;
1540 - 27
        }
28
 
1695 - 29
        public void setRates(float[] rates) {
30
                this.rates = rates;
1540 - 31
        }
32
 
1695 - 33
        public float[] getAcc() {
34
                return acc;
1540 - 35
        }
36
 
1695 - 37
        public void setAcc(float[] acc) {
38
                this.acc = acc;
1540 - 39
        }
1695 - 40
 
41
        public String toString() {
42
                String result =  "pitch: " + attitude[0] + ", roll: " + attitude[1] + ", yaw: " + attitude[2];
43
                result += ", pitchRate: " + rates[0] + ", rollRate: " + rates[1] + ", yawRate: " + rates[2];
44
                result += ", X: " + acc[0] + ", Y: " + acc[1] + ", Z: " + acc[2];
45
                return result;
1540 - 46
        }
47
}