Posted 06 March 2022
I’ve pretty much finished with transitioning my autonomous wall-following robot from the old Arduino MEGA 2560 main controller to the new Teensy 3.5 main controller, and now I am moving on to actually getting Wall-E3 to do the job it was created for – namely, to follow walls autonomously. This post describes the result of a multi-lap run through my little testing ‘sandbox’, consisting of a set of barriers forming a 2m X 2m rectangular ‘room’. Here’s a short video showing the run:
I captured the telemetry output from the run and went back through it pretty much line-by-line, trying to make sure I understood all the actions displayed in the video – particularly the little off-piste excursion at about 1:00 on the second lap, just before the end of the run (the run was cancelled when a portion of the wall fell over on Wall-E3).
First Leg: 36.0- 38.9 Sec (5-8 sec in video)
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 |
TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec Fdir Cdir Rdir RearD Steer Set error Ival Kp*err Ki*Ival Kd*Din Output Lspd Rspd 36017 46 46 46 17 -0.01 0.00 0.01 0.00 4.20 0.00 0.00 4.20 79 70 36114 45 45 50 18 -0.44 0.00 0.44 0.00 130.50 0.00 0.00 130.50 127 0 36215 45 46 46 20 -0.12 0.00 0.12 0.00 37.20 0.00 -0.00 37.20 112 37 36313 45 45 45 24 -0.00 0.00 0.00 0.00 1.50 0.00 -0.00 1.50 76 73 36415 46 46 46 28 0.05 0.00 -0.05 0.00 -13.80 0.00 -0.00 -13.80 61 88 36514 47 47 45 33 0.16 0.00 -0.16 0.00 -47.10 0.00 -0.00 -47.10 27 122 36614 49 48 48 38 0.16 0.00 -0.16 0.00 -47.40 0.00 -0.00 -47.40 27 122 36717 48 48 48 44 -0.03 0.00 0.03 0.00 9.60 0.00 0.00 9.60 84 65 36817 49 48 48 47 0.08 0.00 -0.08 0.00 -23.40 0.00 -0.00 -23.40 51 98 36914 47 47 48 52 -0.08 0.00 0.08 0.00 24.90 0.00 0.00 24.90 99 50 37013 47 48 48 58 -0.18 0.00 0.18 0.00 54.60 0.00 0.00 54.60 127 20 37113 45 47 48 65 -0.31 0.00 0.31 0.00 93.90 0.00 0.00 93.90 127 0 37215 45 46 45 70 0.05 0.00 -0.05 0.00 -13.80 0.00 -0.00 -13.80 61 88 37313 45 46 46 77 -0.10 0.00 0.10 0.00 31.20 0.00 0.00 31.20 106 43 37415 45 46 46 79 0.01 0.00 -0.01 0.00 -1.80 0.00 -0.00 -1.80 73 76 37515 48 47 46 87 0.22 0.00 -0.22 0.00 -65.10 0.00 -0.00 -65.10 9 127 37614 46 48 47 92 -0.07 0.00 0.07 0.00 21.60 0.00 0.00 21.60 96 53 37713 48 48 49 99 -0.06 0.00 0.06 0.00 18.60 0.00 -0.00 18.60 93 56 37814 49 49 47 103 0.14 0.00 -0.14 0.00 -41.70 0.00 -0.00 -41.70 33 116 37912 48 48 47 105 0.09 0.00 -0.09 0.00 -26.40 0.00 0.00 -26.40 48 101 38013 49 48 48 114 0.11 0.00 -0.11 0.00 -32.40 0.00 -0.00 -32.40 42 107 38114 47 50 50 118 -0.25 0.00 0.25 0.00 75.00 0.00 0.00 75.00 127 0 38212 48 48 50 119 -0.14 0.00 0.14 0.00 42.60 0.00 -0.00 42.60 117 32 38311 48 48 48 819 0.03 0.00 -0.03 0.00 -8.40 0.00 -0.00 -8.40 66 83 38411 49 48 48 819 0.12 0.00 -0.12 0.00 -35.40 0.00 -0.00 -35.40 39 110 38512 49 49 47 819 0.21 0.00 -0.21 0.00 -62.70 0.00 -0.00 -62.70 12 127 38612 48 48 49 819 -0.09 0.00 0.09 0.00 27.60 0.00 0.00 27.60 102 47 38710 48 49 48 819 -0.07 0.00 0.07 0.00 21.30 0.00 -0.00 21.30 96 53 38812 48 49 47 819 0.07 0.00 -0.07 0.00 -20.70 0.00 -0.00 -20.70 54 95 CheckForErrorCondx returning error code OBSTACLE_AHEAD 38914 50 50 47 819 0.14 0.00 -0.14 0.00 -42.00 0.00 -0.00 -42.00 33 117 |
In the first leg, the robot starts off parallel to the wall on the left, but too close (16cm instead of 40cm). It makes a 27.1º CW turn away from the wall to achieve a cut angle of 30º, moves forward, and then turns back 30º CCW to end up parallel to the wall, and about 36cm away – almost perfectly spaced 40cm off the wall.
Next it tracks down the wall from 14.992 sec to 17.390sec , trying (and generally succeeding) to maintain the 40cm standoff distance.
At 17.390 sec it detects an upcoming obstacle (the obstacle detection distance was set to 20cm for this run), and stops (not quite getting all the way stopped before running into the wall – oops!).
First-to-Second Leg Transition:
The handling procedure for the ‘OBSTACLE_AHEAD’ case is to stop, back straight up to achieve the nominal wall offset distance (40cm here), then make a 90º turn (CW in this case) away from the wall to orient itself parallel to the wall again.
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 |
In HandleAnomalousConditions with 3 error code detected OBSTACLE_AHEAD case detected In BackupAndTurn90Deg()with front distance = 3 MoveToDesiredFrontDistCm: Kp/Ki/Kd/dist = -2.0/-0.1/0.0 4 Msec Dist SetD speed 40135 4.00 40 -75 40337 5.00 40 -77 40535 19.00 40 -51 40738 27.00 40 -36 40938 37.00 40 -16 Stopped with front dist = 39 In SpinTurn(CW, 90.00, 45.00) Init hdg = 174.59 deg, Turn = 90.00 deg, tgt = -95.41 deg, timeout = 4.00 sec Completed turn with yaw = -94.62, tgt = -95.41, and match = 0.996 BackupAndTurn90Deg finished In TrackLeftWallOffset with Kp/Ki/Kd = 300.00 0.00 0.00 In TrackLeftWallOffset with LR/LC/LF = 50 50 53 CutAngDeg < 0, SteerAngleDeg > cutAngleDeg In SpinTurn(CCW, 47.14, 30.00) Init hdg = -82.72 deg, Turn = 47.14 deg, tgt = -129.87 deg, timeout = 3.14 sec Completed turn with yaw = -130.81, tgt = -129.87, and match = 0.995 fudgeFactorCm = 10 at approach start: cut angle = -30.000, adjfactor = 0.866, num = 40.00, adjOffsetCm = 56.19 At start - err = prev_err = 12 R/C/F dists = 66 67 68 Steerval = 0.160, SteerAngle = 9.14, CutAngle = -30.00, err/prev_err = 12 Msec LFront LCtr LRear Front Rear Err P_err At end of offset capture - prev_res*res = -12 correct back to parallel (left side) In SpinTurn(CW, 30.00, 30.00) Init hdg = -143.65 deg, Turn = 30.00 deg, tgt = -113.65 deg, timeout = 2.00 sec Completed turn with yaw = -112.75, tgt = -113.65, and match = 0.995 |
As can be seen from the above telemetry, that is exactly what happens, backing up to the point where the front LIDAR sensor shows 38cm and then making the required 90º turn with SpinTurn(CW, 90.00, 45.00). The ‘backup and turn’ evolution is completed in approximately 1.5 sec.
Second Leg: 47.4 – 49.0 Sec (16-19 sec in video)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec Fdir Cdir Rdir RearD Steer Set error Ival Kp*err Ki*Ival Kd*Din Output Lspd Rspd 47399 24 23 23 73 0.13 0.00 -0.13 0.00 -39.90 0.00 -0.00 -39.90 35 114 47497 24 23 23 71 0.05 0.00 -0.05 0.00 -15.90 0.00 0.00 -15.90 59 90 47597 24 23 23 77 0.02 0.00 -0.02 0.00 -6.90 0.00 0.00 -6.90 68 81 47699 23 22 23 79 0.01 0.00 -0.01 0.00 -3.60 0.00 0.00 -3.60 71 78 47801 23 22 23 86 0.00 0.00 -0.00 0.00 -0.60 0.00 0.00 -0.60 74 75 47898 21 22 24 89 -0.26 0.00 0.26 0.00 77.40 0.00 0.00 77.40 127 0 47996 20 20 22 95 -0.19 0.00 0.19 0.00 57.00 0.00 -0.00 57.00 127 18 48097 20 20 20 97 -0.07 0.00 0.07 0.00 21.00 0.00 -0.00 21.00 96 54 48195 20 18 20 102 0.02 0.00 -0.02 0.00 -5.40 0.00 -0.00 -5.40 69 80 48295 21 19 21 108 0.03 0.00 -0.03 0.00 -8.70 0.00 -0.00 -8.70 66 83 48397 22 21 21 114 -0.07 0.00 0.07 0.00 20.70 0.00 0.00 20.70 95 54 48497 22 21 21 117 0.09 0.00 -0.09 0.00 -27.30 0.00 -0.00 -27.30 47 102 48596 23 21 21 122 0.18 0.00 -0.18 0.00 -54.30 0.00 -0.00 -54.30 20 127 48695 24 22 22 819 0.19 0.00 -0.19 0.00 -57.60 0.00 -0.00 -57.60 17 127 48796 24 23 23 819 0.10 0.00 -0.10 0.00 -30.90 0.00 0.00 -30.90 44 105 48894 24 23 24 819 -0.06 0.00 0.06 0.00 17.10 0.00 0.00 17.10 92 57 CheckForErrorCondx returning error code OBSTACLE_AHEAD 48997 22 23 24 819 -0.16 0.00 0.16 0.00 47.10 0.00 0.00 47.10 122 27 |
Second-to-Third Leg Transition:
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 |
In HandleAnomalousConditions with 3 error code detected OBSTACLE_AHEAD case detected In BackupAndTurn90Deg()with front distance = 4 MoveToDesiredFrontDistCm: Kp/Ki/Kd/dist = -2.0/-0.1/0.0 4 Msec Dist SetD speed 50223 4.00 40 -75 50423 4.00 40 -79 50622 19.00 40 -51 50823 27.00 40 -36 51022 34.00 40 -23 Stopped with front dist = 38 In SpinTurn(CW, 90.00, 45.00) Init hdg = -95.98 deg, Turn = 90.00 deg, tgt = -5.98 deg, timeout = 4.00 sec Completed turn with yaw = -4.66, tgt = -5.98, and match = 0.993 BackupAndTurn90Deg finished In TrackLeftWallOffset with Kp/Ki/Kd = 300.00 0.00 0.00 In TrackLeftWallOffset with LR/LC/LF = 49 50 48 CutAngDeg < 0, SteerAngleDeg > cutAngleDeg In SpinTurn(CCW, 39.71, 30.00) Init hdg = 7.90 deg, Turn = 39.71 deg, tgt = -31.81 deg, timeout = 2.65 sec Completed turn with yaw = -31.90, tgt = -31.81, and match = 1.000 fudgeFactorCm = 10 at approach start: cut angle = -30.000, adjfactor = 0.866, num = 40.00, adjOffsetCm = 56.19 At start - err = prev_err = -13 R/C/F dists = 32 41 43 Steerval = 1.040, SteerAngle = 59.43, CutAngle = -30.00, err/prev_err = -13 Msec LFront LCtr LRear Front Rear Err P_err At end of offset capture - prev_res*res = 169 correct back to parallel (left side) In SpinTurn(CW, 30.00, 30.00) Init hdg = -43.89 deg, Turn = 30.00 deg, tgt = -13.89 deg, timeout = 2.00 sec Completed turn with yaw = -13.84, tgt = -13.89, and match = 1.000 |
Third Leg: 57.0 – 59.8 Sec (25-29 sec in video)
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 |
TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec Fdir Cdir Rdir RearD Steer Set error Ival Kp*err Ki*Ival Kd*Din Output Lspd Rspd 57020 47 47 48 20 -0.10 0.00 0.10 0.00 30.90 0.00 0.00 30.90 105 44 57117 46 48 45 20 0.09 0.00 -0.09 0.00 -26.40 0.00 -0.00 -26.40 48 101 57218 47 47 48 24 -0.07 0.00 0.07 0.00 21.90 0.00 0.00 21.90 96 53 57320 47 48 48 29 -0.07 0.00 0.07 0.00 21.60 0.00 -0.00 21.60 96 53 57420 47 49 47 33 0.01 0.00 -0.01 0.00 -2.70 0.00 -0.00 -2.70 72 77 57514 50 50 48 38 0.24 0.00 -0.24 0.00 -72.00 0.00 -0.00 -72.00 3 127 57618 50 50 49 43 0.10 0.00 -0.10 0.00 -30.00 0.00 0.00 -30.00 45 105 57718 51 48 49 49 0.16 0.00 -0.16 0.00 -47.40 0.00 -0.00 -47.40 27 122 57818 50 49 52 55 -0.20 0.00 0.20 0.00 60.30 0.00 0.00 60.30 127 14 57915 50 49 52 60 -0.08 0.00 0.08 0.00 24.30 0.00 -0.00 24.30 99 50 58015 50 50 51 64 -0.16 0.00 0.16 0.00 48.00 0.00 0.00 48.00 123 27 58115 51 50 50 70 -0.03 0.00 0.03 0.00 9.00 0.00 -0.00 9.00 84 66 58215 50 51 49 74 0.14 0.00 -0.14 0.00 -42.30 0.00 -0.00 -42.30 32 117 58318 50 52 50 80 0.15 0.00 -0.15 0.00 -45.60 0.00 -0.00 -45.60 29 120 58417 52 52 52 83 -0.02 0.00 0.02 0.00 5.40 0.00 0.00 5.40 80 69 58517 51 53 50 90 0.05 0.00 -0.05 0.00 -15.90 0.00 -0.00 -15.90 59 90 58615 51 53 51 91 0.07 0.00 -0.07 0.00 -21.90 0.00 -0.00 -21.90 53 96 58715 50 52 51 99 -0.07 0.00 0.07 0.00 20.40 0.00 0.00 20.40 95 54 58816 52 51 52 104 -0.05 0.00 0.05 0.00 14.70 0.00 -0.00 14.70 89 60 58918 52 53 52 114 -0.03 0.00 0.03 0.00 8.10 0.00 -0.00 8.10 83 66 59015 54 54 52 116 0.13 0.00 -0.13 0.00 -40.20 0.00 -0.00 -40.20 34 115 59115 54 54 55 117 -0.03 0.00 0.03 0.00 7.80 0.00 0.00 7.80 82 67 59215 55 54 54 125 0.18 0.00 -0.18 0.00 -55.20 0.00 -0.00 -55.20 19 127 59316 55 56 55 819 -0.01 0.00 0.01 0.00 4.20 0.00 0.00 4.20 79 70 59415 55 54 55 819 -0.04 0.00 0.04 0.00 10.80 0.00 0.00 10.80 85 64 59515 54 55 56 819 -0.14 0.00 0.14 0.00 40.50 0.00 0.00 40.50 115 34 59615 56 55 54 819 0.17 0.00 -0.17 0.00 -49.50 0.00 -0.00 -49.50 25 124 59716 57 55 56 819 0.09 0.00 -0.09 0.00 -25.50 0.00 0.00 -25.50 49 100 CheckForErrorCondx returning error code OBSTACLE_AHEAD 59816 57 57 58 819 -0.12 0.00 0.12 0.00 36.90 0.00 0.00 36.90 111 38 |
Transition and Fourth Leg: 61.0 – 70.4 Sec (30-40 sec in video)
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 |
In HandleAnomalousConditions with 3 error code detected OBSTACLE_AHEAD case detected In BackupAndTurn90Deg()with front distance = 4 MoveToDesiredFrontDistCm: Kp/Ki/Kd/dist = -2.0/-0.1/0.0 4 Msec Dist SetD speed 61040 4.00 40 -75 61242 4.00 40 -79 61440 15.00 40 -59 61640 25.00 40 -41 61840 32.00 40 -28 Stopped with front dist = 39 In SpinTurn(CW, 90.00, 45.00) Init hdg = -5.67 deg, Turn = 90.00 deg, tgt = 84.33 deg, timeout = 4.00 sec Completed turn with yaw = 82.99, tgt = 84.33, and match = 0.993 BackupAndTurn90Deg finished In TrackLeftWallOffset with Kp/Ki/Kd = 300.00 0.00 0.00 In TrackLeftWallOffset with LR/LC/LF = 46 45 47 CutAngDeg < 0, SteerAngleDeg > cutAngleDeg In SpinTurn(CCW, 36.86, 30.00) Init hdg = 96.48 deg, Turn = 36.86 deg, tgt = 59.62 deg, timeout = 2.46 sec Completed turn with yaw = 60.53, tgt = 59.62, and match = 0.995 fudgeFactorCm = 10 at approach start: cut angle = -30.000, adjfactor = 0.866, num = 40.00, adjOffsetCm = 56.19 At start - err = prev_err = -4 R/C/F dists = 58 54 52 Steerval = -0.600, SteerAngle = -34.29, CutAngle = -30.00, err/prev_err = -4 Msec LFront LCtr LRear Front Rear Err P_err At end of offset capture - prev_res*res = 16 correct back to parallel (left side) In SpinTurn(CW, 30.00, 30.00) Init hdg = 56.06 deg, Turn = 30.00 deg, tgt = 86.06 deg, timeout = 2.00 sec Completed turn with yaw = 85.46, tgt = 86.06, and match = 0.997 TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec Fdir Cdir Rdir RearD Steer Set error Ival Kp*err Ki*Ival Kd*Din Output Lspd Rspd 68020 45 45 44 48 0.13 0.00 -0.13 0.00 -40.50 0.00 -0.00 -40.50 34 115 68118 46 46 45 48 0.09 0.00 -0.09 0.00 -25.80 0.00 0.00 -25.80 49 100 68220 46 45 44 51 0.20 0.00 -0.20 0.00 -61.50 0.00 -0.00 -61.50 13 127 68321 45 46 44 54 0.07 0.00 -0.07 0.00 -19.80 0.00 0.00 -19.80 55 94 68416 43 44 45 57 -0.21 0.00 0.21 0.00 61.80 0.00 0.00 61.80 127 13 68517 43 43 44 61 -0.08 0.00 0.08 0.00 23.10 0.00 -0.00 23.10 98 51 68619 42 43 42 67 0.10 0.00 -0.10 0.00 -30.90 0.00 -0.00 -30.90 44 105 68720 42 41 46 72 -0.39 0.00 0.39 0.00 116.70 0.00 0.00 116.70 127 0 68819 43 43 42 78 0.10 0.00 -0.10 0.00 -30.90 0.00 -0.00 -30.90 44 105 68916 44 45 43 80 0.16 0.00 -0.16 0.00 -49.50 0.00 -0.00 -49.50 25 124 69016 45 45 44 86 0.10 0.00 -0.10 0.00 -28.50 0.00 0.00 -28.50 46 103 69120 44 45 43 89 0.04 0.00 -0.04 0.00 -10.50 0.00 0.00 -10.50 64 85 69216 43 45 44 96 -0.09 0.00 0.09 0.00 28.50 0.00 0.00 28.50 103 46 69319 43 44 44 100 -0.12 0.00 0.12 0.00 34.80 0.00 0.00 34.80 109 40 69415 43 44 42 106 0.06 0.00 -0.06 0.00 -19.20 0.00 -0.00 -19.20 55 94 69518 44 43 43 109 0.13 0.00 -0.13 0.00 -39.90 0.00 -0.00 -39.90 35 114 69617 43 45 44 119 -0.05 0.00 0.05 0.00 13.50 0.00 0.00 13.50 88 61 69718 44 44 43 120 0.00 0.00 -0.00 0.00 -1.20 0.00 -0.00 -1.20 73 76 69815 45 44 45 128 -0.03 0.00 0.03 0.00 7.80 0.00 0.00 7.80 82 67 69916 44 44 42 819 0.18 0.00 -0.18 0.00 -55.20 0.00 -0.00 -55.20 19 127 70016 44 45 44 819 -0.05 0.00 0.05 0.00 13.50 0.00 0.00 13.50 88 61 70118 44 44 44 819 -0.07 0.00 0.07 0.00 19.80 0.00 0.00 19.80 94 55 70217 45 44 44 819 0.04 0.00 -0.04 0.00 -13.20 0.00 -0.00 -13.20 61 88 70314 44 45 44 819 0.00 0.00 -0.00 0.00 -1.50 0.00 0.00 -1.50 73 76 CheckForErrorCondx returning error code OBSTACLE_AHEAD 70415 44 44 45 819 -0.14 0.00 0.14 0.00 40.80 0.00 0.00 40.80 115 34 |
Transition and Fifth Leg: 71.6 – 80.9 Sec (40-50 sec in video)
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 |
In HandleAnomalousConditions with 3 error code detected OBSTACLE_AHEAD case detected In BackupAndTurn90Deg()with front distance = 3 MoveToDesiredFrontDistCm: Kp/Ki/Kd/dist = -2.0/-0.1/0.0 3 Msec Dist SetD speed 71639 4.00 40 -75 71839 3.00 40 -81 72039 17.00 40 -55 72238 30.00 40 -30 72439 36.00 40 -19 Stopped with front dist = 40 In SpinTurn(CW, 90.00, 45.00) Init hdg = 82.59 deg, Turn = 90.00 deg, tgt = 172.59 deg, timeout = 4.00 sec Completed turn with yaw = 171.54, tgt = 172.59, and match = 0.994 BackupAndTurn90Deg finished In TrackLeftWallOffset with Kp/Ki/Kd = 300.00 0.00 0.00 In TrackLeftWallOffset with LR/LC/LF = 46 49 46 CutAngDeg < 0, SteerAngleDeg > cutAngleDeg In SpinTurn(CCW, 28.29, 30.00) Init hdg = -175.88 deg, Turn = 28.29 deg, tgt = 155.83 deg, timeout = 1.89 sec Completed turn with yaw = 154.75, tgt = 155.83, and match = 0.994 fudgeFactorCm = 10 at approach start: cut angle = -30.000, adjfactor = 0.866, num = 40.00, adjOffsetCm = 56.19 At start - err = prev_err = -6 R/C/F dists = 53 52 50 Steerval = -0.330, SteerAngle = -18.86, CutAngle = -30.00, err/prev_err = -6 Msec LFront LCtr LRear Front Rear Err P_err At end of offset capture - prev_res*res = 36 correct back to parallel (left side) In SpinTurn(CW, 30.00, 30.00) Init hdg = 144.58 deg, Turn = 30.00 deg, tgt = 174.58 deg, timeout = 2.00 sec Completed turn with yaw = 173.97, tgt = 174.58, and match = 0.997 TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec Fdir Cdir Rdir RearD Steer Set error Ival Kp*err Ki*Ival Kd*Din Output Lspd Rspd 78389 45 47 45 42 0.23 0.00 -0.23 0.00 -68.10 0.00 -0.00 -68.10 6 127 78490 45 47 45 42 0.05 0.00 -0.05 0.00 -14.10 0.00 0.00 -14.10 60 89 78591 45 47 44 43 0.11 0.00 -0.11 0.00 -32.10 0.00 -0.00 -32.10 42 107 78693 44 46 45 48 -0.05 0.00 0.05 0.00 16.20 0.00 0.00 16.20 91 58 78790 43 46 44 52 -0.03 0.00 0.03 0.00 10.20 0.00 -0.00 10.20 85 64 78890 43 48 44 55 -0.08 0.00 0.08 0.00 24.60 0.00 0.00 24.60 99 50 78989 42 45 44 61 -0.23 0.00 0.23 0.00 70.50 0.00 0.00 70.50 127 4 79093 41 42 45 65 -0.36 0.00 0.36 0.00 107.40 0.00 0.00 107.40 127 0 79192 41 42 41 72 0.03 0.00 -0.03 0.00 -9.60 0.00 -0.00 -9.60 65 84 79292 42 41 40 79 0.17 0.00 -0.17 0.00 -51.30 0.00 -0.00 -51.30 23 126 79390 42 41 41 83 0.12 0.00 -0.12 0.00 -36.30 0.00 0.00 -36.30 38 111 79493 42 42 41 85 0.08 0.00 -0.08 0.00 -24.60 0.00 0.00 -24.60 50 99 79590 40 43 43 92 -0.23 0.00 0.23 0.00 68.10 0.00 0.00 68.10 127 6 79690 40 41 42 99 0.03 0.00 -0.03 0.00 -9.30 0.00 -0.00 -9.30 65 84 79793 41 42 40 103 0.13 0.00 -0.13 0.00 -39.60 0.00 -0.00 -39.60 35 114 79892 42 41 42 110 0.01 0.00 -0.01 0.00 -3.30 0.00 0.00 -3.30 71 78 79989 40 41 42 112 -0.14 0.00 0.14 0.00 41.70 0.00 0.00 41.70 116 33 80089 40 41 39 121 0.11 0.00 -0.11 0.00 -33.30 0.00 -0.00 -33.30 41 108 80189 40 41 39 124 0.17 0.00 -0.17 0.00 -51.30 0.00 -0.00 -51.30 23 126 80289 39 38 40 819 -0.15 0.00 0.15 0.00 45.60 0.00 0.00 45.60 120 29 80388 39 39 40 819 -0.08 0.00 0.08 0.00 24.30 0.00 -0.00 24.30 99 50 80489 38 38 39 819 -0.10 0.00 0.10 0.00 30.60 0.00 0.00 30.60 105 44 80589 37 37 37 819 -0.02 0.00 0.02 0.00 6.90 0.00 -0.00 6.90 81 68 80690 37 37 37 819 -0.01 0.00 0.01 0.00 3.90 0.00 -0.00 3.90 78 71 80787 38 38 37 819 0.10 0.00 -0.10 0.00 -29.40 0.00 -0.00 -29.40 45 104 CheckForErrorCondx returning error code OBSTACLE_AHEAD 80889 38 38 39 819 -0.03 0.00 0.03 0.00 9.60 0.00 0.00 9.60 84 65 |
Fifth-to-Sixth Leg Transition: 82.1 – 88.0 Sec (50-58 sec in video)
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 |
In HandleAnomalousConditions with 3 error code detected OBSTACLE_AHEAD case detected In BackupAndTurn90Deg()with front distance = 4 MoveToDesiredFrontDistCm: Kp/Ki/Kd/dist = -2.0/-0.1/0.0 3 Msec Dist SetD speed 82114 4.00 40 -75 82314 6.00 40 -75 82515 18.00 40 -53 82715 29.00 40 -32 82914 37.00 40 -16 Stopped with front dist = 38 In SpinTurn(CW, 90.00, 45.00) Init hdg = 170.44 deg, Turn = 90.00 deg, tgt = -99.56 deg, timeout = 4.00 sec Completed turn with yaw = -100.81, tgt = -99.56, and match = 0.993 BackupAndTurn90Deg finished In TrackLeftWallOffset with Kp/Ki/Kd = 300.00 0.00 0.00 In TrackLeftWallOffset with LR/LC/LF = 47 48 47 CutAngDeg < 0, SteerAngleDeg > cutAngleDeg In SpinTurn(CCW, 33.43, 30.00) Init hdg = -89.13 deg, Turn = 33.43 deg, tgt = -122.56 deg, timeout = 2.23 sec Completed turn with yaw = -122.88, tgt = -122.56, and match = 0.998 fudgeFactorCm = 10 at approach start: cut angle = -30.000, adjfactor = 0.866, num = 40.00, adjOffsetCm = 56.19 At start - err = prev_err = 3 R/C/F dists = 62 59 59 Steerval = -0.300, SteerAngle = -17.14, CutAngle = -30.00, err/prev_err = 3 Msec LFront LCtr LRear Front Rear Err P_err At end of offset capture - prev_res*res = 0 correct back to parallel (left side) In SpinTurn(CW, 30.00, 30.00) Init hdg = -132.07 deg, Turn = 30.00 deg, tgt = -102.07 deg, timeout = 2.00 sec Completed turn with yaw = -102.32, tgt = -102.07, and match = 0.999 |
Sixth Leg up to Anomaly 88.9 – 89.8 Sec (57-59 sec in video)
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 |
TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec Fdir Cdir Rdir RearD Steer Set error Ival Kp*err Ki*Ival Kd*Din Output Lspd Rspd 88946 43 43 41 48 0.22 0.00 -0.22 0.00 -66.90 0.00 -0.00 -66.90 8 127 89044 42 41 42 49 0.04 0.00 -0.04 0.00 -12.30 0.00 0.00 -12.30 62 87 89144 42 43 40 51 0.18 0.00 -0.18 0.00 -54.90 0.00 -0.00 -54.90 20 127 89245 41 42 41 55 -0.01 0.00 0.01 0.00 2.40 0.00 0.00 2.40 77 72 89343 41 42 43 59 -0.21 0.00 0.21 0.00 62.40 0.00 0.00 62.40 127 12 89442 41 41 41 65 -0.04 0.00 0.04 0.00 11.70 0.00 -0.00 11.70 86 63 89540 40 40 39 70 0.07 0.00 -0.07 0.00 -21.00 0.00 -0.00 -21.00 54 96 89640 39 39 39 75 -0.04 0.00 0.04 0.00 12.30 0.00 0.00 12.30 87 62 89743 37 39 39 80 -0.19 0.00 0.19 0.00 57.30 0.00 0.00 57.30 127 17 CheckForErrorCondx returning error code STUCK_AHEAD 89842 37 37 37 84 0.11 0.00 -0.11 0.00 -32.10 0.00 -0.00 -32.10 42 107 In HandleAnomalousConditions with 1 error code detected STUCK_AHEAD case detected 89854: aFrontDist Init: glFront_Dist_PrevMean = 196.00, glFront_Dist_PrevVar = 13328.00 In SpinTurn(CCW, 90.00, 45.00) Init hdg = -100.27 deg, Turn = 90.00 deg, tgt = 169.73 deg, timeout = 4.00 sec Completed turn with yaw = 168.40, tgt = 169.73, and match = 0.993 37/37/0 91902 37 29 1 92101 37 20 1 20/0 In SpinTurn(CW, 90.00, 45.00) Init hdg = 153.01 deg, Turn = 90.00 deg, tgt = -116.99 deg, timeout = 4.00 sec Completed turn with yaw = -118.25, tgt = -116.99, and match = 0.993 |
On this leg an anomaly occurred. The robot detected a ‘Stuck Ahead’ condition, defined by the condition where the mathematical variance of the last N front LIDAR distance readings falls below a set threshold. This should never happen while the robot is actually moving, but it clearly did happen in this case (unfortunately I wasn’t recording the front distance measurement or the distance measurements to the other wall, so I can’t go back and see exactly what happened). The recovery procedure for a ‘stuck ahead’ condition is to make a 90 deg turn away from the nearest wall, move forward for 1 second, and then make another 90 deg turn to return to a parallel course, but offset 10-20 cm from the previous track. In this case, the robot turned toward the nearest wall, clearly a mistake (it was a mistake in TrackLeftWallOffset() – since fixed). However, it was not a disaster, as the robot made the second turn before hitting the wall, and from there on it returned to normal left wall tracking mode.
Summary:
This first test of left wall tracking performance was very encouraging. The robot was able to continue tracking operations over several laps, including an instance where it recovered from an inadvertent ‘Stuck’ detection. The test could easily have continued until the batteries died, but had to be aborted when one section of the foam-core wall fell in on top of the robot – oops!
Also, this run pointed out the need for more focused telemetry. For this test I was only reporting the left-side and rear distances, but now I know I need to add the right-side measurements as well as the front and rear variance numbers.
09 March 2023 Update:
After cleaning up some messy initialization code, and improving telemetry readouts, I ran another complete left-side wall-tracking lap in my sandbox, as shown in the following short video:
The telemetry for this 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 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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
Checking for MPU6050 IMU at I2C Addr 0x68 MPU6050 connection successful Initializing DMP... Enabling DMP... DMP ready! Waiting for MPU6050 drift rate to settle... Calibrating...Retrieving Calibration Values Msec Hdg 6930 0.073 0.076 MPU6050 Ready at 6.93 Sec with delta = -0.004 Checking for Teensy 3.5 VL53L0X Controller at I2C addr 0x20 Teensy available at 8031 with bVL53L0X_TeensyReady = 1. Waiting for Teensy setup() to finish 8033: got 1 from VL53L0X Teensy Teensy setup() finished at Msec LFront LCtr LRear RFront RCtr RRear Rear 8138: 15 14 15 819 121 819 14 VL53L0X Teensy Ready at 8138 Initializing Left, Right, Front Distance Arrays... Initializing Front Distance Array InitFrontDistArray() top: prev_mean = 0, prev_var = 0 8153: aFrontDist Init: glFront_Dist_PrevMean = 196.00, glFront_Dist_PrevVar = 13328.00 Updating Rear Distance Array 8163: aRearDistCM Init: glRear_Dist_PrevMean = 49.00, glRear_Dist_PrevVar = 833.00 Msec LF LC LR RF RC RR LSteer RSteer F Fvar R Rvar 8185 15 14 15 819 124 819 0.000 0.000 164 13328 14 833 Checking for Teensy 3.2 IRDET Controller at I2C addr 0x8 8194: IRDET Teensy Not Avail... IRDET Teensy Ready at 8296 Fin1/Fin2/SteeringVal = 22 40 0.0000 In TrackLeftWallOffset with Kp/Ki/Kd = 300.00 0.00 0.00 In TrackLeftWallOffset with LR/LC/LF = 15 15 15 In SpinTurn(CW, 28.29, 30.00) R/C/F dists = 16 20 22 Steerval = 0.620, SteerAngle = 35.43, CutAngle = 30.00, err/prev_err = -14 In SpinTurn(CCW, 30.00, 30.00) TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec LF LC LR RF RC RR F Fvar R Rvar Steer Set Output 12901 38 39 39 123 819 819 132 13328 0.00 -0.07 0.00 21.30 0.00 13001 38 40 40 819 819 819 133 13328 0.00 -0.21 0.00 63.00 0.00 13098 39 40 39 114 128 819 127 13328 0.00 0.03 0.00 -9.00 0.00 13199 38 38 38 111 819 819 122 13328 0.00 0.01 0.00 -2.40 0.00 13299 38 39 38 111 819 819 118 13328 0.00 -0.03 0.00 9.30 0.00 13398 38 37 38 81 819 819 113 13328 0.00 0.04 0.00 -11.10 0.00 13501 38 37 39 121 819 819 109 13328 0.00 -0.07 0.00 21.90 0.00 13599 37 38 38 112 819 819 104 13328 0.00 -0.05 0.00 15.60 0.00 13699 37 39 38 105 819 819 97 13328 0.00 -0.04 0.00 12.30 0.00 13798 38 39 38 105 819 819 92 13328 0.00 -0.06 0.00 18.30 0.00 13900 37 38 38 108 819 819 86 13328 0.00 -0.10 0.00 30.60 0.00 14001 38 39 37 107 819 819 83 13328 0.00 0.18 0.00 -53.70 0.00 14100 39 37 39 113 819 819 79 13328 0.00 0.06 0.00 -17.10 0.00 14201 37 40 39 124 819 819 76 13328 0.00 -0.21 0.00 63.00 0.00 14299 39 40 39 112 819 819 73 13328 0.00 -0.01 0.00 3.00 0.00 14400 40 41 38 111 819 819 67 13328 0.00 0.25 0.00 -75.30 0.00 14498 41 41 39 124 819 819 62 13328 0.00 0.19 0.00 -57.30 0.00 14599 41 41 41 104 819 819 57 13328 0.00 0.00 0.00 -0.30 0.00 14699 41 40 41 819 819 819 51 13328 0.00 -0.04 0.00 12.00 0.00 14798 41 41 41 124 819 819 46 13328 0.00 -0.07 0.00 20.70 0.00 14899 38 41 41 119 819 819 39 13328 0.00 -0.12 0.00 35.70 0.00 14998 39 39 39 819 819 819 33 13328 0.00 -0.05 0.00 15.30 0.00 CheckForErrorCondx returning error code OBSTACLE_AHEAD 15098 38 39 38 819 819 819 29 13328 0.00 -0.03 0.00 9.30 0.00 In HandleAnomalousConditions with 3 error code detected OBSTACLE_AHEAD case detected In BackupAndTurn90Deg()with front distance = 14 MoveToDesiredFrontDistCm: Kp/Ki/Kd/dist = -2.0/-0.1/0.0 14 Msec Dist SetD speed 16323 13.00 40 -56 16520 18.00 40 -48 16721 23.00 40 -40 16920 28.00 40 -31 17121 33.00 40 -22 Stopped with front dist = 38 In SpinTurn(CW, 90.00, 45.00) BackupAndTurn90Deg finished In TrackLeftWallOffset with Kp/Ki/Kd = 300.00 0.00 0.00 In TrackLeftWallOffset with LR/LC/LF = 39 40 38 At 40 with desired offset = 40: close enough - just parallel and go In RotateToParallelOrientation(Left) Just before while() loop: steerval/prv_val = -0.03 -0.03 Msec Steer Set lastErr lastIn lastI Kp*err Ki*err Kd*Din Output Lspeed Rspeed Parallel Orientation Achieved at 18285 with SteeringVal = -0.03 & bIRBeamAvail = FALSE TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec LF LC LR RF RC RR F Fvar R Rvar Steer Set Output 18413 40 38 39 118 124 819 143 13328 0.00 0.14 0.00 -41.40 0.00 18514 41 39 39 123 819 819 141 13328 0.00 0.20 0.00 -59.70 0.00 18616 39 40 38 819 819 819 138 13328 0.00 0.10 0.00 -30.00 0.00 18711 39 39 39 115 819 819 136 13328 0.00 -0.07 0.00 21.30 0.00 18812 40 40 40 120 819 819 133 13328 0.00 0.04 0.00 -12.00 0.00 18915 38 39 41 105 819 819 127 13328 0.00 -0.23 0.00 69.30 0.00 19014 38 37 38 108 819 819 122 13328 0.00 -0.06 0.00 18.90 0.00 19112 38 37 38 105 819 819 118 13328 0.00 0.04 0.00 -11.10 0.00 19211 37 36 38 119 819 819 116 13328 0.00 -0.04 0.00 13.20 0.00 19316 38 37 37 111 819 819 108 13328 0.00 0.10 0.00 -29.10 0.00 19414 38 39 37 114 819 819 104 13328 0.00 0.09 0.00 -26.70 0.00 19510 38 39 37 819 819 819 99 13328 0.00 0.07 0.00 -20.70 0.00 19613 38 38 37 115 819 819 93 13328 0.00 0.13 0.00 -38.40 0.00 19711 39 39 38 127 819 819 89 13328 0.00 0.09 0.00 -26.70 0.00 19814 38 39 39 106 819 819 85 13328 0.00 -0.06 0.00 18.30 0.00 19911 37 38 38 819 819 819 81 13328 0.00 -0.05 0.00 15.60 0.00 20013 38 38 38 117 819 819 77 13328 0.00 0.02 0.00 -5.40 0.00 20112 37 38 37 819 819 819 75 13328 0.00 0.01 0.00 -2.40 0.00 20213 36 38 36 116 819 819 71 13328 0.00 -0.02 0.00 6.60 0.00 20311 37 37 36 128 819 819 68 13328 0.00 -0.02 0.00 6.90 0.00 20413 37 37 35 126 819 819 63 13328 0.00 0.17 0.00 -50.10 0.00 20511 35 39 36 127 819 819 56 13328 0.00 -0.05 0.00 15.30 0.00 20614 36 38 36 125 819 819 50 13328 0.00 0.01 0.00 -2.40 0.00 20713 35 37 36 819 819 819 46 13328 0.00 -0.04 0.00 12.90 0.00 20811 36 37 36 128 819 819 41 13328 0.00 -0.06 0.00 18.90 0.00 20910 35 36 36 121 819 819 37 13328 0.00 -0.07 0.00 22.20 0.00 21010 35 35 36 127 819 819 32 13328 0.00 -0.05 0.00 16.50 0.00 CheckForErrorCondx returning error code OBSTACLE_AHEAD 21111 36 35 36 93 819 819 27 13328 0.00 -0.12 0.00 37.50 0.00 In HandleAnomalousConditions with 3 error code detected OBSTACLE_AHEAD case detected In BackupAndTurn90Deg()with front distance = 5 MoveToDesiredFrontDistCm: Kp/Ki/Kd/dist = -2.0/-0.1/0.0 4 Msec Dist SetD speed 22335 6.00 40 -71 22536 13.00 40 -60 22733 21.00 40 -46 22934 29.00 40 -31 Stopped with front dist = 38 In SpinTurn(CW, 90.00, 45.00) BackupAndTurn90Deg finished In TrackLeftWallOffset with Kp/Ki/Kd = 300.00 0.00 0.00 In TrackLeftWallOffset with LR/LC/LF = 41 43 40 At 43 with desired offset = 40: close enough - just parallel and go In RotateToParallelOrientation(Left) Just before while() loop: steerval/prv_val = -0.18 -0.18 Msec Steer Set lastErr lastIn lastI Kp*err Ki*err Kd*Din Output Lspeed Rspeed Parallel Orientation Achieved at 24164 with SteeringVal = -0.18 & bIRBeamAvail = FALSE TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec LF LC LR RF RC RR F Fvar R Rvar Steer Set Output 24290 41 41 40 128 125 819 149 13328 0.00 0.04 0.00 -12.30 0.00 24393 42 42 40 103 819 819 146 13328 0.00 0.17 0.00 -51.60 0.00 24494 40 42 39 114 124 819 145 13328 0.00 0.11 0.00 -33.60 0.00 24591 40 42 40 95 819 819 142 13328 0.00 -0.03 0.00 8.40 0.00 24692 40 41 40 93 819 819 136 13328 0.00 -0.04 0.00 11.70 0.00 24791 40 41 41 91 819 819 133 13328 0.00 -0.09 0.00 26.70 0.00 24891 39 40 40 86 819 819 126 13328 0.00 -0.09 0.00 27.00 0.00 24992 39 39 39 79 819 819 122 13328 0.00 0.04 0.00 -11.70 0.00 25094 38 39 40 88 819 819 118 13328 0.00 -0.11 0.00 33.30 0.00 25190 39 40 39 90 819 819 113 13328 0.00 -0.03 0.00 9.00 0.00 25293 40 39 38 84 819 819 107 13328 0.00 0.14 0.00 -41.70 0.00 25392 38 40 39 76 819 819 103 13328 0.00 -0.06 0.00 18.00 0.00 25493 39 39 39 53 819 819 99 13328 0.00 0.01 0.00 -2.70 0.00 25592 39 40 40 71 819 819 95 13328 0.00 -0.04 0.00 12.00 0.00 25693 39 39 38 65 819 819 90 13328 0.00 0.06 0.00 -17.70 0.00 25792 38 38 39 81 819 819 83 13328 0.00 -0.12 0.00 36.60 0.00 25889 38 38 39 80 819 819 79 13328 0.00 -0.10 0.00 30.60 0.00 25990 38 38 39 83 819 819 74 13328 0.00 -0.09 0.00 27.60 0.00 26089 37 38 37 92 819 819 71 13328 0.00 0.02 0.00 -5.40 0.00 26192 38 38 37 96 819 819 67 13328 0.00 0.05 0.00 -14.40 0.00 26291 38 37 38 819 819 819 62 13328 0.00 0.04 0.00 -11.10 0.00 26392 38 37 37 117 819 819 53 13328 0.00 0.10 0.00 -29.10 0.00 26491 37 36 36 113 819 819 49 13328 0.00 0.11 0.00 -31.80 0.00 26589 37 36 37 109 819 819 47 13328 0.00 -0.07 0.00 22.20 0.00 26690 35 35 37 123 819 819 44 13328 0.00 -0.09 0.00 25.50 0.00 26789 35 35 36 819 819 819 39 13328 0.00 -0.10 0.00 28.50 0.00 26889 36 35 34 118 819 819 33 13328 0.00 0.15 0.00 -43.50 0.00 CheckForErrorCondx returning error code OBSTACLE_AHEAD 26989 35 34 35 819 819 819 28 13328 0.00 0.05 0.00 -16.20 0.00 In HandleAnomalousConditions with 3 error code detected OBSTACLE_AHEAD case detected In BackupAndTurn90Deg()with front distance = 7 MoveToDesiredFrontDistCm: Kp/Ki/Kd/dist = -2.0/-0.1/0.0 6 Msec Dist SetD speed 28211 7.00 40 -69 28409 15.00 40 -55 28611 20.00 40 -47 28813 28.00 40 -33 Stopped with front dist = 37 In SpinTurn(CW, 90.00, 45.00) BackupAndTurn90Deg finished In TrackLeftWallOffset with Kp/Ki/Kd = 300.00 0.00 0.00 In TrackLeftWallOffset with LR/LC/LF = 42 41 42 At 41 with desired offset = 40: close enough - just parallel and go In RotateToParallelOrientation(Left) Just before while() loop: steerval/prv_val = -0.02 -0.02 Msec Steer Set lastErr lastIn lastI Kp*err Ki*err Kd*Din Output Lspeed Rspeed Parallel Orientation Achieved at 30049 with SteeringVal = -0.02 & bIRBeamAvail = FALSE TrackLeftWallOffset: Start tracking offset of 40.00cm with Kp/Ki/Kd = 300.00 0.00 0.00 Msec LF LC LR 30178 43 42 42 819 819 819 138 13328 0.00 0.04 0.00 -12.60 0.00 30276 41 42 42 92 819 819 139 13328 0.00 -0.08 0.00 23.40 0.00 30375 43 42 43 116 819 819 135 13328 0.00 -0.03 0.00 8.40 0.00 30476 43 42 42 109 819 819 130 13328 0.00 0.12 0.00 -36.60 0.00 30577 42 43 43 121 819 819 123 13328 0.00 0.07 0.00 -21.90 0.00 30678 42 43 43 102 819 819 119 13328 0.00 -0.10 0.00 29.10 0.00 30775 43 43 42 112 819 819 113 13328 0.00 0.04 0.00 -12.90 0.00 30878 43 42 42 91 819 819 109 13328 0.00 0.11 0.00 -33.60 0.00 30975 42 42 42 79 819 819 104 13328 0.00 0.07 0.00 -21.60 0.00 31077 42 42 43 87 127 819 102 13328 0.00 -0.09 0.00 26.40 0.00 31174 41 42 41 94 819 819 96 13328 0.00 0.06 0.00 -18.60 0.00 31275 42 41 41 77 127 819 92 13328 0.00 0.07 0.00 -21.30 0.00 31376 42 41 43 71 127 819 87 13328 0.00 -0.07 0.00 20.70 0.00 31476 42 42 41 73 819 819 82 13328 0.00 0.13 0.00 -39.60 0.00 31578 41 41 40 89 819 819 76 13328 0.00 0.03 0.00 -9.30 0.00 31677 41 41 41 92 819 819 73 13328 0.00 0.00 0.00 -0.30 0.00 31776 41 40 40 84 819 819 67 13328 0.00 0.03 0.00 -9.00 0.00 31876 41 40 40 112 819 819 63 13328 0.00 0.13 0.00 -39.00 0.00 31975 40 39 40 819 819 819 57 13328 0.00 0.02 0.00 -5.70 0.00 32074 40 40 39 103 819 819 52 13328 0.00 0.13 0.00 -39.00 0.00 32175 38 39 39 819 819 819 47 13328 0.00 -0.01 0.00 3.30 0.00 32277 39 38 39 819 819 819 42 13328 0.00 -0.05 0.00 15.60 0.00 32373 38 37 40 121 819 819 35 13328 0.00 -0.14 0.00 42.90 0.00 32474 38 38 36 98 819 819 31 13328 0.00 0.16 0.00 -47.40 0.00 CheckForErrorCondx returning error code OBSTACLE_AHEAD 32574 37 37 38 115 819 819 26 13328 0.00 -0.10 0.00 30.90 0.00 In HandleAnomalousConditions with 3 error code detected OBSTACLE_AHEAD case detected In BackupAndTurn90Deg()with front distance = 7 MoveToDesiredFrontDistCm: Kp/Ki/Kd/dist = -2.0/-0.1/0.0 6 Msec Dist SetD speed I received c on BT Serial1 ENTERING COMMAND MODE: 0 = 180 deg CCW Turn 1 = 180 deg CW Turn A = Back to Auto Mode S = Stop F = Forward R = Reverse Faster 8 Left 4 5 6 Right 2 Slower |
From the telemetry, it takes about 8 sec for all sensor hardware initialization. After that the left/right/front/rear distance arrays are initialized, and the initial front/rear variances are calculated. All this is summarized on line 26-27.
First leg: 12.866 – 15sec (3-5 sec in video)
Left-side tracking starts on line 34. First (line 37) the robot turns to its initial offset capture heading, moves to the desired offset distance (not shown) and then turns back to parallel the wall (line 39). Actual tracking starts on line 43 at 12.866 sec elapsed time (this corresponds to about 3 sec into the video)
At line 65 (about 15 sec elapsed time) the robot ‘sees’ the upcoming wall, stops and then backs up to 38cm (16.4 – 17.3 sec, 5-6 sec in video). At line 78 it makes a 90deg CW turn to line up with the current wall section, and then navigates down the wall (18.6-21.3sec, 8-11sec in video)
Second leg: 18.6 – 21.3sec (8-11 sec in video)
The robot ‘sees’ the upcoming wall on line 119 (21.010 sec, 11sec in video), backs up (lines 123-129, 11-12 sec in video) and makes another 90deg CW turn to follow the 3rd wall
The third and 4th legs are very similar to the first two, with the robot ending back where it started at 32.574 sec (23 sec on video), ‘seeing’ the upcoming wall at line 221. At this point I transmitted the ‘C’ character over the wireless link to enter manual control to terminate the run.
Summary:
This 4-leg run was pretty much perfect. I adjusted the MIN_FRONT_OBSTACLE_DIST_CM from 20 to 30cm, and this stopped the robot from banging its head against the walls – yay! Also, the telemetry readout changes made for a much more understandable output. I was happy to see that the front variance stayed well above 10,000 the whole time, but unhappy to see that the rear variance was essentially zero the entire time. The low rear variance is due to the fact that the rear VL53L0X sensor range is only about 100cm, and after that it always reports ‘819’. This is not a real problem – it just means that I can’t use the rear variance number to detect a ‘rear stuck’ condition unless it happens within a meter or so from a wall. Hmm, maybe I could use the information from both the front & rear variance numbers to create a more robust detection system.
Stay tuned,
Frank
Pingback: Wall-E3 Right Wall Following Trial | Paynter's Palace