Algorithm 1: The proposed trajectory recording algorithm. | |
Input: Gyroscope sensor G, Accelerometer sensor AC, destination D | |
Output: Stack S that contains the set of instructions, I(A, SC, , where A, SC, , P are the variables for the action, step count, compass direction, and position, respectively. | |
Procedure: | |
1. | Initialize A ← null, , , SC ← 0, P(, ) ← (0,0); |
2. |
// Determine the action type If AC < 0.03, then A ← Stop |
3. | else if then A ← Turn |
4. | else A ← Go-straight |
5. |
//Estimate the instruction parameters according to the action type if A is Go-straight, then SC, , is updated by the following equation: |
6. | else if A is Turn, then |
7. | PushI(A, SC, to S |
8. |
//check if the current positioning information is the destination (the positioning information is obtained by recognizing the QR codes) if the current location is destination, then terminate |
9. | else Go to Line 2 |