0

I have been trying to develop a Pedestrian Dead Reckoning application for Android, and after taking care of the step detection and step length components, I have decided to tackle the orientation determination problem.

After stumbling on a couple of posts regarding coordinate transformation (and even chatting with a frequent answerer), I have been getting gradually better results, but the are still some things that bother me.

The experiment:

I walked forward Northward, turned back, and walked back Southward. Repeated the procedure towards West , then East.

Issues:

  1. I expected, while walking straight in several directions, to have values of the X and Y values oscillate with the footsteps, and have a relatively stable Z value throughout. Instead, the Y values behave this way, with the Z value having its expected behavior. How come? Does it have anything to do with me not using remapCoordinates()? (see Graph 1)

  2. I expected the angle plots to jump around 180º and -180º, but why do they also do it around 35º? (see Graph 2)

Notes:

  • I am using gravity and magnetometer values to compute the rotation matrix, and multiplying it using OpenGL's multiplyMV();
  • I am not using remapCoordinates(), because I thought I didn't need to: the phone is upright in my pocket (Y points up/down, Z usually forward) and should displace itself 45º forwards backwards and forwards, at worst;
  • Azimuth values seem ok, and do not have the oscillation described in issue 2. (see Graph 3)

Graphs:

World Reference Gravity Acceleration World reference frame acceleration (blue is X, red is Y, green is Z)

World Reference Gravity Angles Atan2 values from the world coordinates (blue is atan2(Y/X), red is atan2(Z/Y) and green is atan2(Z/X) )

Orientation Values Orientation values (blue is azimuth, red is pitch and green is roll)

Community
  • 1
  • 1
ravemir
  • 1,153
  • 2
  • 13
  • 29
  • I have no idea what your graph means. What is the x and y axis represent and what are the colors indicate? – Hoan Nguyen Apr 21 '13 at 20:47
  • You can click the graphs to see a larger view. But the first one has world reference acceleration values computed from the rotation matrix using gravity values (blue is X, red is Y, green is Z). The second is the atan2 values computed with the above acceleration (blue is Y/X, red is Z/Y and green is Z/X). Finally, the third one is the *getOrientation()* values (blue is azimuth, red is pitch and green is roll). – ravemir Apr 22 '13 at 10:55
  • For question 1 what is the position of the phone in the pocket? the phone screen is facing the same direction as the walker? – Hoan Nguyen Apr 22 '13 at 21:47
  • Usually, the phone is in the portrait position, screen facing the user (thus, against the direction of movement). Does the screen orientation make a difference? What about if we only need the relative orientation? (meaning with respect to the start) – ravemir Apr 22 '13 at 22:13
  • Is the graph measure only walking northward or including all data? – Hoan Nguyen Apr 22 '13 at 22:24
  • For question 1 you do not need to remap coordinate. You expect that Y would exhibit some periodic behavior (walking gait). Z also change periodically since the up and down movement introduces acceleration in the gravity direction. The X depends on how the walker swing his or her leg but should also be kind of periodic. – Hoan Nguyen Apr 22 '13 at 22:59
  • No phone orientation does not make any difference at least for question 1 if X,Y,Z are the world coordinates. – Hoan Nguyen Apr 23 '13 at 00:36
  • One thing I didn't mention was that I make the projection to world coordinates by multiplying the rotational matrix with the gravity vector. May this aspect be influencing the weird behavior of the Y and Z plots of the first graph? – ravemir Apr 23 '13 at 10:39
  • And yes: the graphs plot over all the data, not just a series of steps – ravemir Apr 23 '13 at 17:22
  • I do not think straight the last couple of days. When my head is clearer I give you more comments. I think you should plot your graph for walking in each direction separately first. Do you mean by "multiply the rotational matrix with the gravity vector" that you pass the gravity vector to the getRotationMatrix? – Hoan Nguyen Apr 23 '13 at 18:23
  • No. I do pass the gravity vector to the *getRotationMatrix()* method, as it should give more precise results. What I meant was that I then multiplied that rotation matrix by that same gravity vector (I used the unfiltered acceleration in previous instances, and when I decided to replace to get extra precision, I mistakenly replaced that). Meanwhile, I yesterday corrected that multiplication to be done on the LINEAR_ACCELERATION sensor (acceleration - gravity), but the values still seem weird. Will post the graphs in a second. – ravemir Apr 24 '13 at 09:54
  • And by all means, do take your time. Maybe it is my own lack of time that might be clouding my judgement on what is missing/wrong. – ravemir Apr 24 '13 at 09:55
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/28793/discussion-between-ravemir-and-hoan-nguyen) – ravemir Apr 24 '13 at 10:18
  • Posted the plots with each component separated, as requested, in the chat room. – ravemir Apr 26 '13 at 15:50
  • 1
    I add a new message, should check the chat room when log in. – Hoan Nguyen Apr 26 '13 at 17:29

0 Answers0