1 /* 2 * Copyright 2007-2008 Volker Fritzsch 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package motej; 17 18 /** 19 * Calibration data for the onboard accelerometer (as stored in the Wiimote's 20 * memory, starting at address 0x16 and repeated at 0x20). 21 * <p> 22 * 23 * @author <a href="mailto:vfritzsch@users.sourceforge.net">Volker Fritzsch</a> 24 */ 25 public class CalibrationDataReport { 26 27 private int zeroX; 28 29 private int zeroY; 30 31 private int zeroZ; 32 33 private int gravityX; 34 35 private int gravityY; 36 37 private int gravityZ; 38 39 public CalibrationDataReport(int zeroX, int zeroY, int zeroZ, 40 int gravityX, int gravityY, int gravityZ) { 41 this.zeroX = zeroX; 42 this.zeroY = zeroY; 43 this.zeroZ = zeroZ; 44 this.gravityX = gravityX; 45 this.gravityY = gravityY; 46 this.gravityZ = gravityZ; 47 } 48 49 /** 50 * Calibrated force of gravity for the accelerometers X axis. 51 * 52 * @return the force of gravity X axis 53 */ 54 public int getGravityX() { 55 return gravityX; 56 } 57 58 /** 59 * Calibrated force of gravity for the accelerometers Y axis. 60 * 61 * @return the force of gravity Y axis 62 */ 63 public int getGravityY() { 64 return gravityY; 65 } 66 67 /** 68 * Calibrated force of gravity for the accelerometers Z axis. 69 * 70 * @return the force of gravity Z axis 71 */ 72 public int getGravityZ() { 73 return gravityZ; 74 } 75 76 /** 77 * Calibrated zero offsets for the accelerometers X axis. 78 * 79 * @return zero offset X axis 80 */ 81 public int getZeroX() { 82 return zeroX; 83 } 84 85 /** 86 * Calibrated zero offsets for the accelerometers Y axis. 87 * 88 * @return zero offset Y axis 89 */ 90 public int getZeroY() { 91 return zeroY; 92 } 93 94 /** 95 * Calibrated zero offsets for the accelerometers Z axis. 96 * 97 * @return zero offset Z axis 98 */ 99 public int getZeroZ() { 100 return zeroZ; 101 } 102 103 @Override 104 public String toString() { 105 return "CalibrationDataReport[zeroPointAxisX: " + zeroX 106 + ", zeroPointAxisY: " + zeroY + ", zeroPointAxisZ: " + zeroZ 107 + ", plusOneGPointAxisX: " + gravityX 108 + ", plusOneGPointAxisY: " + gravityY 109 + ", plusOneGPointAxisZ: " + gravityZ + "]"; 110 } 111 }