Skip to content

Commit abcd3f5

Browse files
BenjaminReenKHanfBauer
authored andcommitted
comments
1 parent 06559e8 commit abcd3f5

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

app/src/main/java/de/htwberlin/f4/ai/ma/android/sensors/compass/CompassFusion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public void onSensorChanged(SensorEvent sensorEvent) {
208208
// the normal camera on the backside of the phone points away from the user.
209209
// if yes, we have to remap the axis.
210210
// Now the azimuth is calculated relative to the camera(on the backside) / z axis of the phone.
211-
// we remap the earth coordinates z axis on the phones y axis and calculate the correct azimuth
211+
// we remap the z axis on the y axis and calculate the correct azimuth
212212
// IMPORTANT: SCREEN MUST POINT TOWARDS USER
213213
if (Math.abs(pitch) > 70) {
214214
SensorManager.remapCoordinateSystem(remapped, SensorManager.AXIS_X, SensorManager.AXIS_Z, remapped);

app/src/main/java/de/htwberlin/f4/ai/ma/android/sensors/compass/CompassSimple.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public void onSensorChanged(SensorEvent sensorEvent) {
223223
// the normal camera on the backside of the phone points away from the user.
224224
// if yes, we have to remap the axis.
225225
// Now the azimuth is calculated relative to the camera(on the backside) / z axis of the phone.
226-
// we remap the earth coordinates z axis on the phones y axis and calculate the correct azimuth
226+
// we remap the z axis on y axis and calculate the correct azimuth
227227
// IMPORTANT: SCREEN MUST POINT TOWARDS USER
228228
if (Math.abs(pitch) > 70) {
229229
SensorManager.remapCoordinateSystem(remapped, SensorManager.AXIS_X, SensorManager.AXIS_Z, remapped);

app/src/main/java/de/htwberlin/f4/ai/ma/measurement/IndoorMeasurement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Used to determine the position and handle all sensor stuff
1616
*
17-
* Calculate position in cartesian coordinate system
17+
* Calculate position in cartesian coordinate system using dead reckoning
1818
*
1919
* Author: Benjamin Kneer
2020
*/

app/src/main/java/de/htwberlin/f4/ai/ma/measurement/WKT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* WKT Class
55
*
6-
* Used to create transform coordinates <-> WKT String
6+
* Used to create / transform coordinates <-> WKT String
77
*/
88

99
public class WKT {

app/src/main/java/de/htwberlin/f4/ai/ma/measurement/modules/variant_a/PositionModuleA.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,18 @@ public PositionModuleA(Context context, CalibrationData calibrationData) {
6060
*/
6161
@Override
6262
public float[] calculatePosition() {
63-
6463
// calculate new position with these 3 values
65-
// altitude = delta z
66-
float altitude = altitudeModule.getAltitude();
64+
float deltaZ = altitudeModule.getAltitude();
6765
float distance = distanceModule.getDistance(calibrationData.isStairs());
6866
float[] orientation = orientationModule.getOrientation();
6967

7068
// beta = azimuth
71-
float beta = orientation[0];
69+
double beta = orientation[0];
7270
double sinbeta = Math.sin(Math.toRadians(beta));
7371
double cosbeta = Math.cos(Math.toRadians(beta));
7472

7573
// calculate inclination angle (alpha)
76-
double alpha = Math.asin(altitude / distance);
74+
double alpha = Math.asin(deltaZ / distance);
7775
double cosalpha = Math.cos(alpha);
7876

7977
// calculate delta x and delta y
@@ -82,7 +80,7 @@ public float[] calculatePosition() {
8280

8381
coordinates[0] += deltaX;
8482
coordinates[1] += deltaY;
85-
coordinates[2] += altitude;
83+
coordinates[2] += deltaZ;
8684

8785
return coordinates;
8886
}

0 commit comments

Comments
 (0)