A Measurement Method of Levelness
It is of great significance to reduce the development cost and difficulty of a levelness measurement system based on an Android Phone. In order to solve the difficulty of using Java language to develop a levelness measurement system, this paper pro poses a method based on S L4 A direction sensor and scripting languages to solve the problem. We first use sl4a to read data from an android phone direction sensor, and then use median filter to filter out noise of data, and finally work out inclination of the phone . The me thod is de ve l ope d and te ste d by the PHP scripting language .The experimental results show that the method is simple, fast, reusable and scalable.
The method of this paper is tested and passed in the platform of Xiaomi 1s smartphone( 1.3Gh z quad-core CPU, 1.00GB memory, 8G sdcard) + Android 4.4.2 + SL4A + PFA +RHINO. A screenshot of inclination measure of an Android phone is shown in Fig.2. This screenshot shows that the BC edge of the phone is located above the AD edge of the phone, the inclination is 6.14 degrees, and the AB edge of the phone is located above the DC edge of the phone, the inclination is 1.61 degrees. The tilt state of the phone in the screenshot is consistent with the tilt state of the physical phone. Keep water in a glass and refer to the horizontal surface of water in the glass and place a phone horizontally, and the tilt angle of the phone measured by the method of this paper is between 0 and 1 degrees. Place a phone vertically, with the BC edge above the AD edge. The tilt angle of the phone measured by the method of this paper is between 89 and 90 degrees. Place a phone vertically, with the AB edge above the DC edge. The tilt angle of the phone measured by the method of this paper is between 89 and 90 degrees.
In this paper, the phone levelness measurement system based on SL4A director sensor was design and developed. The system has the advantages of simple realization, convenient carrying and convenient measurement etc. And it is suitable for the applications of daily life with low measuring precision, for examp le, hanging objects on the wall. The disadvantage of this method is that the measurement accuracy is not high enough and the system is difficu lt to be applied in the engineering fields with high precision. The next step is to improve the measurement accuracy.