Posted 01 October 2023
After solving the problems described at the bottom of my “Responding to Steerval out of Range” post, I was able to get WallE3 to successfully enter our small guest bedroom, as shown in the following short video:
Unfortunately the robot wasn’t really tracking the left ‘wall’ (door surface) – it was just going straight until it ran into the trashcan, and then couldn’t figure out what to do next. As I worked with the code I got WallE3 to track the door OK, but then it still had problems with the trashcan and cupboard. Rather than starting in the hallway for each test, I decided to emulate the configuration in my office for more rapid iterations. Here’s the actual guest bedroom configuration:
And here is the simulated guest room configuration in my office:
And here is a short video showing a mostly successful run in the above simulated guest room configuration:
The telemetry from the run is shown below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
TrackLeftWallOffset: Start tracking offset of 30cm at 0.5 Just after CaptureWallOffset(TRACKING_LEFT, 13.8) Sec LCen RCen Deg LF LR LStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR 0.6 13.6 344.9 0.5 13.2 13.5 -0.03 75 27 80609 12750 127 0 NONE LEFT 0.7 13.9 341.0 5.5 13.4 13.3 0.01 75 27 81582 12690 127 0 NONE LEFT 0.8 13.6 306.6 14.5 14.0 13.3 0.07 72 27 83802 12690 127 0 NONE LEFT 0.9 14.9 291.4 25.5 15.1 12.9 0.22 75 38 86981 12693 118 32 NONE LEFT 1.0 16.0 313.9 36.1 18.1 14.7 0.34 82 95 90868 12497 76 73 NONE LEFT 1.1 19.7 269.8 41.0 23.8 17.4 0.61 87 17 95210 12696 0 127 NONE LEFT 1.2 25.4 260.0 39.5 27.5 21.7 0.58 81 21 100160 12947 0 127 NONE LEFT 1.3 27.1 268.5 33.7 29.9 24.7 0.52 71 29 105636 13189 0 127 NONE LEFT 1.4 27.7 313.0 25.0 28.8 25.8 0.30 62 38 111417 13414 17 127 NONE LEFT 1.5 27.9 283.1 14.6 28.6 26.1 0.25 53 85 117277 13444 28 121 NONE LEFT 1.6 27.6 295.9 4.4 27.8 26.3 0.15 46 58 122769 13588 50 99 NONE LEFT 1.7 27.8 301.2 -2.8 26.9 27.8 -0.09 43 61 127512 13773 124 25 NONE LEFT 1.8 29.1 183.3 -3.6 27.3 28.9 -0.16 39 108 131187 13852 127 6 NONE LEFT 1.9 28.1 168.1 -1.0 26.7 28.3 -0.16 36 116 133456 13831 127 0 NONE LEFT 2.0 28.4 193.8 4.5 26.6 27.9 -0.13 32 78 133976 13981 127 8 NONE LEFT 2.1 28.0 244.3 11.9 28.1 27.3 0.08 28 79 132358 14170 63 86 WALL_OFFSET_DIST_AHEAD LEFT Stopping Motors! Error Code is 4 --> WALL_OFFSET_DIST_AHEAD 2.1: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 8.03 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 2.5: gl_Left/RightCenterCm = 31.3/306.4, Left/RightSteerVal = 0.16/-0.06 In HandleAnomalousConditions(LEFT) with last anomaly code = WALL_OFFSET_DIST_AHEAD ANOMALY_WALL_OFFSET_DIST_AHEAD case detected with tracking case LEFT In BackupAndTurn90Deg(CW)with front distance = 19 MTFD: at start, tgt = 30cm, curr_dist = 20, front/rear var = 83325/13332 MTFD: Stopped with front dist = 28, anomaly code = WALL_OFFSET_DIST_AHEAD In SpinTurn(CW, 90.00, 45.00) with PID = (0.7,0.3,0.0) BackupAndTurn90Deg finished 7.0: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 8.03 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 7.5: gl_Left/RightCenterCm = 31.0/48.7, Left/RightSteerVal = 0.44/1.00 In HandleAnomalousConditions(NEITHER) with last anomaly code = NONE In HandleAnomalousConditions(NEITHER) ANOMALY_NONE CASE 7.6: gl_Left/RightCenterCm = 30.6/49.2, Left/RightSteerVal = 0.46/1.00 gl_LeftCenterCm <= gl_RightCenterCm --> Calling TrackLeftWallOffset() TrackLeftWallOffset(350.0, 0.0, 20.0, 30) called TrackLeftWallOffset: Start tracking offset of 30cm at 7.6 Just after CaptureWallOffset(TRACKING_LEFT, 30.6) Sec LCen RCen Deg LF LR LStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR 7.7 30.5 48.8 118.7 32.6 28.8 0.38 318 27 142251 13936 0 127 NONE LEFT 7.8 30.3 51.6 115.0 31.6 28.9 0.32 314 27 137348 14400 0 127 NONE LEFT 7.9 29.9 70.0 106.7 30.1 27.4 0.27 326 26 130804 14878 9 127 NONE LEFT 8.0 28.6 105.7 96.3 28.3 27.5 0.08 589 26 124449 15369 59 90 NONE LEFT 8.1 27.7 95.1 91.0 28.0 27.4 0.06 449 26 120105 15615 74 75 NONE LEFT 8.2 28.5 152.3 86.9 27.2 28.1 -0.09 159 30 101869 16325 120 29 NONE LEFT 8.3 27.8 150.4 88.3 27.4 28.5 -0.11 158 34 85524 16762 127 9 NONE LEFT 8.4 27.8 150.9 93.1 27.2 27.9 -0.04 414 38 66390 17165 111 38 NONE LEFT 8.5 28.2 150.4 97.0 27.8 27.8 0.00 523 43 57331 17347 90 59 NONE LEFT 8.6 28.7 154.5 100.9 29.0 28.2 0.08 562 49 38263 17671 62 87 NONE LEFT 8.7 30.4 161.5 101.3 30.4 29.2 0.12 366 55 32378 17942 40 109 NONE LEFT 8.8 30.6 155.7 100.4 30.3 29.5 0.08 540 58 34699 18061 46 103 NONE LEFT 8.9 32.0 152.3 97.0 31.7 31.0 0.07 560 64 39246 18251 37 112 NONE LEFT 9.0 32.6 148.9 93.6 31.5 31.8 -0.03 456 68 41630 18397 70 79 NONE LEFT 9.1 32.9 147.8 91.8 32.0 32.2 -0.02 391 72 41222 18493 66 83 NONE LEFT 9.2 32.9 154.1 90.0 31.5 32.7 -0.12 369 76 39471 18539 110 40 NONE LEFT Stopping Motors! Error Code is 8 --> EXCESS_STEER_VAL 9.3: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 8.01 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 9.7: gl_Left/RightCenterCm = 14.9/161.8, Left/RightSteerVal = 0.16/0.28 In HandleAnomalousConditions(LEFT) with last anomaly code = EXCESS_STEER_VAL In HandleAnomalousConditions(LEFT) ANOMALY_EXCESS_STEER_VAL CASE- Top of HandleExcessSteervalCase(LEFT) 10575: gl_Left/RightCenterCm = 20.6/194.7, Left/RightSteerVal = 0.01/0.28 TrackLeftWallOffset(350.0, 0.0, 20.0, 30) called TrackLeftWallOffset: Start tracking offset of 30cm at 10.6 Just after CaptureWallOffset(TRACKING_LEFT, 20.6) Sec LCen RCen Deg LF LR LStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR 10.7 20.6 199.3 87.3 20.4 21.4 -0.10 83 127 35187 18236 127 0 NONE LEFT 10.8 21.1 197.8 93.2 21.2 21.0 0.02 337 128 32700 17978 127 17 NONE LEFT 10.9 21.9 187.8 99.2 22.7 20.9 0.08 450 131 31792 17828 111 38 NONE LEFT 11.0 23.7 171.1 109.0 25.1 22.1 0.30 281 45 27791 17386 44 105 NONE LEFT 11.1 24.8 165.7 111.5 26.2 22.0 0.42 261 37 24503 17137 16 127 NONE LEFT 11.2 26.9 166.3 109.9 28.4 24.5 0.39 268 40 21065 16780 1 127 NONE LEFT 11.3 29.0 171.8 104.8 30.3 26.6 0.34 266 46 18414 16298 0 127 NONE LEFT 11.4 29.9 177.0 96.8 30.1 28.0 0.21 478 140 18987 15624 22 127 NONE LEFT 11.5 30.1 191.5 89.2 29.8 29.1 0.07 312 155 18970 14849 49 100 NONE LEFT 11.6 30.5 160.4 82.9 29.8 29.8 0.00 82 157 20365 13989 76 74 NONE LEFT 11.7 31.0 169.1 81.3 29.1 30.7 -0.16 61 160 23232 13041 127 20 NONE LEFT 11.8 30.5 196.7 83.0 31.0 30.1 0.09 63 166 24121 12004 48 101 NONE LEFT 11.9 33.2 196.2 84.4 34.6 30.3 0.52 87 172 25382 10878 0 127 NONE LEFT 12.0 35.7 202.3 82.1 34.1 34.3 -0.02 57 175 26877 9658 43 107 NONE LEFT 12.1 36.0 205.8 77.8 33.4 36.1 -0.25 35 181 28785 8345 127 10 NONE LEFT Stopping Motors! Error Code is 4 --> WALL_OFFSET_DIST_AHEAD In ChooseBetterTrackingSide with avg hdg = 93.1 TurnToHdgDeg: currHdg = 77.3, tgtHdg = 93.1, retries = 0 In SpinTurn(CW, 15.74, 45.00) with PID = (0.7,0.3,0.0) In SpinTurn(CCW, 10.00, 45.00) with PID = (0.7,0.3,0.0) In ChooseBetterTrackingSide: hdg = 84.2, left/right dists = 31.0/207.1, numleftright = 1/0 In SpinTurn(CCW, 10.00, 45.00) with PID = (0.7,0.3,0.0) In ChooseBetterTrackingSide: hdg = 73.9, left/right dists = 7.0/210.5, numleftright = 2/0 In SpinTurn(CCW, 10.00, 45.00) with PID = (0.7,0.3,0.0) In ChooseBetterTrackingSide: hdg = 63.3, left/right dists = 2.0/220.2, numleftright = 3/0 In SpinTurn(CCW, 10.00, 45.00) with PID = (0.7,0.3,0.0) In ChooseBetterTrackingSide: hdg = 52.5, left/right dists = 4.0/171.2, numleftright = 4/0 In SpinTurn(CCW, 10.00, 45.00) with PID = (0.7,0.3,0.0) In ChooseBetterTrackingSide: hdg = 42.6, left/right dists = 6.0/162.7, numleftright = 5/0 In SpinTurn(CCW, 10.00, 45.00) with PID = (0.7,0.3,0.0) In ChooseBetterTrackingSide: hdg = 32.4, left/right dists = 14.0/169.4, numleftright = 6/0 In SpinTurn(CCW, 10.00, 45.00) with PID = (0.7,0.3,0.0) In ChooseBetterTrackingSide: hdg = 22.0, left/right dists = 12.0/219.2, numleftright = 7/0 In SpinTurn(CCW, 10.00, 45.00) with PID = (0.7,0.3,0.0) In ChooseBetterTrackingSide: hdg = 11.4, left/right dists = 9.0/297.5, numleftright = 8/0 In SpinTurn(CCW, 10.00, 45.00) with PID = (0.7,0.3,0.0) In ChooseBetterTrackingSide: hdg = 0.9, left/right dists = 13.0/257.7, numleftright = 9/0 TurnToHdgDeg: currHdg = -1.1, tgtHdg = 93.1, retries = 0 TTHD: curr/tgt/turndeg = -1.1/93.1/-94.2 In SpinTurn(CW, 94.16, 45.00) with PID = (0.7,0.3,0.0) ChooseBetterTrackingSide 'left' block with numleft/rightwallsegments = 9/0 HandleExcessSteervalCase(LEFT): ChooseBetterTrackingSide() returned TrackLeftWallOffset(350.0, 0.0, 20.0, 30) called TrackLeftWallOffset: Start tracking offset of 30cm at 17.9 Calling CaptureWallOffset(TRACKING_LEFT, 197.9) Hdg Dist In SpinTurn(CCW, 90.00, 45.00) with PID = (0.7,0.3,0.0) After SpinTurn, Hdg/Dist = 4.1/13 MTFD: at start, tgt = 30cm, curr_dist = 13, front/rear var = 83325/13332 MTFD: Stopped with front dist = 30, anomaly code = WALL_OFFSET_DIST_AHEAD In SpinTurn(CW, 90.00, 45.00) with PID = (0.7,0.3,0.0) In RotateToParallelOrientation(LEFT) In SpinTurn(CCW, 23.43, 23.43) with PID = (0.7,0.3,0.0) End of CaptureWallOffset Just after CaptureWallOffset(TRACKING_LEFT, 59.0) Sec LCen RCen Deg LF LR LStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR Stopping Motors! Error Code is 8 --> EXCESS_STEER_VAL 28.5: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 8.04 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 29.0: gl_Left/RightCenterCm = 59.5/190.1, Left/RightSteerVal = -1.00/0.35 In HandleAnomalousConditions(LEFT) with last anomaly code = EXCESS_STEER_VAL In HandleAnomalousConditions(LEFT) ANOMALY_EXCESS_STEER_VAL CASE- Top of HandleExcessSteervalCase(LEFT) 29806: gl_Left/RightCenterCm = 24.7/189.2, Left/RightSteerVal = -1.00/-0.16 TrackLeftWallOffset(350.0, 0.0, 20.0, 30) called TrackLeftWallOffset: Start tracking offset of 30cm at 29.8 Just after CaptureWallOffset(TRACKING_LEFT, 24.7) Sec LCen RCen Deg LF LR LStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR 29.9 19.2 184.2 67.3 16.2 22.5 -0.63 44 234 147193 5653 127 0 NONE LEFT 30.0 18.6 191.5 72.9 18.0 20.7 -0.27 54 246 146747 5337 127 0 NONE LEFT 30.1 16.5 196.6 81.9 15.4 18.0 -0.37 195 238 142179 5048 127 0 NONE LEFT 30.2 14.5 190.9 92.1 14.2 15.6 -0.14 231 240 135579 4786 127 0 NONE LEFT 30.4 12.9 186.6 104.6 12.0 14.4 -0.24 374 162 127388 4624 127 0 NONE LEFT 30.4 13.9 195.0 115.2 14.5 12.5 0.20 184 97 116615 4804 127 17 NONE LEFT 30.5 16.1 197.7 126.8 17.3 14.9 0.24 133 28 102982 5493 96 53 NONE LEFT 30.6 20.8 203.6 133.6 23.4 18.2 0.52 116 20 86002 6348 14 127 NONE LEFT 30.7 25.0 209.6 132.7 27.8 21.9 0.59 113 21 64995 7210 0 127 NONE LEFT 30.8 28.4 208.0 128.6 31.4 25.3 0.61 114 26 39494 8040 0 127 NONE LEFT 30.9 29.7 193.1 121.2 31.8 27.6 0.42 133 34 9081 8814 0 127 NONE LEFT 31.0 29.5 140.0 111.6 30.8 27.7 0.31 163 44 9071 9504 0 127 NONE LEFT 31.1 29.5 179.1 100.7 29.7 28.3 0.14 346 131 10100 9804 38 111 NONE LEFT 31.3 29.3 176.0 89.5 28.9 28.9 0.00 239 206 11460 9854 80 69 NONE LEFT 31.3 30.3 175.4 85.0 28.8 29.7 -0.09 197 274 11360 9892 106 43 NONE LEFT 31.4 30.3 174.5 85.6 28.8 29.9 -0.11 193 276 11083 9934 121 28 NONE LEFT 31.5 29.8 173.4 88.2 28.5 29.8 -0.13 194 283 10721 9988 127 16 NONE LEFT 31.7 28.7 175.5 93.1 28.1 28.8 -0.07 231 290 10407 10053 113 36 NONE LEFT 31.8 29.2 177.7 97.9 28.2 28.8 -0.06 349 278 11467 10103 103 46 NONE LEFT 31.8 29.6 179.4 101.8 28.9 28.6 0.03 325 204 11810 10105 73 76 NONE LEFT 31.9 31.9 181.6 103.9 180.6 29.8 1.00 314 117 11701 10230 0 127 EXCESS_STEER_VAL LEFT Stopping Motors! Error Code is 8 --> EXCESS_STEER_VAL |
The salient events from the telemetry:
- 0.6 – 2.1 sec: tracks left wall
- 2.1 sec: detects WALL_OFFSET_DIST_AHEAD anomaly.
- 2.1 – 7.6 sec recovers from WALL_OFFSET_DIST_AHEAD and starts tracking left wall again
- 7.7 – 9.2 sec tracks left wall (simulated doorway into guest br)
- 9.2 sec detects WALL_OFFSET_DIST_AHEAD anomaly (end of simulated door?)
- 9.3 – 10.7 sec: recovers from WALL_OFFSET_DIST_AHEAD and starts tracking left wall again
- 10.7 – 12.1 sec: tracks left wall
- 12.1 sec: detects WALL_OFFSET_DIST_AHEAD anomaly. I think this is caused by the box (the simulated near end of the cupboard). This time the anomaly recovery calls ChooseBetterTrackingSide() with an average heading value of 93.1º. The result of this algorithm is 9 votes for left side, 0 for right. The robot starts tracking the left wall with an initial offset of 17.9cm, which is too close, and this causes ‘CaptureWallOffset()’ to be called. CaptureWallOffset() makes a 90º CCW turn to face the left wall, and then calls ‘MoveToDesiredFrontDistCm()’ to move (backup) to a front distance of 30cm. Once this is accomplished, a 90º CW turn is made to re-parallel the left wall, and then ‘RotateToParallelOrientation(LEFT)’ is called to complete the orientation operation.
- 29.9 – 31.9 sec: tracks left wall (the simulated cupboard face).
- 31.9 sec: an EXCESS_STEER_VAL anomaly is detected after the robot runs off the end of the simulated cupboard face
02 October 2023 Update:
Having solved the problem of getting from the hallway into the guest bedroom, there remained the problem of negotiating a ‘cul-de-sac’ at the far end of the cupboard, which I simulated in my office as shown in the following video:
And here is the telemetry from the run:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
Sec LCen RCen Deg LF LR LStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR 0.6 35.1 125.7 0.3 32.3 35.3 -0.30 130 179 76572 11824 127 0 NONE LEFT 0.7 33.2 125.1 5.2 31.3 34.8 -0.35 129 179 75795 11129 127 0 NONE LEFT 0.8 33.5 117.0 13.6 31.8 33.1 -0.13 264 179 74595 10473 100 49 NONE LEFT 0.9 35.2 115.0 14.9 33.4 35.1 -0.17 255 165 72890 9874 112 37 NONE LEFT 1.0 34.5 113.5 16.1 33.2 34.4 -0.12 239 160 72396 9331 100 49 NONE LEFT 1.1 35.5 114.8 19.8 35.0 34.2 0.08 217 130 73306 8893 13 127 NONE LEFT 1.2 36.5 114.3 19.1 37.3 35.3 0.14 212 117 75169 8575 0 127 NONE LEFT 1.3 38.2 112.8 15.0 38.1 36.9 0.12 226 130 77361 8280 0 127 NONE LEFT 1.4 38.7 120.3 7.7 37.7 38.1 -0.04 104 205 81051 7854 32 118 NONE LEFT 1.5 39.6 135.4 -0.9 38.5 39.0 -0.05 99 204 86828 7456 29 120 NONE LEFT 1.6 39.8 156.8 -8.7 39.1 39.5 -0.04 95 97 92433 7348 28 121 NONE LEFT 1.7 40.9 159.3 -13.7 38.3 41.2 -0.29 92 100 97583 7350 127 9 NONE LEFT 1.8 41.1 151.3 -13.1 38.3 40.9 -0.26 87 109 102022 7350 117 33 NONE LEFT 1.9 39.4 137.9 -10.5 36.2 39.3 -0.31 82 110 105399 7373 127 0 NONE LEFT 2.0 37.4 135.6 -4.7 35.1 37.1 -0.20 76 116 107401 7412 112 38 NONE LEFT 2.1 35.2 133.3 1.8 34.0 34.9 -0.09 72 148 107677 7403 70 79 NONE LEFT 2.2 34.8 124.9 3.2 34.2 34.4 -0.02 68 238 105822 7247 53 96 NONE LEFT 2.3 35.5 131.5 2.6 34.4 34.7 -0.03 64 242 101419 7114 51 98 NONE LEFT 2.4 35.1 144.3 2.3 36.4 35.3 0.11 62 247 94046 7001 12 127 NONE LEFT 2.5 38.1 149.5 0.4 47.9 34.9 1.00 55 250 83327 6908 0 127 EXCESS_STEER_VAL LEFT Stopping Motors! Error Code is 8 --> EXCESS_STEER_VAL 2.5: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 7.92 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 2.9: gl_Left/RightCenterCm = 47.3/169.1, Left/RightSteerVal = 1.00/-0.10 In HandleAnomalousConditions(LEFT) with last anomaly code = EXCESS_STEER_VAL In HandleAnomalousConditions(LEFT) ANOMALY_EXCESS_STEER_VAL CASE- Top of HandleExcessSteervalCase(LEFT) 3786: gl_Left/RightCenterCm = 70.2/176.3, Left/RightSteerVal = -0.25/0.13 TrackLeftWallOffset(350.0, 0.0, 20.0, 30) called TrackLeftWallOffset: Start tracking offset of 30cm at 3.8 Calling CaptureWallOffset(TRACKING_LEFT, 70.2) Hdg Dist After SpinTurn, Hdg/Dist = -104.4/65 MTFD: at start, tgt = 30cm, curr_dist = 65, front/rear var = 83325/13332 MTFD: Stopped with front dist = 31, anomaly code = WALL_OFFSET_DIST_AHEAD In RotateToParallelOrientation(LEFT) End of CaptureWallOffset Just after CaptureWallOffset(TRACKING_LEFT, 21.6) Sec LCen RCen Deg LF LR LStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR Stopping Motors! Error Code is 4 --> WALL_OFFSET_DIST_AHEAD In ChooseBetterTrackingSide with avg hdg = -39.5 Stuck in ChooseBetterTrackingSide 'else' block with numleft/rightwallsegments = 9/9: Trying RunToDaylight! RunToDaylight() RotateToMaxDistance() left/right/front distances = 31.8/31.1/30 index Heading FrontD 0 -39.2 30 1 -49.5 28 2 -60.0 24 3 -70.7 21 4 -81.2 18 5 -92.5 19 6 -102.6 19 7 -112.6 21 8 -122.8 24 9 -132.9 27 10 -143.2 34 11 -153.8 33 12 -164.2 34 13 -175.4 32 14 173.8 33 15 163.7 75 16 153.8 171 17 144.1 306 18 134.1 216 19 123.7 214 20 113.9 231 21 104.2 212 22 94.4 215 23 83.6 222 24 72.7 55 25 61.7 35 26 52.1 27 27 41.1 21 28 30.6 19 29 20.1 18 30 9.6 17 31 -0.5 17 32 -11.0 17 33 -21.9 20 34 -32.4 24 35 -43.3 30 Idx/Hdg/FrontD = 0/-39.2/30 Idx/Hdg/FrontD = 10/-143.2/34 Idx/Hdg/FrontD = 15/163.7/75 Idx/Hdg/FrontD = 16/153.8/171 Idx/Hdg/FrontD = 17/144.1/306 RotateToMaxDistance: highdist = 306, highhdg = 144.1 RotateToMaxDistance: exiting with errorcode NONE at 144.3 deg and 278 Cm 55986: RunToDaylight after RotateToMaxDistance. bWallTrackAvailable = 0, loopErrCode = NONE 58029: In RunToDaylight with Left/Right dist = 56.3, 24.2 |
The robot tracks the left wall properly for the first 2.5sec, but then gets trapped in the ‘cul-de-sac’, and eventually resorts to calling a ‘RunToDaylight()’ function to get itself unstuck. RunToDaylight() calls ‘RotateToMaxDistance()’ which performs a full 360º rotation, memorizing the front distance and heading at each step. After the full rotation, the robot turns to the heading associated with the peak front distance and heads that way. As can be seen from the video, this works very well, but over the course of several runs the robot hit the corner of the wall a couple of times because the ‘peak’ heading was recorded just as the front distance sensor (but not necessarily the robot itself) cleared that corner. Here’s an excel plot that shows the issue.
Looking at the plot, it is clear that any heading from about 83 to 150º would suffice, so maybe picking the peak value isn’t so smart. Maybe picking the median value above some distance threshold (like maybe 1.5-2.0 meters) would be a better bet.
04 October 2023 Update:
As I was drifting off to sleep last night, I was mentally reviewing the above ‘run to daylight’ experiment and it struck me that WallE3 had ignored a perfectly good trackable wall segment (at about 31sec, step 22, 94.4º, 215cm in the above 360º search). It occurred to me that I should be searching for the point(s) where WallE3 is parallel or mostly parallel to a wall, with a meter or more of front distance available.
I think I might be able to use a “Figure of Merit” (FoM) defined as the front distance divided by the left or right steering value to detect the optimum travel direction. Steering values vary from 0 to +/-1 so it would need to be abs(FrontD/SteerVal), and it would be maximum at the point where steerval is minimum and front distance is maximum.
One fly in the ointment is the case where steerval is == 0; that would cause FrontD/steerval to be undefined – oops! So I think I need to modify the function that retrieves steervals from the Teensy to limit steerval to something like .001, so the FoM wouldn’t go above a few thousand (10/07/24 note: This was done in ‘GetRequestedVL53l0xValues()’)
Also, I need to figure out how to sort through the 360º search results. I would like to wind up with an array of steervals sorted in decreasing magnitude order, with a companion array of headings so Hdg[i] <–> Steerval[i]. Not sure how to do this yet, but it sounds promising!
07 October 2023 Update:
After some web searching and experimentation, I now have a program that can sort a ‘master’ array and one or more ‘slave’ arrays such that the slave array is rearranged into the same order as the master. See this post for all the gory details.
Now I think I have the tools to address the ‘guest bedroom problem’, as follows:
- Make the same 360º rotation as before, saving L/R steervals, headings, and front distances into separate 36-element arrays.
- Sort the above arrays, using front distances as the master, and the others as slaves.
- Find the element in the front distance array that is greater than a set threshold (say 150cm), has an associated steerval <= (MAX_STEERVAL / 2) and produces the highest ‘FoM’ as described above. Turn to the heading associated with this element, and start tracking that side.
- If no front distance element / steerval combination satisfies the above criteria, then turn to the heading associated with the middle element of the first/only set of front distance values above the above distance threshold and move forward until another anomaly is detected.
11 October 2023 Update:
I think I’m going to need to save/sort the L/R distances in addition the values listed above, for a total of six parameters; L/R distances, L/R steervals, Hdg, and Front distance. The FrontD array would be the ‘master’ array, and the other five would be ‘slave’ arrays. I could modify my current QuickSort() routine to do all five slave arrays at once (by adding four more ‘swap’ lines in two places in ‘partition’) but this would also require modifying the signatures of QuickSort(), partition() – yuk! I could also simply call ‘QuickSort()’ five times (once for each ‘slave’ array) with the unsorted FrontD array as the master each time. I like this latter approach as it preserves more of the generality of the ‘QuickSort()’ routine.
To do this, I’ll have to define all six arrays at global scope with the following memory requirements:
- uint16_t FrontD[36]: 2 bytes/value, 36 values –> 72 bytes
- float Hdg[36]: 4 bytes/value, 36 values –> 144 bytes
- float LeftSteer[36]: 4 bytes/value, 36 values –> 144 bytes
- float RightSteer[36]: 4 bytes/value, 36 values –> 144 bytes
- float LeftDist[36]: 4 bytes/value, 36 values –> 144 bytes
- float RightDist[36]: 4 bytes/value, 36 values –> 144 bytes
for a total of 4*144 + 72 = 648 bytes. The current memory requirements for WallE3_QuickSort_V3 on a Teensy 3.5 is:
1 2 3 4 |
Compiling 'WallE3_Quicksort_V3' for 'Teensy 3.5 (teensy35)' Program size: 115248 bytes (used 22% of a 524288 byte maximum) (1.59 secs) Minimum Memory Usage: 7728 bytes (3% of a 262136 byte maximum) |
So another 648 bytes is not going to be a problem. After defining and initializing the additional four arrays and recompiling, I got:
1 2 3 4 |
Compiling 'WallE3_Quicksort_V3' for 'Teensy 3.5 (teensy35)' Program size: 115312 bytes (used 22% of a 524288 byte maximum) (8.18 secs) Minimum Memory Usage: 8304 bytes (3% of a 262136 byte maximum) |
So the increase from 115248 to 115312 in program size and from 7728 to 8304 bytes wasn’t enough to even move the percentages – woohoo!
16 October 2023 Update:
After getting the ‘one master and five slave array’ quicksort algorithm working, I did some more testing in my office. The test configurations that featured side walls within tracking distance (100cm) worked very well; however, when I simulated the configuration where no trackable side walls could be found, the robot consistently failed to orient to the most open direction – instead it wound up pointing to one edge or the other of the ‘open direction’ wedge. The algorithm I was using was to use the heading associated with the middle entry of the first N (reverse sorted) front distances.
Then I tried using the middle entry of the first N (reverse sorted) heading values, where the group of heading values to be sorted were the ones associated with the above first N reverse-sorted front distances. However, this didn’t work either, because when I designed the experiment, the maximum distances naturally occurred around 180º from the starting orientation, and this meant that the first N headings included both positive and negative values. When reverse-sorted, the positive values were at the top as expected, but the negative values got sorted to the bottom – oops!
The solution to the problem was to create a temporary heading array, fill it with the heading values associated with the first N front distances as before, but with the heading values modified to fit into the 0-359º range (by adding 360 to negative values). The result of this trick was to ‘homogenize’ the headings so they were all sequential, and then selecting the median value did indeed point the robot in the correct direction, as shown in the following short video and telemetry output.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
After init, arrays are FrontD Hdg LeftD LSteer RightD RSteer 15 -0.0 50.9 -0.1 71.5 -0.0 16 9.4 50.8 0.0 72.0 -0.0 17 19.8 52.6 -0.1 75.2 -0.1 21 30.3 51.0 -0.8 79.0 -0.3 24 40.7 35.7 -1.0 89.8 -0.4 31 51.2 27.0 -0.8 102.9 -0.3 42 60.7 22.6 -0.6 130.7 0.1 69 70.1 20.0 -0.2 162.8 -1.0 68 79.6 18.4 -0.2 263.7 -1.0 68 89.9 17.0 -0.1 312.7 -1.0 67 100.1 17.0 0.0 224.1 1.0 70 110.4 18.5 0.2 147.9 0.5 75 120.7 21.9 0.5 104.6 0.6 88 130.7 23.7 0.3 81.9 0.7 112 141.2 30.8 0.6 69.6 0.4 154 152.0 41.8 1.0 59.8 0.2 320 162.7 69.6 0.1 54.1 0.1 380 172.5 72.2 -0.2 52.6 0.0 397 -176.0 69.4 -0.0 52.4 -0.1 405 -165.9 70.8 0.1 54.8 -0.2 118 -156.4 73.9 0.1 55.5 0.7 91 -145.9 79.1 0.1 38.2 1.0 70 -135.4 92.8 0.0 28.4 0.9 59 -125.0 111.6 0.1 22.2 0.5 54 -114.3 135.0 1.0 19.9 0.3 50 -103.7 177.5 1.0 18.7 0.2 51 -93.1 258.7 1.0 17.2 0.1 51 -83.6 205.4 1.0 16.6 -0.0 53 -73.0 142.2 1.0 18.1 -0.2 39 -63.0 116.2 -0.0 19.6 -0.3 28 -52.7 94.7 -0.4 24.1 -0.7 23 -42.2 78.8 -0.4 31.2 -0.9 19 -31.6 66.6 -0.3 41.1 -1.0 18 -21.5 60.2 -0.3 67.0 -0.3 17 -10.9 57.6 -0.2 68.7 0.1 16 -0.7 56.1 -0.1 66.4 0.1 After REV sort, arrays are FrontD Hdg LeftD LSteer RightD RSteer 405 -165.9 70.8 0.1 54.8 -0.2 397 -176.0 69.4 -0.0 52.4 -0.1 380 172.5 72.2 -0.2 52.6 0.0 320 162.7 69.6 0.1 54.1 0.1 154 152.0 41.8 1.0 59.8 0.2 118 -156.4 73.9 0.1 55.5 0.7 112 141.2 30.8 0.6 69.6 0.4 91 -145.9 79.1 0.1 38.2 1.0 88 130.7 23.7 0.3 81.9 0.7 75 120.7 21.9 0.5 104.6 0.6 70 -135.4 92.8 0.0 28.4 0.9 70 110.4 18.5 0.2 147.9 0.5 69 70.1 20.0 -0.2 162.8 -1.0 68 79.6 18.4 -0.2 263.7 -1.0 68 89.9 17.0 -0.1 312.7 -1.0 67 100.1 17.0 0.0 224.1 1.0 59 -125.0 111.6 0.1 22.2 0.5 54 -114.3 135.0 1.0 19.9 0.3 53 -73.0 142.2 1.0 18.1 -0.2 51 -93.1 258.7 1.0 17.2 0.1 51 -83.6 205.4 1.0 16.6 -0.0 50 -103.7 177.5 1.0 18.7 0.2 42 60.7 22.6 -0.6 130.7 0.1 39 -63.0 116.2 -0.0 19.6 -0.3 31 51.2 27.0 -0.8 102.9 -0.3 28 -52.7 94.7 -0.4 24.1 -0.7 24 40.7 35.7 -1.0 89.8 -0.4 23 -42.2 78.8 -0.4 31.2 -0.9 21 30.3 51.0 -0.8 79.0 -0.3 19 -31.6 66.6 -0.3 41.1 -1.0 18 -21.5 60.2 -0.3 67.0 -0.3 17 19.8 52.6 -0.1 75.2 -0.1 17 -10.9 57.6 -0.2 68.7 0.1 16 -0.7 56.1 -0.1 66.4 0.1 16 9.4 50.8 0.0 72.0 -0.0 15 -0.0 50.9 -0.1 71.5 -0.0 FrontD Hdg LeftD LSteer RightD RSteer at index = 1, FrontD = 397, bWallTrackAvailable = 0 at index = 2, FrontD = 380, bWallTrackAvailable = 0 at index = 3, FrontD = 320, bWallTrackAvailable = 0 at index = 4, FrontD = 154, bWallTrackAvailable = 0 at index = 5, FrontD = 118, bWallTrackAvailable = 0 FrontD Hdg LeftD LSteer RightD RSteer 405 -165.9 70.8 0.1 54.8 -0.2 397 -176.0 69.4 -0.0 52.4 -0.1 380 172.5 72.2 -0.2 52.6 0.0 320 162.7 69.6 0.1 54.1 0.1 154 152.0 41.8 1.0 59.8 0.2 There are 5 lines with FrontD > MIN_RUN_TO_DAYLIGHT_DIST_CM the tempHdg array has the following elements Hdg 194.1 184.0 172.5 162.7 152.0 after reverse sort, the tempHdg array has the following elements Hdg 194.1 184.0 172.5 162.7 152.0 Turning to heading 172.5 FrontD Hdg LeftD LSteer RightD RSteer 355 171.1 65.0 -0.1 58.1 0.0 |
In the above telemetry output, the first two values in the Hdg array associated with the reverse-sorted FrontD array are negative, so if the Hdg array is reverse sorted to find the best RunToDaylight heading, the two headings associated with the longest open run aren’t considered unless they are first modified such that all headings lie in the 0-360 range. The ‘tempHdg’ array accomplishes this.
After the above successful test of the new ‘RunToDaylight’ capability, it is time to integrate this into the rest of the program. At the moment the code is contained in ‘RunToDaylightV2’ and it is only called from ‘#pragma region QUICKSORT_TEST in setup(). In the mainline code, ‘RunToDaylight’ is called from ChooseBetterTrackingSide() when the ‘Better Side’ can’t be determined.
ChooseBetterTrackingSide() is called from HandleExcessSteervalCase() when a trackable wall is found on both sides, and a determination has to be made on how to proceed. So, it appears that all I have to do is comment out (or delete) the QUICKSORT_TEST #pragma region and RunToDaylightV2 will be called as necessary.
After making the necessary changes, I made a long ‘field test’, starting in our entrance hallway and going through the kitchen and down the bedroom hallway to the end, and then once again into the guest bedroom. This all worked perfectly, and I was pleased to see that ‘RunToDaylightV2()’ was called at the end. See the accompanying video and the telemetry for all the details:
17 October 2023 Update:
I tried another Guest Bedroom ‘field test’, with different results this time, as shown in the accompanying video and telemetry:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
14113: End of setup(): Elapsed run time set to 0 0.0: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 8.04 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 0.4: gl_Left/RightCenterCm = 30.2/61.5, Left/RightSteerVal = 0.00/-0.04 Just before call to HandleAnomalousConditions() In HandleAnomalousConditions(NEITHER) with last anomaly code = NONE In HandleAnomalousConditions(NEITHER) ANOMALY_NONE CASE 0.5: gl_Left/RightCenterCm =Front Rear FVar RVar LSpd RSpd ACODE TRKDIR 0.6 29.9 61.9 0.3 29.7 30.2 -0.05 101 154 78486 11910 99 50 NONE LEFT 0.7 30.0 61.7 2.9 29.9 30.8 -0.09 99 161 78656 11253 105 44 NONE LEFT 0.8 30.7 61.8 5.1 30.5 30.2 0.03 96 168 80105 10633 66 83 NONE LEFT 0.9 30.3 63.1 5.9 30.5 30.5 0.00 93 173 82684 10038 74 75 NONE LEFT 1.0 31.4 62.3 5.2 31.5 31.0 0.05 90 177 86293 9478 51 98 NONE LEFT 1.1 31.7 63.4 3.4 31.4 31.8 -0.04 86 178 90700 8957 81 68 NONE LEFT 1.2 31.7 66.7 2.3 31.2 32.0 -0.08 79 176 95816 8471 96 53 NONE LEFT 1.3 32.0 118.1 3.5 31.7 31.8 -0.01 75 185 101351 8022 66 83 NONE LEFT 1.4 32.1 155.6 4.0 31.6 31.8 -0.02 72 182 107021 7607 68 82 NONE LEFT 1.5 32.5 113.9 3.1 32.3 32.9 -0.06 69 184 112582 7230 80 69 NONE LEFT 1.6 32.6 132.6 1.7 32.1 32.8 -0.03 66 198 117733 6882 70 79 NONE LEFT 1.7 32.7 130.8 -0.0 32.1 33.1 -0.10 60 201 122277 6555 101 49 NONE LEFT 1.8 32.8 117.5 -0.7 31.8 32.6 -0.08 54 201 125882 6257 88 61 NONE LEFT 1.9 32.7 149.5 -0.6 32.3 32.6 -0.03 50 200 128169 6000 72 77 NONE LEFT 2.0 31.9 200.5 -0.7 31.6 32.6 -0.10 43 195 128845 5773 108 41 NONE LEFT 2.1 32.5 211.8 -0.1 31.7 32.8 -0.11 37 205 127538 5567 105 44 NONE LEFT 2.2 31.9 223.9 1.3 32.1 32.0 -0.03 36 211 123739 5387 79 70 NONE LEFT 2.3 32.5 209.5 1.9 31.2 32.3 -0.11 33 195 117061 5242 103 46 NONE LEFT 2.4 32.4 221.1 1.6 32.0 32.6 -0.06 28 192 107109 5137 81 68 WALL_OFFSET_DIST_AHEAD LEFT Stopping Motors! Error Code is 4 --> WALL_OFFSET_DIST_AHEAD 2.4: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage =Just after first UpdateAllEnvironmenIn BackupAndTurn90Deg(CW)with front distance = 17 MTFD: at start, tgt = 30cm, curr_dist = 19, front/rear var = 83325/13332 MTFD: Stopped with front dist = 29, anomaly code = WALL_OFFSET_DIST_AHEAD BackupAndTurn90Deg finished 7.5: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 7.98 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 8.0: gl_Left/RightCenterCm = 34.4/87.3, Left/RightSteerVal = -0.03/0.20 Just before call to HandleAnomalousConditions() In HandleAnomalousConditions(NEITHER) with last anomaly code = NONE In HandleAnomalousConditions(NEITHER) ANOMALY_NONE CASE 8.0: gl_Left/RightCenterCm = 35.1/87.3, Left/RightSteerVal = -0.07/0.42 gl_LeftCenterCm <= gl_RightCenterCm --> Calling TrackLeftWallOffset() TrackLeftWallOffset(350.0, 0.0, 20.0, 30) called TrackLeftWallOffset: Start tracking offset of 30cm at 8.0 Just after CaptureWallOffset(TRACKING_LEFT, 35.1) Sec LCen RCen Deg LF LR LStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR 8.1 35.3 85.3 92.1 33.7 33.8 0.01 480 31 142938 7532 37 112 NONE LEFT 8.2 34.8 89.4 87.9 33.3 34.5 -0.04 223 30 137120 8119 61 89 NONE LEFT 8.3 34.4 89.4 85.4 33.3 34.5 -0.12 225 32 128696 8720 96 53 NONE LEFT 8.4 35.0 92.4 85.9 32.9 33.5 -0.06 222 36 117765 9305 61 89 NONE LEFT 8.5 34.7 104.8 85.3 33.0 34.1 -0.11 217 39 103972 9878 91 58 NONE LEFT 8.6 34.4 113.5 85.6 32.9 34.2 -0.13 213 45 86933 10425 100 49 NONE LEFT 8.7 34.6 132.1 88.1 32.2 33.5 -0.13 208 49 66243 10936 99 50 NONE LEFT 8.8 34.5 118.2 90.7 33.8 34.3 -0.05 181 53 41419 11422 66 83 NONE LEFT 8.9 34.4 117.7 91.9 34.1 33.8 0.03 439 58 23643 11876 36 113 NONE LEFT 9.0 35.5 144.4 90.0 34.4 35.3 -0.09 438 62 26707 12292 70 79 NONE LEFT 9.1 35.4 133.6 88.3 34.4 35.3 -0.09 189 65 26072 12671 70 79 NONE LEFT 9.2 35.9 132.9 87.1 34.2 35.7 -0.15 186 71 25348 13003 99 50 NONE LEFT 9.3 35.5 137.9 88.0 35.3 35.6 -0.03 184 75 24534 13286 50 99 NONE LEFT 9.4 35.9 143.0 87.0 35.0 35.9 -0.09 178 80 23615 13523 70 79 NONE LEFT 9.5 35.9 400.0 85.4 35.0 35.7 -0.07 177 84 22632 13706 64 85 NONE LEFT 9.6 35.8 63.1 84.0 33.0 36.0 -0.30 171 88 21593 13836 127 0 NONE LEFT 9.7 35.2 57.4 84.7 24.6 35.7 -0.94 167 92 20494 13911 127 0 NONE LEFT 9.8 25.8 58.0 88.5 16.4 26.0 -0.96 164 96 19342 13921 127 0 NONE LEFT 9.9 17.2 58.1 95.4 17.4 18.6 -0.12 407 103 19573 13859 127 0 NONE LEFT 10.0 18.6 61.0 102.3 19.1 18.1 0.10 405 104 19445 13736 126 23 NONE LEFT 10.1 19.0 64.4 109.2 14.4 20.4 -0.60 249 95 17830 13567 127 0 NONE LEFT 10.2 17.0 220.5 115.9 17.9 15.3 0.26 187 72 16057 13395 101 48 NONE LEFT 10.3 20.2 242.0 121.4 21.6 17.4 0.42 196 62 14221 13187 35 114 NONE LEFT 10.4 23.2 238.2 120.2 25.7 21.7 0.20 191 60 12306 12903 57 92 NONE LEFT 10.5 24.6 214.8 116.5 26.2 22.6 0.36 179 66 10536 12498 18 127 NONE LEFT 10.6 26.2 56.7 111.3 27.4 23.7 0.41 189 78 8594 11955 1 127 NONE LEFT 10.7 25.9 49.2 103.0 26.3 24.6 0.17 268 112 7463 11242 56 93 NONE LEFT 10.8 25.4 58.3 99.4 26.3 24.9 0.14 383 129 8114 10403 66 83 NONE LEFT 10.9 26.5 72.8 97.6 25.9 25.6 0.03 376 135 8841 9456 91 58 NONE LEFT 11.0 27.1 73.7 98.2 26.9 26.3 0.06 377 138 9436 8401 75 74 NONE LEFT 11.1 28.4 73.5 99.2 28.5 27.2 0.12 368 141 9903 7231 55 94 NONE LEFT 11.2 29.4 73.1 99.1 29.3 28.4 0.09 366 147 10213 5945 50 99 NONE LEFT 11.3 30.5 71.9 97.6 30.7 29.7 0.10 360 151 10318 4538 39 110 NONE LEFT 11.4 31.6 70.8 94.7 31.7 30.2 0.15 355 156 9443 3008 23 126 NONE LEFT 11.5 31.4 68.6 91.0 30.4 30.8 -0.04 347 161 8513 2194 79 70 NONE LEFT 11.6 31.7 67.9 88.2 31.1 30.9 0.02 341 165 8467 2201 62 87 NONE LEFT 11.7 31.4 67.7 87.8 30.1 31.2 -0.11 336 167 8321 2214 112 37 NONE LEFT 11.8 31.9 67.5 89.8 30.2 31.4 -0.12 332 171 8067 2235 115 34 NONE LEFT 11.9 31.8 67.9 92.6 31.0 31.2 -0.03 331 178 7684 2263 79 70 NONE LEFT 12.0 32.5 67.8 95.1 32.3 32.1 0.02 330 184 7206 2306 53 96 NONE LEFT 12.1 33.4 67.9 94.5 33.4 32.8 0.06 324 187 6599 2380 33 116 NONE LEFT 12.2 34.2 67.8 92.1 33.6 33.5 0.01 320 192 5870 2470 43 106 NONE LEFT 12.3 34.1 71.9 88.6 33.7 33.8 -0.01 312 197 5020 2583 50 99 NONE LEFT 12.4 34.5 122.1 85.8 34.6 34.1 0.05 306 198 4695 2688 31 118 NONE LEFT 12.5 35.3 172.4 83.5 37.5 34.2 0.33 280 197 4314 2799 0 127 NONE LEFT 12.6 37.2 160.7 78.6 42.2 34.6 0.76 106 197 5236 2904 0 127 NONE LEFT 12.7 37.0 151.2 71.2 41.8 36.0 0.68 51 185 6969 2989 0 127 NONE LEFT 12.8 35.9 165.2 63.4 37.8 35.8 0.20 50 208 8923 3100 0 127 NONE LEFT 12.9 37.0 125.5 56.1 34.8 37.7 -0.29 52 120 10797 3121 127 0 NONE LEFT 13.0 38.4 103.9 56.8 34.1 39.2 -0.51 51 116 12493 3036 127 0 NONE LEFT 13.1 35.3 105.9 62.2 36.2 36.4 -0.02 43 122 14279 2898 58 91 NONE LEFT 13.2 40.6 125.5 66.5 42.6 36.2 0.64 37 218 16358 2862 0 127 NONE LEFT 13.3 43.3 117.4 63.2 39.7 43.2 -0.35 34 217 17876 2886 127 1 NONE LEFT 13.4 42.6 100.9 60.8 38.3 43.5 -0.47 33 201 18909 2869 127 0 NONE LEFT 13.5 39.9 99.5 63.8 36.4 39.1 -0.27 28 151 19678 2730 127 8 WALL_OFFSET_DIST_AHEAD LEFT Stopping Motors! Error Code is 4 --> WALL_OFFSET_DIST_AHEAD 13.6: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 7.97 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 14.0: gl_Left/RightCenterCm = 32.6/111.0, Left/RightSteerVal = -0.24/-1.00 Just before call to HandleAnomalousConditions() In HandleAnomalousConditions(LEFT) with last anomaly code = WALL_OFFSET_DIST_AHEAD ANOMALY_WALL_OFFSET_DIST_AHEAD case detected with tracking case LEFT In BackupAndTurn90Deg(CW)with front distance = 20 MTFD: at start, tgt = 30cm, curr_dist = 19, front/rear var = 83325/13332 MTFD: Stopped with front dist = 29, anomaly code = WALL_OFFSET_DIST_AHEAD BackupAndTurn90Deg finished 18.8: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 7.95 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 19.2: gl_Left/RightCenterCm = 32.1/195.7, Left/RightSteerVal = -0.21/-0.44 Just before call to HandleAnomalousConditions() In HandleAnomalousConditions(NEITHER) with last anomaly code = NONE In HandleAnomalousConditions(NEITHER) ANOMALY_NONE CASE 19.2: gl_Left/RightCenterCm = 32.4/205.1, Left/RightSteerVal = -0.32/1.00 gl_LeftCenterCm <= gl_RightCenterCm --> Calling TrackLeftWallOffset() TrackLeftJust after first UpdateAllEnvironmentParameters() & 200mSec delay at top20892: gl_Left/RightCenterCm = 109.9/126.6, Left/RightSteerVal = 1.00/-0.17 HandleExcessSteervalCase(LEFT) open corner block HandleExcessSteervalCase(LEFT) open corner block after turn and move: gl_Left/RightCenterCm = 20.0/63.1, Left/RightSteerVal = -0.01/0.16 TrackLeftWallOffset(350.0, 0.0, 20.0, 30) called TrackLeftWallOffset: Start tracking offset of 30cm at 24.1 Just after CaptureWallOffset(TRACKING_LEFT, 20.0) Sec LCen RCen Deg LF LR LStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR 24.2 18.0 65.8 72.2 15.1 18.8 -0.37 124 205 56123 7712 127 0 NONE LEFT 24.3 16.0 68.5 76.5 13.2 16.8 -0.36 153 211 28170 7658 127 0 NONE LE24.4 13.5 66.5 81.9 11.9 14.5 -0.26 181 266 4243 7611 127 0 NONE LEFT 24.5 12.5 66.3 89.2 10.0 12.9 -0.21 193 269 4725 7577 127 0 NONE LEFT 24.6 12.2 66.2 96.4 12.0 11.5 0.05 194 246 5086 7549 127 0 NONE LEFT 24.7 13.3 67.3 104.1 13.7 12.4 0.13 199 48 5398 8002 127 0 NONE LEFT 24.8 15.0 69.5 111.5 15.6 13.3 0.23 205 35 5659 8804 108 41 NONE LEFT 24.9 19.0 75.4 117.2 18.5 14.4 0.41 132 31 5505 9614 40 109 NONE LEFT 25.0 20.6 83.5 117.4 19.3 17.9 0.14 123 28 5223 10428 98 51 NONE LEFT 25.1 21.1 70.7 115.4 23.4 18.3 0.51 129 32 4920 11188 14 127 NONE LEFT 25.2 22.9 68.1 114.5 68.2 19.3 1.00 125 37 4591 11858 0 127 EXCESS_STEER_VAL LEFT Stopping Motors! Error Code is 8 --> EXCESS_STEER_VAL 25.2: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 7.94 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 25.6: gl_Left/RightCenterCm = 65.5/59.6, Left/RightSteerVal = 1.00/-0.37 Just before call to HandleAnomalousConditions() In HandleAnomalousConditions(LEFT) with last anomaly code = EXCESS_STEER_VAL In HandleAnomalousConditions(LEFT) ANOMALY_EXCESS_STEER_VAL CASE- Top of HandleExcessSteervalC26487: gl_Left/RightCenterCm = 58.3/49.8, Left/RightSteerVal = 0.36/-0.32 In ChooseBetterTrackingSide with avg hdg = 97.2 ChooseBetterTrackingSide 'right' block with numleft/rightwallsegments = 5/7 HandleExcessSteervalCase(RIGHT): ChooseBetterTrackingSide() returned TrackRightWallOffset(350.0, 0.0, 20.0, 30) called TrackRightWallOffset: Start tracking offset of 30cm at 32.2 Calling CaptureWallOffset(TRACKING_RIGHT, 151.9) Hdg Dist After SpinTurn, Hdg/Dist = -172.6/45 MTFD: at start, tgt = 30cm, curr_dist = 44, front/rear var = 83325/13332 MTFD: Stopped with front dist = 32, anomaly code = NONE In RotateToParallelOrientation(RIGHT) RTPO: starting front/rear/steer avgs = 30.58/32.64/-0.21 Calling SpinTurn() for angle = -11.8 RTPO: ending front/rear/steer avgs = 30.80/31.40/-0.06 RTPO: GetWallOrientDeg(-0.06) returned ending orientation of -3.43 deg End of CaptureWallOffsChooseBetterTrackingSide 'right' block with numleft/rightwallsegments = 8/9 HandleExcessSteervalCase(RIGHT): ChooseBetterTrackingSide() returned TrackRightWallOffset(350.0, 0.0, 20.0, 30) called TrackRightWallOffset: Start tracking offset of 30cm at 52.8 Calling CaptureWallOffset(TRACKING_RIGHT, 82.6) Hdg Dist After SpinTurn, Hdg/Dist = 162.5/140 MTFD: at start, tgt = 30cm, curr_dist = 147, front/rear var = 83325/13332 MTFD: Stopped with front dist = 27, anomaly code = WALL_OFFSET_DIST_AHEAD In RotateToParallelOrientation(RIGHT) RTPO: starting front/rear/steer avgs = 79.10/90.80/-1.17 Calling SpinTurn() for angle = -66.9 RTPO: ending front/rear/steer avgs = 79.10/90.80/-1.17 RTPO: GetWallOrientDeg(-1.17) returned ending orientation of -66.86 deg End of CaptureWallOffset Just after CaptureWallOffset(TRACKING_RIGHT, 82.6) Sec LCen RCen Deg RF RR RStr Front Rear FVar RVar LSpd RSpd ACODE TRKDIR 64.8 64.5 82.6 -3.9 79.1 90.8 -0.72 141 201 1573 4067 0 127 NONE RIGHT 64.9 64.5 82.6 -5.1 79.1 90.8 -0.72 140 201 1549 4067 0 127 NONE RIGHT 64.9 64.5 82.6 -8.0 79.1 90.8 -0.72 148 201 1557 4071 0 127 NONE RIGHT 65.0 64.5 82.6 -10.4 79.1 90.8 -0.72 149 201 1607 4078 0 127 NONE RIGHT 65.0 64.5 82.6 -13.5 79.1 90.8 -0.72 144 201 1670 4088 0 127 NONE RIGHT 65.1 64.5 82.6 -18.0 79.1 90.8 -0.72 153 201 1733 4101 0 127 NONE RIGHT 65.1 64.5 82.6 -22.0 79.1 90.8 -0.72 161 201 1803 4117 0 127 NONE RIGHT 65.2 64.5 82.6 -25.7 79.1 90.8 -0.72 140 201 1820 4134 0 127 NONE RIGHT 65.2 64.5 82.6 -30.0 79.1 90.8 -0.72 164 201 1905 4153 0 127 NONE RIGHT 65.3 64.5 82.6 -34.8 79.1 90.8 -0.72 171 201 2016 4173 0 127 NONE RIGHT 65.3 64.5 82.6 -40.1 79.1 90.8 -0.72 19 201 2076 4195 0 127 WALL_OFFSET_DIST_AHEAD RIGHT Stopping Motors! Error Code is 4 --> WALL_OFFSET_DIST_AHEAD 65.4: Top of loop() - calling UpdateAllEnvironmentParameters() Battery Voltage = 7.98 Just after first UpdateAllEnvironmentParameters() & 200mSec delay at top of loop() 65.8: gl_Left/RightCenterCm = 64.5/82.6, Left/RightSteerVal = -0.20/-0.72 Just before call to HandleAnomalousConditions() In HandleAnomalousConditions(RIGHT) with last anomaly code = WALL_OFFSET_DIST_AHEAD ANOMALY_WALL_OFFSET_DIST_AHEAD case detected with tracking case RIGHT In BackupAndTurn90Deg(CCW)with front distance = 8 MTFD: at start, tgt = 30cm, curr_dist = 8, front/rear var = 83325/13332 |
Stay tuned,
Frank