Compare commits
149
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00c504fb12 | ||
|
|
f0f75d3fd3 | ||
|
|
73fde34e48 | ||
|
|
87743c8e67 | ||
|
|
c866bc0d60 | ||
|
|
dbb646b5a5 | ||
|
|
dd304cf787 | ||
|
|
717daef21e | ||
|
|
16e04afebd | ||
|
|
f227a2f569 | ||
|
|
9b6889b68c | ||
|
|
155975df33 | ||
|
|
a7930e2915 | ||
|
|
f0474027be | ||
|
|
12c338def1 | ||
|
|
e511afb2a5 | ||
|
|
451517e7cd | ||
|
|
5eaeb2749b | ||
|
|
db74898b72 | ||
|
|
61a95e4601 | ||
|
|
a43e2db92b | ||
|
|
23d854a826 | ||
|
|
77a52b82c3 | ||
|
|
d9d3f63160 | ||
|
|
a00e8d6d03 | ||
|
|
f41cf5c6eb | ||
|
|
692adf7e16 | ||
|
|
fd3155f49d | ||
|
|
45264c6481 | ||
|
|
d7357d4f95 | ||
|
|
38e7db7dee | ||
|
|
e48f680fec | ||
|
|
d0c5421ad9 | ||
|
|
cebd44d793 | ||
|
|
baf1936824 | ||
|
|
936d2b9647 | ||
|
|
ae6e74507d | ||
|
|
6c82b9bc6c | ||
|
|
ad560e7d16 | ||
|
|
7c8406f438 | ||
|
|
7c94c8cc56 | ||
|
|
1d56a2a36d | ||
|
|
befbd898cc | ||
|
|
f78804d836 | ||
|
|
682a99ffea | ||
|
|
6a76470f45 | ||
|
|
5f650982a7 | ||
|
|
faaa3603a7 | ||
|
|
d7a9e9cfd8 | ||
|
|
fd946f2aa3 | ||
|
|
b6764e54da | ||
|
|
4e2b5bd347 | ||
|
|
daeccf7288 | ||
|
|
6a11690963 | ||
|
|
b038dbd837 | ||
|
|
a82b32087c | ||
|
|
4cd2b9368d | ||
|
|
11d21e2e89 | ||
|
|
25d37e3970 | ||
|
|
c7a19163ff | ||
|
|
99dc1709d8 | ||
|
|
1b9cf0d8a0 | ||
|
|
534629e2e9 | ||
|
|
010544a35a | ||
|
|
9adbdece7f | ||
|
|
bf4c1dd49f | ||
|
|
147eea1f92 | ||
|
|
bad84b1ef3 | ||
|
|
30e2b75ea6 | ||
|
|
cd319f43e4 | ||
|
|
1e15cf5d5d | ||
|
|
2e0b7f7f8d | ||
|
|
98f3cb93f0 | ||
|
|
cf111426bd | ||
|
|
57553b3cce | ||
|
|
a9f09960c4 | ||
|
|
984c1891e1 | ||
|
|
a00ee4080c | ||
|
|
6b8b56fc1a | ||
|
|
bc79b2a4a6 | ||
|
|
f236d98be2 | ||
|
|
620812b5f8 | ||
|
|
115da0f8a8 | ||
|
|
4540966f87 | ||
|
|
bbad210840 | ||
|
|
ebe4d32523 | ||
|
|
d6bc7e4239 | ||
|
|
47a6e770fe | ||
|
|
c4d7afcdb7 | ||
|
|
8d437b35e8 | ||
|
|
8ed91c4b11 | ||
|
|
3549af2470 | ||
|
|
b297a31b6b | ||
|
|
8796da97b5 | ||
|
|
38c8a58988 | ||
|
|
e0d6853961 | ||
|
|
22eb6788c3 | ||
|
|
98b65c4aec | ||
|
|
1faab632d5 | ||
|
|
466ee39acc | ||
|
|
b9be10e063 | ||
|
|
49e0c2d1ef | ||
|
|
52590e9e2f | ||
|
|
56f506e1b5 | ||
|
|
6a2a437e21 | ||
|
|
74d56576ae | ||
|
|
75b461237e | ||
|
|
1b25f59719 | ||
|
|
434f5a48c0 | ||
|
|
2c1aed89f1 | ||
|
|
7e460e04b0 | ||
|
|
8199b47089 | ||
|
|
7418adb027 | ||
|
|
a6e35167d8 | ||
|
|
1844a2a12e | ||
|
|
3a2c5b90f8 | ||
|
|
ca8d9bb963 | ||
|
|
d4045dff4b | ||
|
|
c31755d293 | ||
|
|
a310be0f6c | ||
|
|
77b7eeae92 | ||
|
|
68b7364cbe | ||
|
|
ed39cdb874 | ||
|
|
6874aed6ed | ||
|
|
8945e5eb21 | ||
|
|
2850b5084d | ||
|
|
f2b63f1ce6 | ||
|
|
9b4017da9f | ||
|
|
df6a4b5e92 | ||
|
|
ac53e46e22 | ||
|
|
01710ab2ae | ||
|
|
250fb6802b | ||
|
|
8e5a47f65b | ||
|
|
06f88f9a00 | ||
|
|
996390ccca | ||
|
|
00eed74f7d | ||
|
|
c2048ae949 | ||
|
|
5081290164 | ||
|
|
ef451a75fd | ||
|
|
455981fd5f | ||
|
|
974118b643 | ||
|
|
07f09d691f | ||
|
|
3fab7c7f83 | ||
|
|
e3c452436d | ||
|
|
ede68db3df | ||
|
|
f20f4938e4 | ||
|
|
33fe6916ed | ||
|
|
e4cdc5f98d | ||
|
|
2f0027b68b |
@@ -0,0 +1,108 @@
|
||||
# Details
|
||||
|
||||
Date : 2023-05-11 22:19:18
|
||||
|
||||
Directory d:\\Embedded\\Projektarbeit-Rover
|
||||
|
||||
Total : 93 files, 4871 codes, 2365 comments, 1394 blanks, all 8630 lines
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/details.md) | Markdown | 60 | 0 | 6 | 66 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/diff-details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/diff-details.md) | Markdown | 9 | 0 | 6 | 15 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/diff.md](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/diff.md) | Markdown | 12 | 0 | 7 | 19 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/results.json](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/results.json) | JSON | 1 | 0 | 0 | 1 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/results.md](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/results.md) | Markdown | 39 | 0 | 7 | 46 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/details.md) | Markdown | 71 | 0 | 6 | 77 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/diff-details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/diff-details.md) | Markdown | 52 | 0 | 6 | 58 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/diff.md](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/diff.md) | Markdown | 31 | 0 | 7 | 38 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/results.json](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/results.json) | JSON | 1 | 0 | 0 | 1 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/results.md](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/results.md) | Markdown | 44 | 0 | 7 | 51 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/details.md) | Markdown | 93 | 0 | 6 | 99 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/diff-details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/diff-details.md) | Markdown | 91 | 0 | 6 | 97 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/diff.md](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/diff.md) | Markdown | 54 | 0 | 7 | 61 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/results.json](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/results.json) | JSON | 1 | 0 | 0 | 1 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/results.md](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/results.md) | Markdown | 57 | 0 | 7 | 64 |
|
||||
| [Projektarbeit-Rover/debugMqtt/hw1/main.py](/Projektarbeit-Rover/debugMqtt/hw1/main.py) | Python | 14 | 2 | 10 | 26 |
|
||||
| [Projektarbeit-Rover/debugMqtt/hw1/main_debug.py](/Projektarbeit-Rover/debugMqtt/hw1/main_debug.py) | Python | 12 | 2 | 10 | 24 |
|
||||
| [Projektarbeit-Rover/debugMqtt/rhede/main.py](/Projektarbeit-Rover/debugMqtt/rhede/main.py) | Python | 16 | 2 | 10 | 28 |
|
||||
| [Projektarbeit-Rover/debugMqtt/rhede/main_debug.py](/Projektarbeit-Rover/debugMqtt/rhede/main_debug.py) | Python | 13 | 2 | 10 | 25 |
|
||||
| [Projektarbeit-Rover/include/config.h](/Projektarbeit-Rover/include/config.h) | C++ | 8 | 26 | 5 | 39 |
|
||||
| [Projektarbeit-Rover/include/moveControl.h](/Projektarbeit-Rover/include/moveControl.h) | C++ | 58 | 130 | 28 | 216 |
|
||||
| [Projektarbeit-Rover/include/moveControlConfig.h](/Projektarbeit-Rover/include/moveControlConfig.h) | C++ | 21 | 18 | 4 | 43 |
|
||||
| [Projektarbeit-Rover/include/network.h](/Projektarbeit-Rover/include/network.h) | C++ | 33 | 56 | 16 | 105 |
|
||||
| [Projektarbeit-Rover/include/networkConfig.h](/Projektarbeit-Rover/include/networkConfig.h) | C++ | 98 | 37 | 17 | 152 |
|
||||
| [Projektarbeit-Rover/lib/Battery/battery.cpp](/Projektarbeit-Rover/lib/Battery/battery.cpp) | C++ | 107 | 13 | 22 | 142 |
|
||||
| [Projektarbeit-Rover/lib/Battery/battery.h](/Projektarbeit-Rover/lib/Battery/battery.h) | C++ | 55 | 65 | 16 | 136 |
|
||||
| [Projektarbeit-Rover/lib/ControllPad/controlPad.cpp](/Projektarbeit-Rover/lib/ControllPad/controlPad.cpp) | C++ | 56 | 10 | 15 | 81 |
|
||||
| [Projektarbeit-Rover/lib/ControllPad/controlPad.h](/Projektarbeit-Rover/lib/ControllPad/controlPad.h) | C++ | 25 | 10 | 16 | 51 |
|
||||
| [Projektarbeit-Rover/lib/ControllPad/controlPadInput.h](/Projektarbeit-Rover/lib/ControllPad/controlPadInput.h) | C++ | 50 | 10 | 15 | 75 |
|
||||
| [Projektarbeit-Rover/lib/Counter/counter.cpp](/Projektarbeit-Rover/lib/Counter/counter.cpp) | C++ | 45 | 0 | 12 | 57 |
|
||||
| [Projektarbeit-Rover/lib/Counter/counter.h](/Projektarbeit-Rover/lib/Counter/counter.h) | C++ | 21 | 0 | 10 | 31 |
|
||||
| [Projektarbeit-Rover/lib/Illumination/underfloorLighting.cpp](/Projektarbeit-Rover/lib/Illumination/underfloorLighting.cpp) | C++ | 0 | 0 | 1 | 1 |
|
||||
| [Projektarbeit-Rover/lib/Illumination/underfloorLighting.h](/Projektarbeit-Rover/lib/Illumination/underfloorLighting.h) | C++ | 0 | 0 | 1 | 1 |
|
||||
| [Projektarbeit-Rover/lib/LcdWrapper/LcdWrapper.cpp](/Projektarbeit-Rover/lib/LcdWrapper/LcdWrapper.cpp) | C++ | 45 | 10 | 12 | 67 |
|
||||
| [Projektarbeit-Rover/lib/LcdWrapper/LcdWrapper.h](/Projektarbeit-Rover/lib/LcdWrapper/LcdWrapper.h) | C++ | 25 | 41 | 15 | 81 |
|
||||
| [Projektarbeit-Rover/lib/MQTT/debugMqtt.cpp](/Projektarbeit-Rover/lib/MQTT/debugMqtt.cpp) | C++ | 81 | 12 | 17 | 110 |
|
||||
| [Projektarbeit-Rover/lib/MQTT/debugMqtt.h](/Projektarbeit-Rover/lib/MQTT/debugMqtt.h) | C++ | 41 | 120 | 18 | 179 |
|
||||
| [Projektarbeit-Rover/lib/MotorControl/motorControl.cpp](/Projektarbeit-Rover/lib/MotorControl/motorControl.cpp) | C++ | 142 | 24 | 35 | 201 |
|
||||
| [Projektarbeit-Rover/lib/MotorControl/motorControl.h](/Projektarbeit-Rover/lib/MotorControl/motorControl.h) | C++ | 48 | 102 | 22 | 172 |
|
||||
| [Projektarbeit-Rover/lib/Navigation/navigation.cpp](/Projektarbeit-Rover/lib/Navigation/navigation.cpp) | C++ | 192 | 29 | 47 | 268 |
|
||||
| [Projektarbeit-Rover/lib/Navigation/navigation.h](/Projektarbeit-Rover/lib/Navigation/navigation.h) | C++ | 68 | 141 | 36 | 245 |
|
||||
| [Projektarbeit-Rover/lib/Navigation/route.cpp](/Projektarbeit-Rover/lib/Navigation/route.cpp) | C++ | 125 | 22 | 34 | 181 |
|
||||
| [Projektarbeit-Rover/lib/Navigation/route.h](/Projektarbeit-Rover/lib/Navigation/route.h) | C++ | 71 | 135 | 35 | 241 |
|
||||
| [Projektarbeit-Rover/lib/NtripClient/ntripClient.cpp](/Projektarbeit-Rover/lib/NtripClient/ntripClient.cpp) | C++ | 198 | 23 | 46 | 267 |
|
||||
| [Projektarbeit-Rover/lib/NtripClient/ntripClient.h](/Projektarbeit-Rover/lib/NtripClient/ntripClient.h) | C++ | 51 | 63 | 18 | 132 |
|
||||
| [Projektarbeit-Rover/lib/Speedometer/speedometer.cpp](/Projektarbeit-Rover/lib/Speedometer/speedometer.cpp) | C++ | 109 | 18 | 32 | 159 |
|
||||
| [Projektarbeit-Rover/lib/Speedometer/speedometer.h](/Projektarbeit-Rover/lib/Speedometer/speedometer.h) | C++ | 51 | 100 | 28 | 179 |
|
||||
| [Projektarbeit-Rover/lib/Times/debugTimes.cpp](/Projektarbeit-Rover/lib/Times/debugTimes.cpp) | C++ | 28 | 10 | 9 | 47 |
|
||||
| [Projektarbeit-Rover/lib/Times/debugTimes.h](/Projektarbeit-Rover/lib/Times/debugTimes.h) | C++ | 19 | 45 | 13 | 77 |
|
||||
| [Projektarbeit-Rover/platformio.ini](/Projektarbeit-Rover/platformio.ini) | Ini | 26 | 9 | 5 | 40 |
|
||||
| [Projektarbeit-Rover/src/OutputBuf/outputBuf.cpp](/Projektarbeit-Rover/src/OutputBuf/outputBuf.cpp) | C++ | 36 | 11 | 13 | 60 |
|
||||
| [Projektarbeit-Rover/src/OutputBuf/outputBuf.h](/Projektarbeit-Rover/src/OutputBuf/outputBuf.h) | C++ | 24 | 48 | 14 | 86 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/GPS/menuGPS.cpp](/Projektarbeit-Rover/src/SpecialMenus/GPS/menuGPS.cpp) | C++ | 130 | 11 | 19 | 160 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/GPS/menuGPS.h](/Projektarbeit-Rover/src/SpecialMenus/GPS/menuGPS.h) | C++ | 17 | 19 | 8 | 44 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/PID/menuPidSettings.cpp](/Projektarbeit-Rover/src/SpecialMenus/PID/menuPidSettings.cpp) | C++ | 9 | 10 | 4 | 23 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/PID/menuPidSettings.h](/Projektarbeit-Rover/src/SpecialMenus/PID/menuPidSettings.h) | C++ | 13 | 19 | 8 | 40 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Route/menuRoute.cpp](/Projektarbeit-Rover/src/SpecialMenus/Route/menuRoute.cpp) | C++ | 197 | 13 | 55 | 265 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Route/menuRoute.h](/Projektarbeit-Rover/src/SpecialMenus/Route/menuRoute.h) | C++ | 52 | 83 | 22 | 157 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Route/menuRoutePoints.cpp](/Projektarbeit-Rover/src/SpecialMenus/Route/menuRoutePoints.cpp) | C++ | 54 | 12 | 11 | 77 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Route/menuRoutePoints.h](/Projektarbeit-Rover/src/SpecialMenus/Route/menuRoutePoints.h) | C++ | 15 | 27 | 9 | 51 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Systeminformation/menuSysteminformatio.cpp](/Projektarbeit-Rover/src/SpecialMenus/Systeminformation/menuSysteminformatio.cpp) | C++ | 34 | 15 | 11 | 60 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Systeminformation/menuSysteminformation.h](/Projektarbeit-Rover/src/SpecialMenus/Systeminformation/menuSysteminformation.h) | C++ | 14 | 21 | 8 | 43 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp) | C++ | 122 | 10 | 24 | 156 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h) | C++ | 14 | 31 | 9 | 54 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/CaptureRoute/menuCaptureRoute.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/CaptureRoute/menuCaptureRoute.cpp) | C++ | 47 | 10 | 13 | 70 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/CaptureRoute/menuCaptureRoute.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/CaptureRoute/menuCaptureRoute.h) | C++ | 13 | 31 | 8 | 52 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/ManualDrive/menuManualDrive.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/ManualDrive/menuManualDrive.cpp) | C++ | 58 | 10 | 16 | 84 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/ManualDrive/menuManualDrive.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/ManualDrive/menuManualDrive.h) | C++ | 14 | 27 | 8 | 49 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/menuTestMode.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/menuTestMode.cpp) | C++ | 183 | 20 | 40 | 243 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/menuTestMode.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/menuTestMode.h) | C++ | 48 | 36 | 16 | 100 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/speedometerTest.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/speedometerTest.cpp) | C++ | 54 | 10 | 16 | 80 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/speedometerTest.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/speedometerTest.h) | C++ | 20 | 34 | 11 | 65 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/menuDriveMode.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/menuDriveMode.cpp) | C++ | 16 | 10 | 5 | 31 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/menuDriveMode.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/menuDriveMode.h) | C++ | 15 | 25 | 8 | 48 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilot.cpp](/Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilot.cpp) | C++ | 99 | 11 | 25 | 135 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilot.h](/Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilot.h) | C++ | 46 | 68 | 18 | 132 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilotConfig.h](/Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilotConfig.h) | C++ | 9 | 36 | 10 | 55 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/CaptureRoute/captureRoute.cpp](/Projektarbeit-Rover/src/driveModi/Modi/CaptureRoute/captureRoute.cpp) | C++ | 63 | 10 | 14 | 87 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/CaptureRoute/captureRoute.h](/Projektarbeit-Rover/src/driveModi/Modi/CaptureRoute/captureRoute.h) | C++ | 34 | 62 | 17 | 113 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/ConsolControl/consolControl.cpp](/Projektarbeit-Rover/src/driveModi/Modi/ConsolControl/consolControl.cpp) | C++ | 1 | 10 | 3 | 14 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/ConsolControl/consolControl.h](/Projektarbeit-Rover/src/driveModi/Modi/ConsolControl/consolControl.h) | C++ | 6 | 10 | 5 | 21 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/ManualControl/manualControl.cpp](/Projektarbeit-Rover/src/driveModi/Modi/ManualControl/manualControl.cpp) | C++ | 26 | 15 | 8 | 49 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/ManualControl/manualControl.h](/Projektarbeit-Rover/src/driveModi/Modi/ManualControl/manualControl.h) | C++ | 30 | 49 | 12 | 91 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Racing/racing.cpp](/Projektarbeit-Rover/src/driveModi/Modi/Racing/racing.cpp) | C++ | 0 | 0 | 1 | 1 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Racing/racing.h](/Projektarbeit-Rover/src/driveModi/Modi/Racing/racing.h) | C++ | 0 | 0 | 1 | 1 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/TestMode/testMode.cpp](/Projektarbeit-Rover/src/driveModi/Modi/TestMode/testMode.cpp) | C++ | 115 | 14 | 27 | 156 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/TestMode/testMode.h](/Projektarbeit-Rover/src/driveModi/Modi/TestMode/testMode.h) | C++ | 50 | 79 | 24 | 153 |
|
||||
| [Projektarbeit-Rover/src/driveModi/driveManager.cpp](/Projektarbeit-Rover/src/driveModi/driveManager.cpp) | C++ | 64 | 14 | 21 | 99 |
|
||||
| [Projektarbeit-Rover/src/driveModi/driveManager.h](/Projektarbeit-Rover/src/driveModi/driveManager.h) | C++ | 43 | 69 | 17 | 129 |
|
||||
| [Projektarbeit-Rover/src/driveModi/driveModi.h](/Projektarbeit-Rover/src/driveModi/driveModi.h) | C++ | 9 | 22 | 5 | 36 |
|
||||
| [Projektarbeit-Rover/src/main.cpp](/Projektarbeit-Rover/src/main.cpp) | C++ | 234 | 22 | 47 | 303 |
|
||||
| [Projektarbeit-Rover/src/moveControl.cpp](/Projektarbeit-Rover/src/moveControl.cpp) | C++ | 162 | 27 | 39 | 228 |
|
||||
| [Projektarbeit-Rover/src/network.cpp](/Projektarbeit-Rover/src/network.cpp) | C++ | 113 | 17 | 26 | 156 |
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
@@ -0,0 +1,192 @@
|
||||
# Diff Details
|
||||
|
||||
Date : 2023-05-11 22:19:18
|
||||
|
||||
Directory d:\\Embedded\\Projektarbeit-Rover
|
||||
|
||||
Total : 177 files, 592 codes, 367 comments, 256 blanks, all 1215 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\details.md](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-01-19_11-26-30%5Cdetails.md) | Markdown | -60 | 0 | -6 | -66 |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\diff-details.md](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-01-19_11-26-30%5Cdiff-details.md) | Markdown | -9 | 0 | -6 | -15 |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\diff.md](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-01-19_11-26-30%5Cdiff.md) | Markdown | -12 | 0 | -7 | -19 |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\results.json](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-01-19_11-26-30%5Cresults.json) | JSON | -1 | 0 | 0 | -1 |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\results.md](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-01-19_11-26-30%5Cresults.md) | Markdown | -39 | 0 | -7 | -46 |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\details.md](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-02-01_10-50-06%5Cdetails.md) | Markdown | -71 | 0 | -6 | -77 |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\diff-details.md](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-02-01_10-50-06%5Cdiff-details.md) | Markdown | -52 | 0 | -6 | -58 |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\diff.md](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-02-01_10-50-06%5Cdiff.md) | Markdown | -31 | 0 | -7 | -38 |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\results.json](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-02-01_10-50-06%5Cresults.json) | JSON | -1 | 0 | 0 | -1 |
|
||||
| [c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\results.md](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5C.VSCodeCounter%5C2022-02-01_10-50-06%5Cresults.md) | Markdown | -44 | 0 | -7 | -51 |
|
||||
| [c:\Users\alex1\git\projektarbeit\debugMqtt\hw1\main.py](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5CdebugMqtt%5Chw1%5Cmain.py) | Python | -14 | -2 | -10 | -26 |
|
||||
| [c:\Users\alex1\git\projektarbeit\debugMqtt\hw1\main_debug.py](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5CdebugMqtt%5Chw1%5Cmain_debug.py) | Python | -12 | -2 | -10 | -24 |
|
||||
| [c:\Users\alex1\git\projektarbeit\debugMqtt\rhede\main.py](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5CdebugMqtt%5Crhede%5Cmain.py) | Python | -16 | -2 | -10 | -28 |
|
||||
| [c:\Users\alex1\git\projektarbeit\debugMqtt\rhede\main_debug.py](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5CdebugMqtt%5Crhede%5Cmain_debug.py) | Python | -13 | -2 | -10 | -25 |
|
||||
| [c:\Users\alex1\git\projektarbeit\doc\Diagrams\classdiagramm.uxf](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Cdoc%5CDiagrams%5Cclassdiagramm.uxf) | umlet | -142 | 0 | -15 | -157 |
|
||||
| [c:\Users\alex1\git\projektarbeit\doc\Diagrams\statesAutopilot.uxf](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Cdoc%5CDiagrams%5CstatesAutopilot.uxf) | umlet | -389 | 0 | -2 | -391 |
|
||||
| [c:\Users\alex1\git\projektarbeit\include\config.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Cinclude%5Cconfig.h) | C++ | -5 | -15 | -2 | -22 |
|
||||
| [c:\Users\alex1\git\projektarbeit\include\moveControl.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Cinclude%5CmoveControl.h) | C++ | -54 | -102 | -23 | -179 |
|
||||
| [c:\Users\alex1\git\projektarbeit\include\moveControlConfig.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Cinclude%5CmoveControlConfig.h) | C++ | -23 | -18 | -4 | -45 |
|
||||
| [c:\Users\alex1\git\projektarbeit\include\network.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Cinclude%5Cnetwork.h) | C++ | -25 | -56 | -14 | -95 |
|
||||
| [c:\Users\alex1\git\projektarbeit\include\networkConfig.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Cinclude%5CnetworkConfig.h) | C++ | -97 | -37 | -17 | -151 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Battery\battery.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CBattery%5Cbattery.cpp) | C++ | -45 | -11 | -10 | -66 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Battery\battery.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CBattery%5Cbattery.h) | C++ | -33 | -52 | -13 | -98 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Illumination\underfloorLighting.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CIllumination%5CunderfloorLighting.cpp) | C++ | 0 | 0 | -1 | -1 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Illumination\underfloorLighting.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CIllumination%5CunderfloorLighting.h) | C++ | 0 | 0 | -1 | -1 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\MQTT\debugMqtt.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMQTT%5CdebugMqtt.cpp) | C++ | -81 | -12 | -17 | -110 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\MQTT\debugMqtt.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMQTT%5CdebugMqtt.h) | C++ | -41 | -120 | -18 | -179 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Menu\menu.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMenu%5Cmenu.cpp) | C++ | -106 | -11 | -19 | -136 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Menu\menu.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMenu%5Cmenu.h) | C++ | -26 | -18 | -12 | -56 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Menu\menuAction.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMenu%5CmenuAction.cpp) | C++ | -36 | -10 | -9 | -55 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Menu\menuAction.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMenu%5CmenuAction.h) | C++ | -21 | -53 | -15 | -89 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Menu\menuControl.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMenu%5CmenuControl.h) | C++ | -22 | -44 | -10 | -76 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Menu\menuIntInput.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMenu%5CmenuIntInput.cpp) | C++ | -170 | -14 | -41 | -225 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Menu\menuIntInput.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMenu%5CmenuIntInput.h) | C++ | -46 | -34 | -20 | -100 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\MotorControl\motorControl.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMotorControl%5CmotorControl.cpp) | C++ | -144 | -24 | -35 | -203 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\MotorControl\motorControl.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CMotorControl%5CmotorControl.h) | C++ | -47 | -102 | -22 | -171 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Navigation\navigation.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CNavigation%5Cnavigation.cpp) | C++ | -178 | -28 | -40 | -246 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Navigation\navigation.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CNavigation%5Cnavigation.h) | C++ | -53 | -119 | -29 | -201 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Navigation\route.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CNavigation%5Croute.cpp) | C++ | -28 | -10 | -8 | -46 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Navigation\route.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CNavigation%5Croute.h) | C++ | -34 | -74 | -20 | -128 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\NtripClient\ntripClient.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CNtripClient%5CntripClient.cpp) | C++ | -186 | -22 | -42 | -250 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\NtripClient\ntripClient.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CNtripClient%5CntripClient.h) | C++ | -50 | 0 | -16 | -66 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Speedometer\speedometer.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CSpeedometer%5Cspeedometer.cpp) | C++ | -81 | -12 | -21 | -114 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Speedometer\speedometer.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CSpeedometer%5Cspeedometer.h) | C++ | -35 | -68 | -22 | -125 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Times\debugTimes.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CTimes%5CdebugTimes.cpp) | C++ | -28 | -10 | -9 | -47 |
|
||||
| [c:\Users\alex1\git\projektarbeit\lib\Times\debugTimes.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Clib%5CTimes%5CdebugTimes.h) | C++ | -19 | -40 | -13 | -72 |
|
||||
| [c:\Users\alex1\git\projektarbeit\platformio.ini](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Cplatformio.ini) | Ini | -19 | -9 | -3 | -31 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\OutputBuf\outputBuf.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5COutputBuf%5CoutputBuf.cpp) | C++ | -36 | -11 | -13 | -60 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\OutputBuf\outputBuf.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5COutputBuf%5CoutputBuf.h) | C++ | -24 | -32 | -12 | -68 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\Akku\menuAkku.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CAkku%5CmenuAkku.cpp) | C++ | -48 | -10 | -12 | -70 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\Akku\menuAkku.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CAkku%5CmenuAkku.h) | C++ | -22 | -31 | -12 | -65 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\GPS\menuGPS.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CGPS%5CmenuGPS.cpp) | C++ | -159 | -10 | -23 | -192 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\GPS\menuGPS.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CGPS%5CmenuGPS.h) | C++ | -28 | -47 | -18 | -93 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\PID\menuPidSettings.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CPID%5CmenuPidSettings.cpp) | C++ | -65 | -10 | -19 | -94 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\PID\menuPidSettings.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CPID%5CmenuPidSettings.h) | C++ | -23 | -43 | -16 | -82 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CAutopilot%5CmenuAutopilot.cpp) | C++ | -69 | -11 | -14 | -94 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CAutopilot%5CmenuAutopilot.h) | C++ | -16 | -31 | -10 | -57 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CCaptureRoute%5CmenuCaptureRoute.cpp) | C++ | -25 | -10 | -6 | -41 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CCaptureRoute%5CmenuCaptureRoute.h) | C++ | -14 | -31 | -8 | -53 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CManualDrive%5CmenuManualDrive.cpp) | C++ | -12 | -10 | -3 | -25 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CManualDrive%5CmenuManualDrive.h) | C++ | -9 | -27 | -6 | -42 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\TestMode\menuTestMode.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CTestMode%5CmenuTestMode.cpp) | C++ | -115 | -23 | -29 | -167 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\TestMode\menuTestMode.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CTestMode%5CmenuTestMode.h) | C++ | -37 | -10 | -11 | -58 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\menuDriveMode.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CmenuDriveMode.cpp) | C++ | -13 | -10 | -5 | -28 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\menuDriveMode.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CSpecialMenus%5CdriveModi%5CmenuDriveMode.h) | C++ | -20 | -22 | -8 | -50 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot\autopilot.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CAutopilot%5Cautopilot.cpp) | C++ | -73 | -11 | -20 | -104 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot\autopilot.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CAutopilot%5Cautopilot.h) | C++ | -34 | -82 | -19 | -135 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot\autopilotConfig.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CAutopilot%5CautopilotConfig.h) | C++ | -9 | -36 | -10 | -55 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\CaptureRoute\captureRoute.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CCaptureRoute%5CcaptureRoute.cpp) | C++ | -29 | -10 | -7 | -46 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\CaptureRoute\captureRoute.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CCaptureRoute%5CcaptureRoute.h) | C++ | -21 | -51 | -13 | -85 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ConsolControl\consolControl.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CConsolControl%5CconsolControl.cpp) | C++ | -1 | -10 | -3 | -14 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ConsolControl\consolControl.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CConsolControl%5CconsolControl.h) | C++ | -6 | -10 | -5 | -21 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ManualControl\manualControl.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CManualControl%5CmanualControl.cpp) | C++ | -25 | -10 | -7 | -42 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ManualControl\manualControl.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CManualControl%5CmanualControl.h) | C++ | -22 | -49 | -12 | -83 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Racing\racing.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CRacing%5Cracing.cpp) | C++ | 0 | 0 | -1 | -1 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Racing\racing.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CRacing%5Cracing.h) | C++ | 0 | 0 | -1 | -1 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\TestMode\testMode.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CTestMode%5CtestMode.cpp) | C++ | -99 | -14 | -28 | -141 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\TestMode\testMode.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CModi%5CTestMode%5CtestMode.h) | C++ | -26 | -10 | -14 | -50 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\driveManager.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CdriveManager.cpp) | C++ | -63 | -13 | -21 | -97 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\driveManager.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CdriveManager.h) | C++ | -41 | -69 | -17 | -127 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\driveModi\driveModi.h](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CdriveModi%5CdriveModi.h) | C++ | -10 | -22 | -6 | -38 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\main.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5Cmain.cpp) | C++ | -227 | -38 | -43 | -308 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\moveControl.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5CmoveControl.cpp) | C++ | -133 | -35 | -34 | -202 |
|
||||
| [c:\Users\alex1\git\projektarbeit\src\network.cpp](/c:%5CUsers%5Calex1%5Cgit%5Cprojektarbeit%5Csrc%5Cnetwork.cpp) | C++ | -86 | -16 | -17 | -119 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/details.md) | Markdown | 60 | 0 | 6 | 66 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/diff-details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/diff-details.md) | Markdown | 9 | 0 | 6 | 15 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/diff.md](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/diff.md) | Markdown | 12 | 0 | 7 | 19 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/results.json](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/results.json) | JSON | 1 | 0 | 0 | 1 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/results.md](/Projektarbeit-Rover/.VSCodeCounter/2022-01-19_11-26-30/results.md) | Markdown | 39 | 0 | 7 | 46 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/details.md) | Markdown | 71 | 0 | 6 | 77 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/diff-details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/diff-details.md) | Markdown | 52 | 0 | 6 | 58 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/diff.md](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/diff.md) | Markdown | 31 | 0 | 7 | 38 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/results.json](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/results.json) | JSON | 1 | 0 | 0 | 1 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/results.md](/Projektarbeit-Rover/.VSCodeCounter/2022-02-01_10-50-06/results.md) | Markdown | 44 | 0 | 7 | 51 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/details.md) | Markdown | 93 | 0 | 6 | 99 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/diff-details.md](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/diff-details.md) | Markdown | 91 | 0 | 6 | 97 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/diff.md](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/diff.md) | Markdown | 54 | 0 | 7 | 61 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/results.json](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/results.json) | JSON | 1 | 0 | 0 | 1 |
|
||||
| [Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/results.md](/Projektarbeit-Rover/.VSCodeCounter/2022-12-09_11-39-58/results.md) | Markdown | 57 | 0 | 7 | 64 |
|
||||
| [Projektarbeit-Rover/debugMqtt/hw1/main.py](/Projektarbeit-Rover/debugMqtt/hw1/main.py) | Python | 14 | 2 | 10 | 26 |
|
||||
| [Projektarbeit-Rover/debugMqtt/hw1/main_debug.py](/Projektarbeit-Rover/debugMqtt/hw1/main_debug.py) | Python | 12 | 2 | 10 | 24 |
|
||||
| [Projektarbeit-Rover/debugMqtt/rhede/main.py](/Projektarbeit-Rover/debugMqtt/rhede/main.py) | Python | 16 | 2 | 10 | 28 |
|
||||
| [Projektarbeit-Rover/debugMqtt/rhede/main_debug.py](/Projektarbeit-Rover/debugMqtt/rhede/main_debug.py) | Python | 13 | 2 | 10 | 25 |
|
||||
| [Projektarbeit-Rover/include/config.h](/Projektarbeit-Rover/include/config.h) | C++ | 8 | 26 | 5 | 39 |
|
||||
| [Projektarbeit-Rover/include/moveControl.h](/Projektarbeit-Rover/include/moveControl.h) | C++ | 58 | 130 | 28 | 216 |
|
||||
| [Projektarbeit-Rover/include/moveControlConfig.h](/Projektarbeit-Rover/include/moveControlConfig.h) | C++ | 21 | 18 | 4 | 43 |
|
||||
| [Projektarbeit-Rover/include/network.h](/Projektarbeit-Rover/include/network.h) | C++ | 33 | 56 | 16 | 105 |
|
||||
| [Projektarbeit-Rover/include/networkConfig.h](/Projektarbeit-Rover/include/networkConfig.h) | C++ | 98 | 37 | 17 | 152 |
|
||||
| [Projektarbeit-Rover/lib/Battery/battery.cpp](/Projektarbeit-Rover/lib/Battery/battery.cpp) | C++ | 107 | 13 | 22 | 142 |
|
||||
| [Projektarbeit-Rover/lib/Battery/battery.h](/Projektarbeit-Rover/lib/Battery/battery.h) | C++ | 55 | 65 | 16 | 136 |
|
||||
| [Projektarbeit-Rover/lib/ControllPad/controlPad.cpp](/Projektarbeit-Rover/lib/ControllPad/controlPad.cpp) | C++ | 56 | 10 | 15 | 81 |
|
||||
| [Projektarbeit-Rover/lib/ControllPad/controlPad.h](/Projektarbeit-Rover/lib/ControllPad/controlPad.h) | C++ | 25 | 10 | 16 | 51 |
|
||||
| [Projektarbeit-Rover/lib/ControllPad/controlPadInput.h](/Projektarbeit-Rover/lib/ControllPad/controlPadInput.h) | C++ | 50 | 10 | 15 | 75 |
|
||||
| [Projektarbeit-Rover/lib/Counter/counter.cpp](/Projektarbeit-Rover/lib/Counter/counter.cpp) | C++ | 45 | 0 | 12 | 57 |
|
||||
| [Projektarbeit-Rover/lib/Counter/counter.h](/Projektarbeit-Rover/lib/Counter/counter.h) | C++ | 21 | 0 | 10 | 31 |
|
||||
| [Projektarbeit-Rover/lib/Illumination/underfloorLighting.cpp](/Projektarbeit-Rover/lib/Illumination/underfloorLighting.cpp) | C++ | 0 | 0 | 1 | 1 |
|
||||
| [Projektarbeit-Rover/lib/Illumination/underfloorLighting.h](/Projektarbeit-Rover/lib/Illumination/underfloorLighting.h) | C++ | 0 | 0 | 1 | 1 |
|
||||
| [Projektarbeit-Rover/lib/LcdWrapper/LcdWrapper.cpp](/Projektarbeit-Rover/lib/LcdWrapper/LcdWrapper.cpp) | C++ | 45 | 10 | 12 | 67 |
|
||||
| [Projektarbeit-Rover/lib/LcdWrapper/LcdWrapper.h](/Projektarbeit-Rover/lib/LcdWrapper/LcdWrapper.h) | C++ | 25 | 41 | 15 | 81 |
|
||||
| [Projektarbeit-Rover/lib/MQTT/debugMqtt.cpp](/Projektarbeit-Rover/lib/MQTT/debugMqtt.cpp) | C++ | 81 | 12 | 17 | 110 |
|
||||
| [Projektarbeit-Rover/lib/MQTT/debugMqtt.h](/Projektarbeit-Rover/lib/MQTT/debugMqtt.h) | C++ | 41 | 120 | 18 | 179 |
|
||||
| [Projektarbeit-Rover/lib/MotorControl/motorControl.cpp](/Projektarbeit-Rover/lib/MotorControl/motorControl.cpp) | C++ | 142 | 24 | 35 | 201 |
|
||||
| [Projektarbeit-Rover/lib/MotorControl/motorControl.h](/Projektarbeit-Rover/lib/MotorControl/motorControl.h) | C++ | 48 | 102 | 22 | 172 |
|
||||
| [Projektarbeit-Rover/lib/Navigation/navigation.cpp](/Projektarbeit-Rover/lib/Navigation/navigation.cpp) | C++ | 192 | 29 | 47 | 268 |
|
||||
| [Projektarbeit-Rover/lib/Navigation/navigation.h](/Projektarbeit-Rover/lib/Navigation/navigation.h) | C++ | 68 | 141 | 36 | 245 |
|
||||
| [Projektarbeit-Rover/lib/Navigation/route.cpp](/Projektarbeit-Rover/lib/Navigation/route.cpp) | C++ | 125 | 22 | 34 | 181 |
|
||||
| [Projektarbeit-Rover/lib/Navigation/route.h](/Projektarbeit-Rover/lib/Navigation/route.h) | C++ | 71 | 135 | 35 | 241 |
|
||||
| [Projektarbeit-Rover/lib/NtripClient/ntripClient.cpp](/Projektarbeit-Rover/lib/NtripClient/ntripClient.cpp) | C++ | 198 | 23 | 46 | 267 |
|
||||
| [Projektarbeit-Rover/lib/NtripClient/ntripClient.h](/Projektarbeit-Rover/lib/NtripClient/ntripClient.h) | C++ | 51 | 63 | 18 | 132 |
|
||||
| [Projektarbeit-Rover/lib/Speedometer/speedometer.cpp](/Projektarbeit-Rover/lib/Speedometer/speedometer.cpp) | C++ | 109 | 18 | 32 | 159 |
|
||||
| [Projektarbeit-Rover/lib/Speedometer/speedometer.h](/Projektarbeit-Rover/lib/Speedometer/speedometer.h) | C++ | 51 | 100 | 28 | 179 |
|
||||
| [Projektarbeit-Rover/lib/Times/debugTimes.cpp](/Projektarbeit-Rover/lib/Times/debugTimes.cpp) | C++ | 28 | 10 | 9 | 47 |
|
||||
| [Projektarbeit-Rover/lib/Times/debugTimes.h](/Projektarbeit-Rover/lib/Times/debugTimes.h) | C++ | 19 | 45 | 13 | 77 |
|
||||
| [Projektarbeit-Rover/platformio.ini](/Projektarbeit-Rover/platformio.ini) | Ini | 26 | 9 | 5 | 40 |
|
||||
| [Projektarbeit-Rover/src/OutputBuf/outputBuf.cpp](/Projektarbeit-Rover/src/OutputBuf/outputBuf.cpp) | C++ | 36 | 11 | 13 | 60 |
|
||||
| [Projektarbeit-Rover/src/OutputBuf/outputBuf.h](/Projektarbeit-Rover/src/OutputBuf/outputBuf.h) | C++ | 24 | 48 | 14 | 86 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/GPS/menuGPS.cpp](/Projektarbeit-Rover/src/SpecialMenus/GPS/menuGPS.cpp) | C++ | 130 | 11 | 19 | 160 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/GPS/menuGPS.h](/Projektarbeit-Rover/src/SpecialMenus/GPS/menuGPS.h) | C++ | 17 | 19 | 8 | 44 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/PID/menuPidSettings.cpp](/Projektarbeit-Rover/src/SpecialMenus/PID/menuPidSettings.cpp) | C++ | 9 | 10 | 4 | 23 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/PID/menuPidSettings.h](/Projektarbeit-Rover/src/SpecialMenus/PID/menuPidSettings.h) | C++ | 13 | 19 | 8 | 40 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Route/menuRoute.cpp](/Projektarbeit-Rover/src/SpecialMenus/Route/menuRoute.cpp) | C++ | 197 | 13 | 55 | 265 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Route/menuRoute.h](/Projektarbeit-Rover/src/SpecialMenus/Route/menuRoute.h) | C++ | 52 | 83 | 22 | 157 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Route/menuRoutePoints.cpp](/Projektarbeit-Rover/src/SpecialMenus/Route/menuRoutePoints.cpp) | C++ | 54 | 12 | 11 | 77 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Route/menuRoutePoints.h](/Projektarbeit-Rover/src/SpecialMenus/Route/menuRoutePoints.h) | C++ | 15 | 27 | 9 | 51 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Systeminformation/menuSysteminformatio.cpp](/Projektarbeit-Rover/src/SpecialMenus/Systeminformation/menuSysteminformatio.cpp) | C++ | 34 | 15 | 11 | 60 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/Systeminformation/menuSysteminformation.h](/Projektarbeit-Rover/src/SpecialMenus/Systeminformation/menuSysteminformation.h) | C++ | 14 | 21 | 8 | 43 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp) | C++ | 122 | 10 | 24 | 156 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h) | C++ | 14 | 31 | 9 | 54 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/CaptureRoute/menuCaptureRoute.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/CaptureRoute/menuCaptureRoute.cpp) | C++ | 47 | 10 | 13 | 70 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/CaptureRoute/menuCaptureRoute.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/CaptureRoute/menuCaptureRoute.h) | C++ | 13 | 31 | 8 | 52 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/ManualDrive/menuManualDrive.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/ManualDrive/menuManualDrive.cpp) | C++ | 58 | 10 | 16 | 84 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/ManualDrive/menuManualDrive.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/ManualDrive/menuManualDrive.h) | C++ | 14 | 27 | 8 | 49 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/menuTestMode.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/menuTestMode.cpp) | C++ | 183 | 20 | 40 | 243 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/menuTestMode.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/menuTestMode.h) | C++ | 48 | 36 | 16 | 100 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/speedometerTest.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/speedometerTest.cpp) | C++ | 54 | 10 | 16 | 80 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/speedometerTest.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/TestMode/speedometerTest.h) | C++ | 20 | 34 | 11 | 65 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/menuDriveMode.cpp](/Projektarbeit-Rover/src/SpecialMenus/driveModi/menuDriveMode.cpp) | C++ | 16 | 10 | 5 | 31 |
|
||||
| [Projektarbeit-Rover/src/SpecialMenus/driveModi/menuDriveMode.h](/Projektarbeit-Rover/src/SpecialMenus/driveModi/menuDriveMode.h) | C++ | 15 | 25 | 8 | 48 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilot.cpp](/Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilot.cpp) | C++ | 99 | 11 | 25 | 135 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilot.h](/Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilot.h) | C++ | 46 | 68 | 18 | 132 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilotConfig.h](/Projektarbeit-Rover/src/driveModi/Modi/Autopilot/autopilotConfig.h) | C++ | 9 | 36 | 10 | 55 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/CaptureRoute/captureRoute.cpp](/Projektarbeit-Rover/src/driveModi/Modi/CaptureRoute/captureRoute.cpp) | C++ | 63 | 10 | 14 | 87 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/CaptureRoute/captureRoute.h](/Projektarbeit-Rover/src/driveModi/Modi/CaptureRoute/captureRoute.h) | C++ | 34 | 62 | 17 | 113 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/ConsolControl/consolControl.cpp](/Projektarbeit-Rover/src/driveModi/Modi/ConsolControl/consolControl.cpp) | C++ | 1 | 10 | 3 | 14 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/ConsolControl/consolControl.h](/Projektarbeit-Rover/src/driveModi/Modi/ConsolControl/consolControl.h) | C++ | 6 | 10 | 5 | 21 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/ManualControl/manualControl.cpp](/Projektarbeit-Rover/src/driveModi/Modi/ManualControl/manualControl.cpp) | C++ | 26 | 15 | 8 | 49 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/ManualControl/manualControl.h](/Projektarbeit-Rover/src/driveModi/Modi/ManualControl/manualControl.h) | C++ | 30 | 49 | 12 | 91 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Racing/racing.cpp](/Projektarbeit-Rover/src/driveModi/Modi/Racing/racing.cpp) | C++ | 0 | 0 | 1 | 1 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/Racing/racing.h](/Projektarbeit-Rover/src/driveModi/Modi/Racing/racing.h) | C++ | 0 | 0 | 1 | 1 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/TestMode/testMode.cpp](/Projektarbeit-Rover/src/driveModi/Modi/TestMode/testMode.cpp) | C++ | 115 | 14 | 27 | 156 |
|
||||
| [Projektarbeit-Rover/src/driveModi/Modi/TestMode/testMode.h](/Projektarbeit-Rover/src/driveModi/Modi/TestMode/testMode.h) | C++ | 50 | 79 | 24 | 153 |
|
||||
| [Projektarbeit-Rover/src/driveModi/driveManager.cpp](/Projektarbeit-Rover/src/driveModi/driveManager.cpp) | C++ | 64 | 14 | 21 | 99 |
|
||||
| [Projektarbeit-Rover/src/driveModi/driveManager.h](/Projektarbeit-Rover/src/driveModi/driveManager.h) | C++ | 43 | 69 | 17 | 129 |
|
||||
| [Projektarbeit-Rover/src/driveModi/driveModi.h](/Projektarbeit-Rover/src/driveModi/driveModi.h) | C++ | 9 | 22 | 5 | 36 |
|
||||
| [Projektarbeit-Rover/src/main.cpp](/Projektarbeit-Rover/src/main.cpp) | C++ | 234 | 22 | 47 | 303 |
|
||||
| [Projektarbeit-Rover/src/moveControl.cpp](/Projektarbeit-Rover/src/moveControl.cpp) | C++ | 162 | 27 | 39 | 228 |
|
||||
| [Projektarbeit-Rover/src/network.cpp](/Projektarbeit-Rover/src/network.cpp) | C++ | 113 | 17 | 26 | 156 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
@@ -0,0 +1,179 @@
|
||||
"filename", "language", "Ini", "C++", "Python", "Markdown", "JSON", "umlet", "comment", "blank", "total"
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\details.md", "Markdown", 0, 0, 0, -60, 0, 0, 0, -6, -66
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\diff-details.md", "Markdown", 0, 0, 0, -9, 0, 0, 0, -6, -15
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\diff.md", "Markdown", 0, 0, 0, -12, 0, 0, 0, -7, -19
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\results.json", "JSON", 0, 0, 0, 0, -1, 0, 0, 0, -1
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\results.md", "Markdown", 0, 0, 0, -39, 0, 0, 0, -7, -46
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\details.md", "Markdown", 0, 0, 0, -71, 0, 0, 0, -6, -77
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\diff-details.md", "Markdown", 0, 0, 0, -52, 0, 0, 0, -6, -58
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\diff.md", "Markdown", 0, 0, 0, -31, 0, 0, 0, -7, -38
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\results.json", "JSON", 0, 0, 0, 0, -1, 0, 0, 0, -1
|
||||
"c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\results.md", "Markdown", 0, 0, 0, -44, 0, 0, 0, -7, -51
|
||||
"c:\Users\alex1\git\projektarbeit\debugMqtt\hw1\main.py", "Python", 0, 0, -14, 0, 0, 0, -2, -10, -26
|
||||
"c:\Users\alex1\git\projektarbeit\debugMqtt\hw1\main_debug.py", "Python", 0, 0, -12, 0, 0, 0, -2, -10, -24
|
||||
"c:\Users\alex1\git\projektarbeit\debugMqtt\rhede\main.py", "Python", 0, 0, -16, 0, 0, 0, -2, -10, -28
|
||||
"c:\Users\alex1\git\projektarbeit\debugMqtt\rhede\main_debug.py", "Python", 0, 0, -13, 0, 0, 0, -2, -10, -25
|
||||
"c:\Users\alex1\git\projektarbeit\doc\Diagrams\classdiagramm.uxf", "umlet", 0, 0, 0, 0, 0, -142, 0, -15, -157
|
||||
"c:\Users\alex1\git\projektarbeit\doc\Diagrams\statesAutopilot.uxf", "umlet", 0, 0, 0, 0, 0, -389, 0, -2, -391
|
||||
"c:\Users\alex1\git\projektarbeit\include\config.h", "C++", 0, -5, 0, 0, 0, 0, -15, -2, -22
|
||||
"c:\Users\alex1\git\projektarbeit\include\moveControl.h", "C++", 0, -54, 0, 0, 0, 0, -102, -23, -179
|
||||
"c:\Users\alex1\git\projektarbeit\include\moveControlConfig.h", "C++", 0, -23, 0, 0, 0, 0, -18, -4, -45
|
||||
"c:\Users\alex1\git\projektarbeit\include\network.h", "C++", 0, -25, 0, 0, 0, 0, -56, -14, -95
|
||||
"c:\Users\alex1\git\projektarbeit\include\networkConfig.h", "C++", 0, -97, 0, 0, 0, 0, -37, -17, -151
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Battery\battery.cpp", "C++", 0, -45, 0, 0, 0, 0, -11, -10, -66
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Battery\battery.h", "C++", 0, -33, 0, 0, 0, 0, -52, -13, -98
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Illumination\underfloorLighting.cpp", "C++", 0, 0, 0, 0, 0, 0, 0, -1, -1
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Illumination\underfloorLighting.h", "C++", 0, 0, 0, 0, 0, 0, 0, -1, -1
|
||||
"c:\Users\alex1\git\projektarbeit\lib\MQTT\debugMqtt.cpp", "C++", 0, -81, 0, 0, 0, 0, -12, -17, -110
|
||||
"c:\Users\alex1\git\projektarbeit\lib\MQTT\debugMqtt.h", "C++", 0, -41, 0, 0, 0, 0, -120, -18, -179
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Menu\menu.cpp", "C++", 0, -106, 0, 0, 0, 0, -11, -19, -136
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Menu\menu.h", "C++", 0, -26, 0, 0, 0, 0, -18, -12, -56
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Menu\menuAction.cpp", "C++", 0, -36, 0, 0, 0, 0, -10, -9, -55
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Menu\menuAction.h", "C++", 0, -21, 0, 0, 0, 0, -53, -15, -89
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Menu\menuControl.h", "C++", 0, -22, 0, 0, 0, 0, -44, -10, -76
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Menu\menuIntInput.cpp", "C++", 0, -170, 0, 0, 0, 0, -14, -41, -225
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Menu\menuIntInput.h", "C++", 0, -46, 0, 0, 0, 0, -34, -20, -100
|
||||
"c:\Users\alex1\git\projektarbeit\lib\MotorControl\motorControl.cpp", "C++", 0, -144, 0, 0, 0, 0, -24, -35, -203
|
||||
"c:\Users\alex1\git\projektarbeit\lib\MotorControl\motorControl.h", "C++", 0, -47, 0, 0, 0, 0, -102, -22, -171
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Navigation\navigation.cpp", "C++", 0, -178, 0, 0, 0, 0, -28, -40, -246
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Navigation\navigation.h", "C++", 0, -53, 0, 0, 0, 0, -119, -29, -201
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Navigation\route.cpp", "C++", 0, -28, 0, 0, 0, 0, -10, -8, -46
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Navigation\route.h", "C++", 0, -34, 0, 0, 0, 0, -74, -20, -128
|
||||
"c:\Users\alex1\git\projektarbeit\lib\NtripClient\ntripClient.cpp", "C++", 0, -186, 0, 0, 0, 0, -22, -42, -250
|
||||
"c:\Users\alex1\git\projektarbeit\lib\NtripClient\ntripClient.h", "C++", 0, -50, 0, 0, 0, 0, 0, -16, -66
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Speedometer\speedometer.cpp", "C++", 0, -81, 0, 0, 0, 0, -12, -21, -114
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Speedometer\speedometer.h", "C++", 0, -35, 0, 0, 0, 0, -68, -22, -125
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Times\debugTimes.cpp", "C++", 0, -28, 0, 0, 0, 0, -10, -9, -47
|
||||
"c:\Users\alex1\git\projektarbeit\lib\Times\debugTimes.h", "C++", 0, -19, 0, 0, 0, 0, -40, -13, -72
|
||||
"c:\Users\alex1\git\projektarbeit\platformio.ini", "Ini", -19, 0, 0, 0, 0, 0, -9, -3, -31
|
||||
"c:\Users\alex1\git\projektarbeit\src\OutputBuf\outputBuf.cpp", "C++", 0, -36, 0, 0, 0, 0, -11, -13, -60
|
||||
"c:\Users\alex1\git\projektarbeit\src\OutputBuf\outputBuf.h", "C++", 0, -24, 0, 0, 0, 0, -32, -12, -68
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\Akku\menuAkku.cpp", "C++", 0, -48, 0, 0, 0, 0, -10, -12, -70
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\Akku\menuAkku.h", "C++", 0, -22, 0, 0, 0, 0, -31, -12, -65
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\GPS\menuGPS.cpp", "C++", 0, -159, 0, 0, 0, 0, -10, -23, -192
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\GPS\menuGPS.h", "C++", 0, -28, 0, 0, 0, 0, -47, -18, -93
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\PID\menuPidSettings.cpp", "C++", 0, -65, 0, 0, 0, 0, -10, -19, -94
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\PID\menuPidSettings.h", "C++", 0, -23, 0, 0, 0, 0, -43, -16, -82
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.cpp", "C++", 0, -69, 0, 0, 0, 0, -11, -14, -94
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.h", "C++", 0, -16, 0, 0, 0, 0, -31, -10, -57
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.cpp", "C++", 0, -25, 0, 0, 0, 0, -10, -6, -41
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.h", "C++", 0, -14, 0, 0, 0, 0, -31, -8, -53
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.cpp", "C++", 0, -12, 0, 0, 0, 0, -10, -3, -25
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.h", "C++", 0, -9, 0, 0, 0, 0, -27, -6, -42
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\TestMode\menuTestMode.cpp", "C++", 0, -115, 0, 0, 0, 0, -23, -29, -167
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\TestMode\menuTestMode.h", "C++", 0, -37, 0, 0, 0, 0, -10, -11, -58
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\menuDriveMode.cpp", "C++", 0, -13, 0, 0, 0, 0, -10, -5, -28
|
||||
"c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\menuDriveMode.h", "C++", 0, -20, 0, 0, 0, 0, -22, -8, -50
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot\autopilot.cpp", "C++", 0, -73, 0, 0, 0, 0, -11, -20, -104
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot\autopilot.h", "C++", 0, -34, 0, 0, 0, 0, -82, -19, -135
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot\autopilotConfig.h", "C++", 0, -9, 0, 0, 0, 0, -36, -10, -55
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\CaptureRoute\captureRoute.cpp", "C++", 0, -29, 0, 0, 0, 0, -10, -7, -46
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\CaptureRoute\captureRoute.h", "C++", 0, -21, 0, 0, 0, 0, -51, -13, -85
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ConsolControl\consolControl.cpp", "C++", 0, -1, 0, 0, 0, 0, -10, -3, -14
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ConsolControl\consolControl.h", "C++", 0, -6, 0, 0, 0, 0, -10, -5, -21
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ManualControl\manualControl.cpp", "C++", 0, -25, 0, 0, 0, 0, -10, -7, -42
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ManualControl\manualControl.h", "C++", 0, -22, 0, 0, 0, 0, -49, -12, -83
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Racing\racing.cpp", "C++", 0, 0, 0, 0, 0, 0, 0, -1, -1
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Racing\racing.h", "C++", 0, 0, 0, 0, 0, 0, 0, -1, -1
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\TestMode\testMode.cpp", "C++", 0, -99, 0, 0, 0, 0, -14, -28, -141
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\TestMode\testMode.h", "C++", 0, -26, 0, 0, 0, 0, -10, -14, -50
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\driveManager.cpp", "C++", 0, -63, 0, 0, 0, 0, -13, -21, -97
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\driveManager.h", "C++", 0, -41, 0, 0, 0, 0, -69, -17, -127
|
||||
"c:\Users\alex1\git\projektarbeit\src\driveModi\driveModi.h", "C++", 0, -10, 0, 0, 0, 0, -22, -6, -38
|
||||
"c:\Users\alex1\git\projektarbeit\src\main.cpp", "C++", 0, -227, 0, 0, 0, 0, -38, -43, -308
|
||||
"c:\Users\alex1\git\projektarbeit\src\moveControl.cpp", "C++", 0, -133, 0, 0, 0, 0, -35, -34, -202
|
||||
"c:\Users\alex1\git\projektarbeit\src\network.cpp", "C++", 0, -86, 0, 0, 0, 0, -16, -17, -119
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\details.md", "Markdown", 0, 0, 0, 60, 0, 0, 0, 6, 66
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\diff-details.md", "Markdown", 0, 0, 0, 9, 0, 0, 0, 6, 15
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\diff.md", "Markdown", 0, 0, 0, 12, 0, 0, 0, 7, 19
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\results.json", "JSON", 0, 0, 0, 0, 1, 0, 0, 0, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\results.md", "Markdown", 0, 0, 0, 39, 0, 0, 0, 7, 46
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\details.md", "Markdown", 0, 0, 0, 71, 0, 0, 0, 6, 77
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\diff-details.md", "Markdown", 0, 0, 0, 52, 0, 0, 0, 6, 58
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\diff.md", "Markdown", 0, 0, 0, 31, 0, 0, 0, 7, 38
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\results.json", "JSON", 0, 0, 0, 0, 1, 0, 0, 0, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\results.md", "Markdown", 0, 0, 0, 44, 0, 0, 0, 7, 51
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\details.md", "Markdown", 0, 0, 0, 93, 0, 0, 0, 6, 99
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\diff-details.md", "Markdown", 0, 0, 0, 91, 0, 0, 0, 6, 97
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\diff.md", "Markdown", 0, 0, 0, 54, 0, 0, 0, 7, 61
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\results.json", "JSON", 0, 0, 0, 0, 1, 0, 0, 0, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\results.md", "Markdown", 0, 0, 0, 57, 0, 0, 0, 7, 64
|
||||
"d:\Embedded\Projektarbeit-Rover\debugMqtt\hw1\main.py", "Python", 0, 0, 14, 0, 0, 0, 2, 10, 26
|
||||
"d:\Embedded\Projektarbeit-Rover\debugMqtt\hw1\main_debug.py", "Python", 0, 0, 12, 0, 0, 0, 2, 10, 24
|
||||
"d:\Embedded\Projektarbeit-Rover\debugMqtt\rhede\main.py", "Python", 0, 0, 16, 0, 0, 0, 2, 10, 28
|
||||
"d:\Embedded\Projektarbeit-Rover\debugMqtt\rhede\main_debug.py", "Python", 0, 0, 13, 0, 0, 0, 2, 10, 25
|
||||
"d:\Embedded\Projektarbeit-Rover\include\config.h", "C++", 0, 8, 0, 0, 0, 0, 26, 5, 39
|
||||
"d:\Embedded\Projektarbeit-Rover\include\moveControl.h", "C++", 0, 58, 0, 0, 0, 0, 130, 28, 216
|
||||
"d:\Embedded\Projektarbeit-Rover\include\moveControlConfig.h", "C++", 0, 21, 0, 0, 0, 0, 18, 4, 43
|
||||
"d:\Embedded\Projektarbeit-Rover\include\network.h", "C++", 0, 33, 0, 0, 0, 0, 56, 16, 105
|
||||
"d:\Embedded\Projektarbeit-Rover\include\networkConfig.h", "C++", 0, 98, 0, 0, 0, 0, 37, 17, 152
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Battery\battery.cpp", "C++", 0, 107, 0, 0, 0, 0, 13, 22, 142
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Battery\battery.h", "C++", 0, 55, 0, 0, 0, 0, 65, 16, 136
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPad.cpp", "C++", 0, 56, 0, 0, 0, 0, 10, 15, 81
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPad.h", "C++", 0, 25, 0, 0, 0, 0, 10, 16, 51
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPadInput.h", "C++", 0, 50, 0, 0, 0, 0, 10, 15, 75
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Counter\counter.cpp", "C++", 0, 45, 0, 0, 0, 0, 0, 12, 57
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Counter\counter.h", "C++", 0, 21, 0, 0, 0, 0, 0, 10, 31
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Illumination\underfloorLighting.cpp", "C++", 0, 0, 0, 0, 0, 0, 0, 1, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Illumination\underfloorLighting.h", "C++", 0, 0, 0, 0, 0, 0, 0, 1, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\LcdWrapper\LcdWrapper.cpp", "C++", 0, 45, 0, 0, 0, 0, 10, 12, 67
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\LcdWrapper\LcdWrapper.h", "C++", 0, 25, 0, 0, 0, 0, 41, 15, 81
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\MQTT\debugMqtt.cpp", "C++", 0, 81, 0, 0, 0, 0, 12, 17, 110
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\MQTT\debugMqtt.h", "C++", 0, 41, 0, 0, 0, 0, 120, 18, 179
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\MotorControl\motorControl.cpp", "C++", 0, 142, 0, 0, 0, 0, 24, 35, 201
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\MotorControl\motorControl.h", "C++", 0, 48, 0, 0, 0, 0, 102, 22, 172
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Navigation\navigation.cpp", "C++", 0, 192, 0, 0, 0, 0, 29, 47, 268
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Navigation\navigation.h", "C++", 0, 68, 0, 0, 0, 0, 141, 36, 245
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Navigation\route.cpp", "C++", 0, 125, 0, 0, 0, 0, 22, 34, 181
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Navigation\route.h", "C++", 0, 71, 0, 0, 0, 0, 135, 35, 241
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\NtripClient\ntripClient.cpp", "C++", 0, 198, 0, 0, 0, 0, 23, 46, 267
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\NtripClient\ntripClient.h", "C++", 0, 51, 0, 0, 0, 0, 63, 18, 132
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Speedometer\speedometer.cpp", "C++", 0, 109, 0, 0, 0, 0, 18, 32, 159
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Speedometer\speedometer.h", "C++", 0, 51, 0, 0, 0, 0, 100, 28, 179
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Times\debugTimes.cpp", "C++", 0, 28, 0, 0, 0, 0, 10, 9, 47
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Times\debugTimes.h", "C++", 0, 19, 0, 0, 0, 0, 45, 13, 77
|
||||
"d:\Embedded\Projektarbeit-Rover\platformio.ini", "Ini", 26, 0, 0, 0, 0, 0, 9, 5, 40
|
||||
"d:\Embedded\Projektarbeit-Rover\src\OutputBuf\outputBuf.cpp", "C++", 0, 36, 0, 0, 0, 0, 11, 13, 60
|
||||
"d:\Embedded\Projektarbeit-Rover\src\OutputBuf\outputBuf.h", "C++", 0, 24, 0, 0, 0, 0, 48, 14, 86
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\GPS\menuGPS.cpp", "C++", 0, 130, 0, 0, 0, 0, 11, 19, 160
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\GPS\menuGPS.h", "C++", 0, 17, 0, 0, 0, 0, 19, 8, 44
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\PID\menuPidSettings.cpp", "C++", 0, 9, 0, 0, 0, 0, 10, 4, 23
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\PID\menuPidSettings.h", "C++", 0, 13, 0, 0, 0, 0, 19, 8, 40
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoute.cpp", "C++", 0, 197, 0, 0, 0, 0, 13, 55, 265
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoute.h", "C++", 0, 52, 0, 0, 0, 0, 83, 22, 157
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoutePoints.cpp", "C++", 0, 54, 0, 0, 0, 0, 12, 11, 77
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoutePoints.h", "C++", 0, 15, 0, 0, 0, 0, 27, 9, 51
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Systeminformation\menuSysteminformatio.cpp", "C++", 0, 34, 0, 0, 0, 0, 15, 11, 60
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Systeminformation\menuSysteminformation.h", "C++", 0, 14, 0, 0, 0, 0, 21, 8, 43
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.cpp", "C++", 0, 122, 0, 0, 0, 0, 10, 24, 156
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.h", "C++", 0, 14, 0, 0, 0, 0, 31, 9, 54
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.cpp", "C++", 0, 47, 0, 0, 0, 0, 10, 13, 70
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.h", "C++", 0, 13, 0, 0, 0, 0, 31, 8, 52
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.cpp", "C++", 0, 58, 0, 0, 0, 0, 10, 16, 84
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.h", "C++", 0, 14, 0, 0, 0, 0, 27, 8, 49
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\menuTestMode.cpp", "C++", 0, 183, 0, 0, 0, 0, 20, 40, 243
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\menuTestMode.h", "C++", 0, 48, 0, 0, 0, 0, 36, 16, 100
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\speedometerTest.cpp", "C++", 0, 54, 0, 0, 0, 0, 10, 16, 80
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\speedometerTest.h", "C++", 0, 20, 0, 0, 0, 0, 34, 11, 65
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\menuDriveMode.cpp", "C++", 0, 16, 0, 0, 0, 0, 10, 5, 31
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\menuDriveMode.h", "C++", 0, 15, 0, 0, 0, 0, 25, 8, 48
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilot.cpp", "C++", 0, 99, 0, 0, 0, 0, 11, 25, 135
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilot.h", "C++", 0, 46, 0, 0, 0, 0, 68, 18, 132
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilotConfig.h", "C++", 0, 9, 0, 0, 0, 0, 36, 10, 55
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\CaptureRoute\captureRoute.cpp", "C++", 0, 63, 0, 0, 0, 0, 10, 14, 87
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\CaptureRoute\captureRoute.h", "C++", 0, 34, 0, 0, 0, 0, 62, 17, 113
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ConsolControl\consolControl.cpp", "C++", 0, 1, 0, 0, 0, 0, 10, 3, 14
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ConsolControl\consolControl.h", "C++", 0, 6, 0, 0, 0, 0, 10, 5, 21
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ManualControl\manualControl.cpp", "C++", 0, 26, 0, 0, 0, 0, 15, 8, 49
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ManualControl\manualControl.h", "C++", 0, 30, 0, 0, 0, 0, 49, 12, 91
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Racing\racing.cpp", "C++", 0, 0, 0, 0, 0, 0, 0, 1, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Racing\racing.h", "C++", 0, 0, 0, 0, 0, 0, 0, 1, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\TestMode\testMode.cpp", "C++", 0, 115, 0, 0, 0, 0, 14, 27, 156
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\TestMode\testMode.h", "C++", 0, 50, 0, 0, 0, 0, 79, 24, 153
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\driveManager.cpp", "C++", 0, 64, 0, 0, 0, 0, 14, 21, 99
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\driveManager.h", "C++", 0, 43, 0, 0, 0, 0, 69, 17, 129
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\driveModi.h", "C++", 0, 9, 0, 0, 0, 0, 22, 5, 36
|
||||
"d:\Embedded\Projektarbeit-Rover\src\main.cpp", "C++", 0, 234, 0, 0, 0, 0, 22, 47, 303
|
||||
"d:\Embedded\Projektarbeit-Rover\src\moveControl.cpp", "C++", 0, 162, 0, 0, 0, 0, 27, 39, 228
|
||||
"d:\Embedded\Projektarbeit-Rover\src\network.cpp", "C++", 0, 113, 0, 0, 0, 0, 17, 26, 156
|
||||
"Total", "-", 7, 820, 0, 295, 1, -531, 367, 256, 1215
|
||||
|
@@ -0,0 +1,117 @@
|
||||
# Diff Summary
|
||||
|
||||
Date : 2023-05-11 22:19:18
|
||||
|
||||
Directory d:\\Embedded\\Projektarbeit-Rover
|
||||
|
||||
Total : 177 files, 592 codes, 367 comments, 256 blanks, all 1215 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C++ | 140 | 820 | 367 | 245 | 1,432 |
|
||||
| Markdown | 20 | 295 | 0 | 26 | 321 |
|
||||
| Ini | 2 | 7 | 0 | 2 | 9 |
|
||||
| JSON | 5 | 1 | 0 | 0 | 1 |
|
||||
| Python | 8 | 0 | 0 | 0 | 0 |
|
||||
| umlet | 2 | -531 | 0 | -17 | -548 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 93 | 4,871 | 2,365 | 1,394 | 8,630 |
|
||||
| . (Files) | 1 | 26 | 9 | 5 | 40 |
|
||||
| .VSCodeCounter | 15 | 616 | 0 | 78 | 694 |
|
||||
| .VSCodeCounter\\2022-01-19_11-26-30 | 5 | 121 | 0 | 26 | 147 |
|
||||
| .VSCodeCounter\\2022-02-01_10-50-06 | 5 | 199 | 0 | 26 | 225 |
|
||||
| .VSCodeCounter\\2022-12-09_11-39-58 | 5 | 296 | 0 | 26 | 322 |
|
||||
| c:\\ | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\\Users | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\\Users\\alex1 | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\\Users\\alex1\\git | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit (Files) | 1 | -19 | -9 | -3 | -31 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\.VSCodeCounter | 10 | -320 | 0 | -52 | -372 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\.VSCodeCounter\\2022-01-19_11-26-30 | 5 | -121 | 0 | -26 | -147 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\.VSCodeCounter\\2022-02-01_10-50-06 | 5 | -199 | 0 | -26 | -225 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\debugMqtt | 4 | -55 | -8 | -40 | -103 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\debugMqtt\\hw1 | 2 | -26 | -4 | -20 | -50 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\debugMqtt\\rhede | 2 | -29 | -4 | -20 | -53 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\doc | 2 | -531 | 0 | -17 | -548 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\doc\\Diagrams | 2 | -531 | 0 | -17 | -548 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\include | 5 | -204 | -228 | -60 | -492 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib | 25 | -1,510 | -888 | -463 | -2,861 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib\\Battery | 2 | -78 | -63 | -23 | -164 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib\\Illumination | 2 | 0 | 0 | -2 | -2 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib\\MQTT | 2 | -122 | -132 | -35 | -289 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib\\Menu | 7 | -427 | -184 | -126 | -737 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib\\MotorControl | 2 | -191 | -126 | -57 | -374 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib\\Navigation | 4 | -293 | -231 | -97 | -621 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib\\NtripClient | 2 | -236 | -22 | -58 | -316 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib\\Speedometer | 2 | -116 | -80 | -43 | -239 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\lib\\Times | 2 | -47 | -50 | -22 | -119 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src | 37 | -1,640 | -865 | -503 | -3,008 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src (Files) | 3 | -446 | -89 | -94 | -629 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\OutputBuf | 2 | -60 | -43 | -25 | -128 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus | 16 | -675 | -336 | -200 | -1,211 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus\\Akku | 2 | -70 | -41 | -24 | -135 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus\\GPS | 2 | -187 | -57 | -41 | -285 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus\\PID | 2 | -88 | -53 | -35 | -176 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus\\driveModi | 10 | -330 | -185 | -100 | -615 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus\\driveModi (Files) | 2 | -33 | -32 | -13 | -78 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus\\driveModi\\Autopilot | 2 | -85 | -42 | -24 | -151 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus\\driveModi\\CaptureRoute | 2 | -39 | -41 | -14 | -94 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus\\driveModi\\ManualDrive | 2 | -21 | -37 | -9 | -67 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\SpecialMenus\\driveModi\\TestMode | 2 | -152 | -33 | -40 | -225 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\driveModi | 16 | -459 | -397 | -184 | -1,040 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\driveModi (Files) | 3 | -114 | -104 | -44 | -262 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\driveModi\\Modi | 13 | -345 | -293 | -140 | -778 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\driveModi\\Modi\\Autopilot | 3 | -116 | -129 | -49 | -294 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\driveModi\\Modi\\CaptureRoute | 2 | -50 | -61 | -20 | -131 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\driveModi\\Modi\\ConsolControl | 2 | -7 | -20 | -8 | -35 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\driveModi\\Modi\\ManualControl | 2 | -47 | -59 | -19 | -125 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\driveModi\\Modi\\Racing | 2 | 0 | 0 | -2 | -2 |
|
||||
| c:\\Users\\alex1\\git\\projektarbeit\\src\\driveModi\\Modi\\TestMode | 2 | -125 | -24 | -42 | -191 |
|
||||
| debugMqtt | 4 | 55 | 8 | 40 | 103 |
|
||||
| debugMqtt\\hw1 | 2 | 26 | 4 | 20 | 50 |
|
||||
| debugMqtt\\rhede | 2 | 29 | 4 | 20 | 53 |
|
||||
| include | 5 | 218 | 267 | 70 | 555 |
|
||||
| lib | 25 | 1,653 | 1,003 | 525 | 3,181 |
|
||||
| lib\\Battery | 2 | 162 | 78 | 38 | 278 |
|
||||
| lib\\ControllPad | 3 | 131 | 30 | 46 | 207 |
|
||||
| lib\\Counter | 2 | 66 | 0 | 22 | 88 |
|
||||
| lib\\Illumination | 2 | 0 | 0 | 2 | 2 |
|
||||
| lib\\LcdWrapper | 2 | 70 | 51 | 27 | 148 |
|
||||
| lib\\MQTT | 2 | 122 | 132 | 35 | 289 |
|
||||
| lib\\MotorControl | 2 | 190 | 126 | 57 | 373 |
|
||||
| lib\\Navigation | 4 | 456 | 327 | 152 | 935 |
|
||||
| lib\\NtripClient | 2 | 249 | 86 | 64 | 399 |
|
||||
| lib\\Speedometer | 2 | 160 | 118 | 60 | 338 |
|
||||
| lib\\Times | 2 | 47 | 55 | 22 | 124 |
|
||||
| src | 43 | 2,303 | 1,078 | 676 | 4,057 |
|
||||
| src (Files) | 3 | 509 | 66 | 112 | 687 |
|
||||
| src\\OutputBuf | 2 | 60 | 59 | 27 | 146 |
|
||||
| src\\SpecialMenus | 22 | 1,139 | 484 | 329 | 1,952 |
|
||||
| src\\SpecialMenus\\GPS | 2 | 147 | 30 | 27 | 204 |
|
||||
| src\\SpecialMenus\\PID | 2 | 22 | 29 | 12 | 63 |
|
||||
| src\\SpecialMenus\\Route | 4 | 318 | 135 | 97 | 550 |
|
||||
| src\\SpecialMenus\\Systeminformation | 2 | 48 | 36 | 19 | 103 |
|
||||
| src\\SpecialMenus\\driveModi | 12 | 604 | 254 | 174 | 1,032 |
|
||||
| src\\SpecialMenus\\driveModi (Files) | 2 | 31 | 35 | 13 | 79 |
|
||||
| src\\SpecialMenus\\driveModi\\Autopilot | 2 | 136 | 41 | 33 | 210 |
|
||||
| src\\SpecialMenus\\driveModi\\CaptureRoute | 2 | 60 | 41 | 21 | 122 |
|
||||
| src\\SpecialMenus\\driveModi\\ManualDrive | 2 | 72 | 37 | 24 | 133 |
|
||||
| src\\SpecialMenus\\driveModi\\TestMode | 4 | 305 | 100 | 83 | 488 |
|
||||
| src\\driveModi | 16 | 595 | 469 | 208 | 1,272 |
|
||||
| src\\driveModi (Files) | 3 | 116 | 105 | 43 | 264 |
|
||||
| src\\driveModi\\Modi | 13 | 479 | 364 | 165 | 1,008 |
|
||||
| src\\driveModi\\Modi\\Autopilot | 3 | 154 | 115 | 53 | 322 |
|
||||
| src\\driveModi\\Modi\\CaptureRoute | 2 | 97 | 72 | 31 | 200 |
|
||||
| src\\driveModi\\Modi\\ConsolControl | 2 | 7 | 20 | 8 | 35 |
|
||||
| src\\driveModi\\Modi\\ManualControl | 2 | 56 | 64 | 20 | 140 |
|
||||
| src\\driveModi\\Modi\\Racing | 2 | 0 | 0 | 2 | 2 |
|
||||
| src\\driveModi\\Modi\\TestMode | 2 | 165 | 93 | 51 | 309 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
@@ -0,0 +1,297 @@
|
||||
Date : 2023-05-11 22:19:18
|
||||
Directory : d:\Embedded\Projektarbeit-Rover
|
||||
Total : 177 files, 592 codes, 367 comments, 256 blanks, all 1215 lines
|
||||
|
||||
Languages
|
||||
+----------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+----------+------------+------------+------------+------------+------------+
|
||||
| C++ | 140 | 820 | 367 | 245 | 1,432 |
|
||||
| Markdown | 20 | 295 | 0 | 26 | 321 |
|
||||
| Ini | 2 | 7 | 0 | 2 | 9 |
|
||||
| JSON | 5 | 1 | 0 | 0 | 1 |
|
||||
| Python | 8 | 0 | 0 | 0 | 0 |
|
||||
| umlet | 2 | -531 | 0 | -17 | -548 |
|
||||
+----------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+-----------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+-----------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 93 | 4,871 | 2,365 | 1,394 | 8,630 |
|
||||
| . (Files) | 1 | 26 | 9 | 5 | 40 |
|
||||
| .VSCodeCounter | 15 | 616 | 0 | 78 | 694 |
|
||||
| .VSCodeCounter\2022-01-19_11-26-30 | 5 | 121 | 0 | 26 | 147 |
|
||||
| .VSCodeCounter\2022-02-01_10-50-06 | 5 | 199 | 0 | 26 | 225 |
|
||||
| .VSCodeCounter\2022-12-09_11-39-58 | 5 | 296 | 0 | 26 | 322 |
|
||||
| c:\ | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\Users | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\Users\alex1 | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\Users\alex1\git | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\Users\alex1\git\projektarbeit | 84 | -4,279 | -1,998 | -1,138 | -7,415 |
|
||||
| c:\Users\alex1\git\projektarbeit (Files) | 1 | -19 | -9 | -3 | -31 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter | 10 | -320 | 0 | -52 | -372 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30 | 5 | -121 | 0 | -26 | -147 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06 | 5 | -199 | 0 | -26 | -225 |
|
||||
| c:\Users\alex1\git\projektarbeit\debugMqtt | 4 | -55 | -8 | -40 | -103 |
|
||||
| c:\Users\alex1\git\projektarbeit\debugMqtt\hw1 | 2 | -26 | -4 | -20 | -50 |
|
||||
| c:\Users\alex1\git\projektarbeit\debugMqtt\rhede | 2 | -29 | -4 | -20 | -53 |
|
||||
| c:\Users\alex1\git\projektarbeit\doc | 2 | -531 | 0 | -17 | -548 |
|
||||
| c:\Users\alex1\git\projektarbeit\doc\Diagrams | 2 | -531 | 0 | -17 | -548 |
|
||||
| c:\Users\alex1\git\projektarbeit\include | 5 | -204 | -228 | -60 | -492 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib | 25 | -1,510 | -888 | -463 | -2,861 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Battery | 2 | -78 | -63 | -23 | -164 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Illumination | 2 | 0 | 0 | -2 | -2 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\MQTT | 2 | -122 | -132 | -35 | -289 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Menu | 7 | -427 | -184 | -126 | -737 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\MotorControl | 2 | -191 | -126 | -57 | -374 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Navigation | 4 | -293 | -231 | -97 | -621 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\NtripClient | 2 | -236 | -22 | -58 | -316 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Speedometer | 2 | -116 | -80 | -43 | -239 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Times | 2 | -47 | -50 | -22 | -119 |
|
||||
| c:\Users\alex1\git\projektarbeit\src | 37 | -1,640 | -865 | -503 | -3,008 |
|
||||
| c:\Users\alex1\git\projektarbeit\src (Files) | 3 | -446 | -89 | -94 | -629 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\OutputBuf | 2 | -60 | -43 | -25 | -128 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus | 16 | -675 | -336 | -200 | -1,211 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\Akku | 2 | -70 | -41 | -24 | -135 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\GPS | 2 | -187 | -57 | -41 | -285 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\PID | 2 | -88 | -53 | -35 | -176 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi | 10 | -330 | -185 | -100 | -615 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi (Files) | 2 | -33 | -32 | -13 | -78 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\Autopilot | 2 | -85 | -42 | -24 | -151 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\CaptureRoute | 2 | -39 | -41 | -14 | -94 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\ManualDrive | 2 | -21 | -37 | -9 | -67 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\TestMode | 2 | -152 | -33 | -40 | -225 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi | 16 | -459 | -397 | -184 | -1,040 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi (Files) | 3 | -114 | -104 | -44 | -262 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi | 13 | -345 | -293 | -140 | -778 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot | 3 | -116 | -129 | -49 | -294 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\CaptureRoute | 2 | -50 | -61 | -20 | -131 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ConsolControl | 2 | -7 | -20 | -8 | -35 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ManualControl | 2 | -47 | -59 | -19 | -125 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Racing | 2 | 0 | 0 | -2 | -2 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\TestMode | 2 | -125 | -24 | -42 | -191 |
|
||||
| debugMqtt | 4 | 55 | 8 | 40 | 103 |
|
||||
| debugMqtt\hw1 | 2 | 26 | 4 | 20 | 50 |
|
||||
| debugMqtt\rhede | 2 | 29 | 4 | 20 | 53 |
|
||||
| include | 5 | 218 | 267 | 70 | 555 |
|
||||
| lib | 25 | 1,653 | 1,003 | 525 | 3,181 |
|
||||
| lib\Battery | 2 | 162 | 78 | 38 | 278 |
|
||||
| lib\ControllPad | 3 | 131 | 30 | 46 | 207 |
|
||||
| lib\Counter | 2 | 66 | 0 | 22 | 88 |
|
||||
| lib\Illumination | 2 | 0 | 0 | 2 | 2 |
|
||||
| lib\LcdWrapper | 2 | 70 | 51 | 27 | 148 |
|
||||
| lib\MQTT | 2 | 122 | 132 | 35 | 289 |
|
||||
| lib\MotorControl | 2 | 190 | 126 | 57 | 373 |
|
||||
| lib\Navigation | 4 | 456 | 327 | 152 | 935 |
|
||||
| lib\NtripClient | 2 | 249 | 86 | 64 | 399 |
|
||||
| lib\Speedometer | 2 | 160 | 118 | 60 | 338 |
|
||||
| lib\Times | 2 | 47 | 55 | 22 | 124 |
|
||||
| src | 43 | 2,303 | 1,078 | 676 | 4,057 |
|
||||
| src (Files) | 3 | 509 | 66 | 112 | 687 |
|
||||
| src\OutputBuf | 2 | 60 | 59 | 27 | 146 |
|
||||
| src\SpecialMenus | 22 | 1,139 | 484 | 329 | 1,952 |
|
||||
| src\SpecialMenus\GPS | 2 | 147 | 30 | 27 | 204 |
|
||||
| src\SpecialMenus\PID | 2 | 22 | 29 | 12 | 63 |
|
||||
| src\SpecialMenus\Route | 4 | 318 | 135 | 97 | 550 |
|
||||
| src\SpecialMenus\Systeminformation | 2 | 48 | 36 | 19 | 103 |
|
||||
| src\SpecialMenus\driveModi | 12 | 604 | 254 | 174 | 1,032 |
|
||||
| src\SpecialMenus\driveModi (Files) | 2 | 31 | 35 | 13 | 79 |
|
||||
| src\SpecialMenus\driveModi\Autopilot | 2 | 136 | 41 | 33 | 210 |
|
||||
| src\SpecialMenus\driveModi\CaptureRoute | 2 | 60 | 41 | 21 | 122 |
|
||||
| src\SpecialMenus\driveModi\ManualDrive | 2 | 72 | 37 | 24 | 133 |
|
||||
| src\SpecialMenus\driveModi\TestMode | 4 | 305 | 100 | 83 | 488 |
|
||||
| src\driveModi | 16 | 595 | 469 | 208 | 1,272 |
|
||||
| src\driveModi (Files) | 3 | 116 | 105 | 43 | 264 |
|
||||
| src\driveModi\Modi | 13 | 479 | 364 | 165 | 1,008 |
|
||||
| src\driveModi\Modi\Autopilot | 3 | 154 | 115 | 53 | 322 |
|
||||
| src\driveModi\Modi\CaptureRoute | 2 | 97 | 72 | 31 | 200 |
|
||||
| src\driveModi\Modi\ConsolControl | 2 | 7 | 20 | 8 | 35 |
|
||||
| src\driveModi\Modi\ManualControl | 2 | 56 | 64 | 20 | 140 |
|
||||
| src\driveModi\Modi\Racing | 2 | 0 | 0 | 2 | 2 |
|
||||
| src\driveModi\Modi\TestMode | 2 | 165 | 93 | 51 | 309 |
|
||||
+-----------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+-----------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+-----------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\details.md | Markdown | -60 | 0 | -6 | -66 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\diff-details.md | Markdown | -9 | 0 | -6 | -15 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\diff.md | Markdown | -12 | 0 | -7 | -19 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\results.json | JSON | -1 | 0 | 0 | -1 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-01-19_11-26-30\results.md | Markdown | -39 | 0 | -7 | -46 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\details.md | Markdown | -71 | 0 | -6 | -77 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\diff-details.md | Markdown | -52 | 0 | -6 | -58 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\diff.md | Markdown | -31 | 0 | -7 | -38 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\results.json | JSON | -1 | 0 | 0 | -1 |
|
||||
| c:\Users\alex1\git\projektarbeit\.VSCodeCounter\2022-02-01_10-50-06\results.md | Markdown | -44 | 0 | -7 | -51 |
|
||||
| c:\Users\alex1\git\projektarbeit\debugMqtt\hw1\main.py | Python | -14 | -2 | -10 | -26 |
|
||||
| c:\Users\alex1\git\projektarbeit\debugMqtt\hw1\main_debug.py | Python | -12 | -2 | -10 | -24 |
|
||||
| c:\Users\alex1\git\projektarbeit\debugMqtt\rhede\main.py | Python | -16 | -2 | -10 | -28 |
|
||||
| c:\Users\alex1\git\projektarbeit\debugMqtt\rhede\main_debug.py | Python | -13 | -2 | -10 | -25 |
|
||||
| c:\Users\alex1\git\projektarbeit\doc\Diagrams\classdiagramm.uxf | umlet | -142 | 0 | -15 | -157 |
|
||||
| c:\Users\alex1\git\projektarbeit\doc\Diagrams\statesAutopilot.uxf | umlet | -389 | 0 | -2 | -391 |
|
||||
| c:\Users\alex1\git\projektarbeit\include\config.h | C++ | -5 | -15 | -2 | -22 |
|
||||
| c:\Users\alex1\git\projektarbeit\include\moveControl.h | C++ | -54 | -102 | -23 | -179 |
|
||||
| c:\Users\alex1\git\projektarbeit\include\moveControlConfig.h | C++ | -23 | -18 | -4 | -45 |
|
||||
| c:\Users\alex1\git\projektarbeit\include\network.h | C++ | -25 | -56 | -14 | -95 |
|
||||
| c:\Users\alex1\git\projektarbeit\include\networkConfig.h | C++ | -97 | -37 | -17 | -151 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Battery\battery.cpp | C++ | -45 | -11 | -10 | -66 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Battery\battery.h | C++ | -33 | -52 | -13 | -98 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Illumination\underfloorLighting.cpp | C++ | 0 | 0 | -1 | -1 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Illumination\underfloorLighting.h | C++ | 0 | 0 | -1 | -1 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\MQTT\debugMqtt.cpp | C++ | -81 | -12 | -17 | -110 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\MQTT\debugMqtt.h | C++ | -41 | -120 | -18 | -179 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Menu\menu.cpp | C++ | -106 | -11 | -19 | -136 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Menu\menu.h | C++ | -26 | -18 | -12 | -56 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Menu\menuAction.cpp | C++ | -36 | -10 | -9 | -55 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Menu\menuAction.h | C++ | -21 | -53 | -15 | -89 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Menu\menuControl.h | C++ | -22 | -44 | -10 | -76 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Menu\menuIntInput.cpp | C++ | -170 | -14 | -41 | -225 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Menu\menuIntInput.h | C++ | -46 | -34 | -20 | -100 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\MotorControl\motorControl.cpp | C++ | -144 | -24 | -35 | -203 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\MotorControl\motorControl.h | C++ | -47 | -102 | -22 | -171 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Navigation\navigation.cpp | C++ | -178 | -28 | -40 | -246 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Navigation\navigation.h | C++ | -53 | -119 | -29 | -201 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Navigation\route.cpp | C++ | -28 | -10 | -8 | -46 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Navigation\route.h | C++ | -34 | -74 | -20 | -128 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\NtripClient\ntripClient.cpp | C++ | -186 | -22 | -42 | -250 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\NtripClient\ntripClient.h | C++ | -50 | 0 | -16 | -66 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Speedometer\speedometer.cpp | C++ | -81 | -12 | -21 | -114 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Speedometer\speedometer.h | C++ | -35 | -68 | -22 | -125 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Times\debugTimes.cpp | C++ | -28 | -10 | -9 | -47 |
|
||||
| c:\Users\alex1\git\projektarbeit\lib\Times\debugTimes.h | C++ | -19 | -40 | -13 | -72 |
|
||||
| c:\Users\alex1\git\projektarbeit\platformio.ini | Ini | -19 | -9 | -3 | -31 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\OutputBuf\outputBuf.cpp | C++ | -36 | -11 | -13 | -60 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\OutputBuf\outputBuf.h | C++ | -24 | -32 | -12 | -68 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\Akku\menuAkku.cpp | C++ | -48 | -10 | -12 | -70 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\Akku\menuAkku.h | C++ | -22 | -31 | -12 | -65 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\GPS\menuGPS.cpp | C++ | -159 | -10 | -23 | -192 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\GPS\menuGPS.h | C++ | -28 | -47 | -18 | -93 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\PID\menuPidSettings.cpp | C++ | -65 | -10 | -19 | -94 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\PID\menuPidSettings.h | C++ | -23 | -43 | -16 | -82 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.cpp | C++ | -69 | -11 | -14 | -94 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.h | C++ | -16 | -31 | -10 | -57 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.cpp | C++ | -25 | -10 | -6 | -41 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.h | C++ | -14 | -31 | -8 | -53 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.cpp | C++ | -12 | -10 | -3 | -25 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.h | C++ | -9 | -27 | -6 | -42 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\TestMode\menuTestMode.cpp | C++ | -115 | -23 | -29 | -167 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\TestMode\menuTestMode.h | C++ | -37 | -10 | -11 | -58 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\menuDriveMode.cpp | C++ | -13 | -10 | -5 | -28 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\SpecialMenus\driveModi\menuDriveMode.h | C++ | -20 | -22 | -8 | -50 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot\autopilot.cpp | C++ | -73 | -11 | -20 | -104 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot\autopilot.h | C++ | -34 | -82 | -19 | -135 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Autopilot\autopilotConfig.h | C++ | -9 | -36 | -10 | -55 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\CaptureRoute\captureRoute.cpp | C++ | -29 | -10 | -7 | -46 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\CaptureRoute\captureRoute.h | C++ | -21 | -51 | -13 | -85 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ConsolControl\consolControl.cpp | C++ | -1 | -10 | -3 | -14 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ConsolControl\consolControl.h | C++ | -6 | -10 | -5 | -21 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ManualControl\manualControl.cpp | C++ | -25 | -10 | -7 | -42 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\ManualControl\manualControl.h | C++ | -22 | -49 | -12 | -83 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Racing\racing.cpp | C++ | 0 | 0 | -1 | -1 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\Racing\racing.h | C++ | 0 | 0 | -1 | -1 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\TestMode\testMode.cpp | C++ | -99 | -14 | -28 | -141 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\Modi\TestMode\testMode.h | C++ | -26 | -10 | -14 | -50 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\driveManager.cpp | C++ | -63 | -13 | -21 | -97 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\driveManager.h | C++ | -41 | -69 | -17 | -127 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\driveModi\driveModi.h | C++ | -10 | -22 | -6 | -38 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\main.cpp | C++ | -227 | -38 | -43 | -308 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\moveControl.cpp | C++ | -133 | -35 | -34 | -202 |
|
||||
| c:\Users\alex1\git\projektarbeit\src\network.cpp | C++ | -86 | -16 | -17 | -119 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\details.md | Markdown | 60 | 0 | 6 | 66 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\diff-details.md | Markdown | 9 | 0 | 6 | 15 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\diff.md | Markdown | 12 | 0 | 7 | 19 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\results.json | JSON | 1 | 0 | 0 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\results.md | Markdown | 39 | 0 | 7 | 46 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\details.md | Markdown | 71 | 0 | 6 | 77 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\diff-details.md | Markdown | 52 | 0 | 6 | 58 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\diff.md | Markdown | 31 | 0 | 7 | 38 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\results.json | JSON | 1 | 0 | 0 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\results.md | Markdown | 44 | 0 | 7 | 51 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\details.md | Markdown | 93 | 0 | 6 | 99 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\diff-details.md | Markdown | 91 | 0 | 6 | 97 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\diff.md | Markdown | 54 | 0 | 7 | 61 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\results.json | JSON | 1 | 0 | 0 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\results.md | Markdown | 57 | 0 | 7 | 64 |
|
||||
| d:\Embedded\Projektarbeit-Rover\debugMqtt\hw1\main.py | Python | 14 | 2 | 10 | 26 |
|
||||
| d:\Embedded\Projektarbeit-Rover\debugMqtt\hw1\main_debug.py | Python | 12 | 2 | 10 | 24 |
|
||||
| d:\Embedded\Projektarbeit-Rover\debugMqtt\rhede\main.py | Python | 16 | 2 | 10 | 28 |
|
||||
| d:\Embedded\Projektarbeit-Rover\debugMqtt\rhede\main_debug.py | Python | 13 | 2 | 10 | 25 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\config.h | C++ | 8 | 26 | 5 | 39 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\moveControl.h | C++ | 58 | 130 | 28 | 216 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\moveControlConfig.h | C++ | 21 | 18 | 4 | 43 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\network.h | C++ | 33 | 56 | 16 | 105 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\networkConfig.h | C++ | 98 | 37 | 17 | 152 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Battery\battery.cpp | C++ | 107 | 13 | 22 | 142 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Battery\battery.h | C++ | 55 | 65 | 16 | 136 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPad.cpp | C++ | 56 | 10 | 15 | 81 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPad.h | C++ | 25 | 10 | 16 | 51 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPadInput.h | C++ | 50 | 10 | 15 | 75 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Counter\counter.cpp | C++ | 45 | 0 | 12 | 57 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Counter\counter.h | C++ | 21 | 0 | 10 | 31 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Illumination\underfloorLighting.cpp | C++ | 0 | 0 | 1 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Illumination\underfloorLighting.h | C++ | 0 | 0 | 1 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\LcdWrapper\LcdWrapper.cpp | C++ | 45 | 10 | 12 | 67 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\LcdWrapper\LcdWrapper.h | C++ | 25 | 41 | 15 | 81 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\MQTT\debugMqtt.cpp | C++ | 81 | 12 | 17 | 110 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\MQTT\debugMqtt.h | C++ | 41 | 120 | 18 | 179 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\MotorControl\motorControl.cpp | C++ | 142 | 24 | 35 | 201 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\MotorControl\motorControl.h | C++ | 48 | 102 | 22 | 172 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Navigation\navigation.cpp | C++ | 192 | 29 | 47 | 268 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Navigation\navigation.h | C++ | 68 | 141 | 36 | 245 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Navigation\route.cpp | C++ | 125 | 22 | 34 | 181 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Navigation\route.h | C++ | 71 | 135 | 35 | 241 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\NtripClient\ntripClient.cpp | C++ | 198 | 23 | 46 | 267 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\NtripClient\ntripClient.h | C++ | 51 | 63 | 18 | 132 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Speedometer\speedometer.cpp | C++ | 109 | 18 | 32 | 159 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Speedometer\speedometer.h | C++ | 51 | 100 | 28 | 179 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Times\debugTimes.cpp | C++ | 28 | 10 | 9 | 47 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Times\debugTimes.h | C++ | 19 | 45 | 13 | 77 |
|
||||
| d:\Embedded\Projektarbeit-Rover\platformio.ini | Ini | 26 | 9 | 5 | 40 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\OutputBuf\outputBuf.cpp | C++ | 36 | 11 | 13 | 60 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\OutputBuf\outputBuf.h | C++ | 24 | 48 | 14 | 86 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\GPS\menuGPS.cpp | C++ | 130 | 11 | 19 | 160 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\GPS\menuGPS.h | C++ | 17 | 19 | 8 | 44 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\PID\menuPidSettings.cpp | C++ | 9 | 10 | 4 | 23 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\PID\menuPidSettings.h | C++ | 13 | 19 | 8 | 40 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoute.cpp | C++ | 197 | 13 | 55 | 265 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoute.h | C++ | 52 | 83 | 22 | 157 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoutePoints.cpp | C++ | 54 | 12 | 11 | 77 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoutePoints.h | C++ | 15 | 27 | 9 | 51 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Systeminformation\menuSysteminformatio.cpp | C++ | 34 | 15 | 11 | 60 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Systeminformation\menuSysteminformation.h | C++ | 14 | 21 | 8 | 43 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.cpp | C++ | 122 | 10 | 24 | 156 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.h | C++ | 14 | 31 | 9 | 54 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.cpp | C++ | 47 | 10 | 13 | 70 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.h | C++ | 13 | 31 | 8 | 52 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.cpp | C++ | 58 | 10 | 16 | 84 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.h | C++ | 14 | 27 | 8 | 49 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\menuTestMode.cpp | C++ | 183 | 20 | 40 | 243 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\menuTestMode.h | C++ | 48 | 36 | 16 | 100 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\speedometerTest.cpp | C++ | 54 | 10 | 16 | 80 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\speedometerTest.h | C++ | 20 | 34 | 11 | 65 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\menuDriveMode.cpp | C++ | 16 | 10 | 5 | 31 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\menuDriveMode.h | C++ | 15 | 25 | 8 | 48 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilot.cpp | C++ | 99 | 11 | 25 | 135 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilot.h | C++ | 46 | 68 | 18 | 132 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilotConfig.h | C++ | 9 | 36 | 10 | 55 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\CaptureRoute\captureRoute.cpp | C++ | 63 | 10 | 14 | 87 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\CaptureRoute\captureRoute.h | C++ | 34 | 62 | 17 | 113 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ConsolControl\consolControl.cpp | C++ | 1 | 10 | 3 | 14 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ConsolControl\consolControl.h | C++ | 6 | 10 | 5 | 21 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ManualControl\manualControl.cpp | C++ | 26 | 15 | 8 | 49 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ManualControl\manualControl.h | C++ | 30 | 49 | 12 | 91 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Racing\racing.cpp | C++ | 0 | 0 | 1 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Racing\racing.h | C++ | 0 | 0 | 1 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\TestMode\testMode.cpp | C++ | 115 | 14 | 27 | 156 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\TestMode\testMode.h | C++ | 50 | 79 | 24 | 153 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\driveManager.cpp | C++ | 64 | 14 | 21 | 99 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\driveManager.h | C++ | 43 | 69 | 17 | 129 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\driveModi.h | C++ | 9 | 22 | 5 | 36 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\main.cpp | C++ | 234 | 22 | 47 | 303 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\moveControl.cpp | C++ | 162 | 27 | 39 | 228 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\network.cpp | C++ | 113 | 17 | 26 | 156 |
|
||||
| Total | | 592 | 367 | 256 | 1,215 |
|
||||
+-----------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+
|
||||
@@ -0,0 +1,95 @@
|
||||
"filename", "language", "Ini", "C++", "Python", "Markdown", "JSON", "comment", "blank", "total"
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\details.md", "Markdown", 0, 0, 0, 60, 0, 0, 6, 66
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\diff-details.md", "Markdown", 0, 0, 0, 9, 0, 0, 6, 15
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\diff.md", "Markdown", 0, 0, 0, 12, 0, 0, 7, 19
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\results.json", "JSON", 0, 0, 0, 0, 1, 0, 0, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\results.md", "Markdown", 0, 0, 0, 39, 0, 0, 7, 46
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\details.md", "Markdown", 0, 0, 0, 71, 0, 0, 6, 77
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\diff-details.md", "Markdown", 0, 0, 0, 52, 0, 0, 6, 58
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\diff.md", "Markdown", 0, 0, 0, 31, 0, 0, 7, 38
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\results.json", "JSON", 0, 0, 0, 0, 1, 0, 0, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\results.md", "Markdown", 0, 0, 0, 44, 0, 0, 7, 51
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\details.md", "Markdown", 0, 0, 0, 93, 0, 0, 6, 99
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\diff-details.md", "Markdown", 0, 0, 0, 91, 0, 0, 6, 97
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\diff.md", "Markdown", 0, 0, 0, 54, 0, 0, 7, 61
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\results.json", "JSON", 0, 0, 0, 0, 1, 0, 0, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\results.md", "Markdown", 0, 0, 0, 57, 0, 0, 7, 64
|
||||
"d:\Embedded\Projektarbeit-Rover\debugMqtt\hw1\main.py", "Python", 0, 0, 14, 0, 0, 2, 10, 26
|
||||
"d:\Embedded\Projektarbeit-Rover\debugMqtt\hw1\main_debug.py", "Python", 0, 0, 12, 0, 0, 2, 10, 24
|
||||
"d:\Embedded\Projektarbeit-Rover\debugMqtt\rhede\main.py", "Python", 0, 0, 16, 0, 0, 2, 10, 28
|
||||
"d:\Embedded\Projektarbeit-Rover\debugMqtt\rhede\main_debug.py", "Python", 0, 0, 13, 0, 0, 2, 10, 25
|
||||
"d:\Embedded\Projektarbeit-Rover\include\config.h", "C++", 0, 8, 0, 0, 0, 26, 5, 39
|
||||
"d:\Embedded\Projektarbeit-Rover\include\moveControl.h", "C++", 0, 58, 0, 0, 0, 130, 28, 216
|
||||
"d:\Embedded\Projektarbeit-Rover\include\moveControlConfig.h", "C++", 0, 21, 0, 0, 0, 18, 4, 43
|
||||
"d:\Embedded\Projektarbeit-Rover\include\network.h", "C++", 0, 33, 0, 0, 0, 56, 16, 105
|
||||
"d:\Embedded\Projektarbeit-Rover\include\networkConfig.h", "C++", 0, 98, 0, 0, 0, 37, 17, 152
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Battery\battery.cpp", "C++", 0, 107, 0, 0, 0, 13, 22, 142
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Battery\battery.h", "C++", 0, 55, 0, 0, 0, 65, 16, 136
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPad.cpp", "C++", 0, 56, 0, 0, 0, 10, 15, 81
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPad.h", "C++", 0, 25, 0, 0, 0, 10, 16, 51
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPadInput.h", "C++", 0, 50, 0, 0, 0, 10, 15, 75
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Counter\counter.cpp", "C++", 0, 45, 0, 0, 0, 0, 12, 57
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Counter\counter.h", "C++", 0, 21, 0, 0, 0, 0, 10, 31
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Illumination\underfloorLighting.cpp", "C++", 0, 0, 0, 0, 0, 0, 1, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Illumination\underfloorLighting.h", "C++", 0, 0, 0, 0, 0, 0, 1, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\LcdWrapper\LcdWrapper.cpp", "C++", 0, 45, 0, 0, 0, 10, 12, 67
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\LcdWrapper\LcdWrapper.h", "C++", 0, 25, 0, 0, 0, 41, 15, 81
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\MQTT\debugMqtt.cpp", "C++", 0, 81, 0, 0, 0, 12, 17, 110
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\MQTT\debugMqtt.h", "C++", 0, 41, 0, 0, 0, 120, 18, 179
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\MotorControl\motorControl.cpp", "C++", 0, 142, 0, 0, 0, 24, 35, 201
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\MotorControl\motorControl.h", "C++", 0, 48, 0, 0, 0, 102, 22, 172
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Navigation\navigation.cpp", "C++", 0, 192, 0, 0, 0, 29, 47, 268
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Navigation\navigation.h", "C++", 0, 68, 0, 0, 0, 141, 36, 245
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Navigation\route.cpp", "C++", 0, 125, 0, 0, 0, 22, 34, 181
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Navigation\route.h", "C++", 0, 71, 0, 0, 0, 135, 35, 241
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\NtripClient\ntripClient.cpp", "C++", 0, 198, 0, 0, 0, 23, 46, 267
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\NtripClient\ntripClient.h", "C++", 0, 51, 0, 0, 0, 63, 18, 132
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Speedometer\speedometer.cpp", "C++", 0, 109, 0, 0, 0, 18, 32, 159
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Speedometer\speedometer.h", "C++", 0, 51, 0, 0, 0, 100, 28, 179
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Times\debugTimes.cpp", "C++", 0, 28, 0, 0, 0, 10, 9, 47
|
||||
"d:\Embedded\Projektarbeit-Rover\lib\Times\debugTimes.h", "C++", 0, 19, 0, 0, 0, 45, 13, 77
|
||||
"d:\Embedded\Projektarbeit-Rover\platformio.ini", "Ini", 26, 0, 0, 0, 0, 9, 5, 40
|
||||
"d:\Embedded\Projektarbeit-Rover\src\OutputBuf\outputBuf.cpp", "C++", 0, 36, 0, 0, 0, 11, 13, 60
|
||||
"d:\Embedded\Projektarbeit-Rover\src\OutputBuf\outputBuf.h", "C++", 0, 24, 0, 0, 0, 48, 14, 86
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\GPS\menuGPS.cpp", "C++", 0, 130, 0, 0, 0, 11, 19, 160
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\GPS\menuGPS.h", "C++", 0, 17, 0, 0, 0, 19, 8, 44
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\PID\menuPidSettings.cpp", "C++", 0, 9, 0, 0, 0, 10, 4, 23
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\PID\menuPidSettings.h", "C++", 0, 13, 0, 0, 0, 19, 8, 40
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoute.cpp", "C++", 0, 197, 0, 0, 0, 13, 55, 265
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoute.h", "C++", 0, 52, 0, 0, 0, 83, 22, 157
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoutePoints.cpp", "C++", 0, 54, 0, 0, 0, 12, 11, 77
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoutePoints.h", "C++", 0, 15, 0, 0, 0, 27, 9, 51
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Systeminformation\menuSysteminformatio.cpp", "C++", 0, 34, 0, 0, 0, 15, 11, 60
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Systeminformation\menuSysteminformation.h", "C++", 0, 14, 0, 0, 0, 21, 8, 43
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.cpp", "C++", 0, 122, 0, 0, 0, 10, 24, 156
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.h", "C++", 0, 14, 0, 0, 0, 31, 9, 54
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.cpp", "C++", 0, 47, 0, 0, 0, 10, 13, 70
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.h", "C++", 0, 13, 0, 0, 0, 31, 8, 52
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.cpp", "C++", 0, 58, 0, 0, 0, 10, 16, 84
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.h", "C++", 0, 14, 0, 0, 0, 27, 8, 49
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\menuTestMode.cpp", "C++", 0, 183, 0, 0, 0, 20, 40, 243
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\menuTestMode.h", "C++", 0, 48, 0, 0, 0, 36, 16, 100
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\speedometerTest.cpp", "C++", 0, 54, 0, 0, 0, 10, 16, 80
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\speedometerTest.h", "C++", 0, 20, 0, 0, 0, 34, 11, 65
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\menuDriveMode.cpp", "C++", 0, 16, 0, 0, 0, 10, 5, 31
|
||||
"d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\menuDriveMode.h", "C++", 0, 15, 0, 0, 0, 25, 8, 48
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilot.cpp", "C++", 0, 99, 0, 0, 0, 11, 25, 135
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilot.h", "C++", 0, 46, 0, 0, 0, 68, 18, 132
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilotConfig.h", "C++", 0, 9, 0, 0, 0, 36, 10, 55
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\CaptureRoute\captureRoute.cpp", "C++", 0, 63, 0, 0, 0, 10, 14, 87
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\CaptureRoute\captureRoute.h", "C++", 0, 34, 0, 0, 0, 62, 17, 113
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ConsolControl\consolControl.cpp", "C++", 0, 1, 0, 0, 0, 10, 3, 14
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ConsolControl\consolControl.h", "C++", 0, 6, 0, 0, 0, 10, 5, 21
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ManualControl\manualControl.cpp", "C++", 0, 26, 0, 0, 0, 15, 8, 49
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ManualControl\manualControl.h", "C++", 0, 30, 0, 0, 0, 49, 12, 91
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Racing\racing.cpp", "C++", 0, 0, 0, 0, 0, 0, 1, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Racing\racing.h", "C++", 0, 0, 0, 0, 0, 0, 1, 1
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\TestMode\testMode.cpp", "C++", 0, 115, 0, 0, 0, 14, 27, 156
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\TestMode\testMode.h", "C++", 0, 50, 0, 0, 0, 79, 24, 153
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\driveManager.cpp", "C++", 0, 64, 0, 0, 0, 14, 21, 99
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\driveManager.h", "C++", 0, 43, 0, 0, 0, 69, 17, 129
|
||||
"d:\Embedded\Projektarbeit-Rover\src\driveModi\driveModi.h", "C++", 0, 9, 0, 0, 0, 22, 5, 36
|
||||
"d:\Embedded\Projektarbeit-Rover\src\main.cpp", "C++", 0, 234, 0, 0, 0, 22, 47, 303
|
||||
"d:\Embedded\Projektarbeit-Rover\src\moveControl.cpp", "C++", 0, 162, 0, 0, 0, 27, 39, 228
|
||||
"d:\Embedded\Projektarbeit-Rover\src\network.cpp", "C++", 0, 113, 0, 0, 0, 17, 26, 156
|
||||
"Total", "-", 26, 4174, 55, 613, 3, 2365, 1394, 8630
|
||||
|
File diff suppressed because one or more lines are too long
@@ -0,0 +1,69 @@
|
||||
# Summary
|
||||
|
||||
Date : 2023-05-11 22:19:18
|
||||
|
||||
Directory d:\\Embedded\\Projektarbeit-Rover
|
||||
|
||||
Total : 93 files, 4871 codes, 2365 comments, 1394 blanks, all 8630 lines
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C++ | 73 | 4,174 | 2,348 | 1,271 | 7,793 |
|
||||
| Markdown | 12 | 613 | 0 | 78 | 691 |
|
||||
| Python | 4 | 55 | 8 | 40 | 103 |
|
||||
| Ini | 1 | 26 | 9 | 5 | 40 |
|
||||
| JSON | 3 | 3 | 0 | 0 | 3 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 93 | 4,871 | 2,365 | 1,394 | 8,630 |
|
||||
| . (Files) | 1 | 26 | 9 | 5 | 40 |
|
||||
| .VSCodeCounter | 15 | 616 | 0 | 78 | 694 |
|
||||
| .VSCodeCounter\\2022-01-19_11-26-30 | 5 | 121 | 0 | 26 | 147 |
|
||||
| .VSCodeCounter\\2022-02-01_10-50-06 | 5 | 199 | 0 | 26 | 225 |
|
||||
| .VSCodeCounter\\2022-12-09_11-39-58 | 5 | 296 | 0 | 26 | 322 |
|
||||
| debugMqtt | 4 | 55 | 8 | 40 | 103 |
|
||||
| debugMqtt\\hw1 | 2 | 26 | 4 | 20 | 50 |
|
||||
| debugMqtt\\rhede | 2 | 29 | 4 | 20 | 53 |
|
||||
| include | 5 | 218 | 267 | 70 | 555 |
|
||||
| lib | 25 | 1,653 | 1,003 | 525 | 3,181 |
|
||||
| lib\\Battery | 2 | 162 | 78 | 38 | 278 |
|
||||
| lib\\ControllPad | 3 | 131 | 30 | 46 | 207 |
|
||||
| lib\\Counter | 2 | 66 | 0 | 22 | 88 |
|
||||
| lib\\Illumination | 2 | 0 | 0 | 2 | 2 |
|
||||
| lib\\LcdWrapper | 2 | 70 | 51 | 27 | 148 |
|
||||
| lib\\MQTT | 2 | 122 | 132 | 35 | 289 |
|
||||
| lib\\MotorControl | 2 | 190 | 126 | 57 | 373 |
|
||||
| lib\\Navigation | 4 | 456 | 327 | 152 | 935 |
|
||||
| lib\\NtripClient | 2 | 249 | 86 | 64 | 399 |
|
||||
| lib\\Speedometer | 2 | 160 | 118 | 60 | 338 |
|
||||
| lib\\Times | 2 | 47 | 55 | 22 | 124 |
|
||||
| src | 43 | 2,303 | 1,078 | 676 | 4,057 |
|
||||
| src (Files) | 3 | 509 | 66 | 112 | 687 |
|
||||
| src\\OutputBuf | 2 | 60 | 59 | 27 | 146 |
|
||||
| src\\SpecialMenus | 22 | 1,139 | 484 | 329 | 1,952 |
|
||||
| src\\SpecialMenus\\GPS | 2 | 147 | 30 | 27 | 204 |
|
||||
| src\\SpecialMenus\\PID | 2 | 22 | 29 | 12 | 63 |
|
||||
| src\\SpecialMenus\\Route | 4 | 318 | 135 | 97 | 550 |
|
||||
| src\\SpecialMenus\\Systeminformation | 2 | 48 | 36 | 19 | 103 |
|
||||
| src\\SpecialMenus\\driveModi | 12 | 604 | 254 | 174 | 1,032 |
|
||||
| src\\SpecialMenus\\driveModi (Files) | 2 | 31 | 35 | 13 | 79 |
|
||||
| src\\SpecialMenus\\driveModi\\Autopilot | 2 | 136 | 41 | 33 | 210 |
|
||||
| src\\SpecialMenus\\driveModi\\CaptureRoute | 2 | 60 | 41 | 21 | 122 |
|
||||
| src\\SpecialMenus\\driveModi\\ManualDrive | 2 | 72 | 37 | 24 | 133 |
|
||||
| src\\SpecialMenus\\driveModi\\TestMode | 4 | 305 | 100 | 83 | 488 |
|
||||
| src\\driveModi | 16 | 595 | 469 | 208 | 1,272 |
|
||||
| src\\driveModi (Files) | 3 | 116 | 105 | 43 | 264 |
|
||||
| src\\driveModi\\Modi | 13 | 479 | 364 | 165 | 1,008 |
|
||||
| src\\driveModi\\Modi\\Autopilot | 3 | 154 | 115 | 53 | 322 |
|
||||
| src\\driveModi\\Modi\\CaptureRoute | 2 | 97 | 72 | 31 | 200 |
|
||||
| src\\driveModi\\Modi\\ConsolControl | 2 | 7 | 20 | 8 | 35 |
|
||||
| src\\driveModi\\Modi\\ManualControl | 2 | 56 | 64 | 20 | 140 |
|
||||
| src\\driveModi\\Modi\\Racing | 2 | 0 | 0 | 2 | 2 |
|
||||
| src\\driveModi\\Modi\\TestMode | 2 | 165 | 93 | 51 | 309 |
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
@@ -0,0 +1,165 @@
|
||||
Date : 2023-05-11 22:19:18
|
||||
Directory : d:\Embedded\Projektarbeit-Rover
|
||||
Total : 93 files, 4871 codes, 2365 comments, 1394 blanks, all 8630 lines
|
||||
|
||||
Languages
|
||||
+----------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+----------+------------+------------+------------+------------+------------+
|
||||
| C++ | 73 | 4,174 | 2,348 | 1,271 | 7,793 |
|
||||
| Markdown | 12 | 613 | 0 | 78 | 691 |
|
||||
| Python | 4 | 55 | 8 | 40 | 103 |
|
||||
| Ini | 1 | 26 | 9 | 5 | 40 |
|
||||
| JSON | 3 | 3 | 0 | 0 | 3 |
|
||||
+----------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+----------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+----------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 93 | 4,871 | 2,365 | 1,394 | 8,630 |
|
||||
| . (Files) | 1 | 26 | 9 | 5 | 40 |
|
||||
| .VSCodeCounter | 15 | 616 | 0 | 78 | 694 |
|
||||
| .VSCodeCounter\2022-01-19_11-26-30 | 5 | 121 | 0 | 26 | 147 |
|
||||
| .VSCodeCounter\2022-02-01_10-50-06 | 5 | 199 | 0 | 26 | 225 |
|
||||
| .VSCodeCounter\2022-12-09_11-39-58 | 5 | 296 | 0 | 26 | 322 |
|
||||
| debugMqtt | 4 | 55 | 8 | 40 | 103 |
|
||||
| debugMqtt\hw1 | 2 | 26 | 4 | 20 | 50 |
|
||||
| debugMqtt\rhede | 2 | 29 | 4 | 20 | 53 |
|
||||
| include | 5 | 218 | 267 | 70 | 555 |
|
||||
| lib | 25 | 1,653 | 1,003 | 525 | 3,181 |
|
||||
| lib\Battery | 2 | 162 | 78 | 38 | 278 |
|
||||
| lib\ControllPad | 3 | 131 | 30 | 46 | 207 |
|
||||
| lib\Counter | 2 | 66 | 0 | 22 | 88 |
|
||||
| lib\Illumination | 2 | 0 | 0 | 2 | 2 |
|
||||
| lib\LcdWrapper | 2 | 70 | 51 | 27 | 148 |
|
||||
| lib\MQTT | 2 | 122 | 132 | 35 | 289 |
|
||||
| lib\MotorControl | 2 | 190 | 126 | 57 | 373 |
|
||||
| lib\Navigation | 4 | 456 | 327 | 152 | 935 |
|
||||
| lib\NtripClient | 2 | 249 | 86 | 64 | 399 |
|
||||
| lib\Speedometer | 2 | 160 | 118 | 60 | 338 |
|
||||
| lib\Times | 2 | 47 | 55 | 22 | 124 |
|
||||
| src | 43 | 2,303 | 1,078 | 676 | 4,057 |
|
||||
| src (Files) | 3 | 509 | 66 | 112 | 687 |
|
||||
| src\OutputBuf | 2 | 60 | 59 | 27 | 146 |
|
||||
| src\SpecialMenus | 22 | 1,139 | 484 | 329 | 1,952 |
|
||||
| src\SpecialMenus\GPS | 2 | 147 | 30 | 27 | 204 |
|
||||
| src\SpecialMenus\PID | 2 | 22 | 29 | 12 | 63 |
|
||||
| src\SpecialMenus\Route | 4 | 318 | 135 | 97 | 550 |
|
||||
| src\SpecialMenus\Systeminformation | 2 | 48 | 36 | 19 | 103 |
|
||||
| src\SpecialMenus\driveModi | 12 | 604 | 254 | 174 | 1,032 |
|
||||
| src\SpecialMenus\driveModi (Files) | 2 | 31 | 35 | 13 | 79 |
|
||||
| src\SpecialMenus\driveModi\Autopilot | 2 | 136 | 41 | 33 | 210 |
|
||||
| src\SpecialMenus\driveModi\CaptureRoute | 2 | 60 | 41 | 21 | 122 |
|
||||
| src\SpecialMenus\driveModi\ManualDrive | 2 | 72 | 37 | 24 | 133 |
|
||||
| src\SpecialMenus\driveModi\TestMode | 4 | 305 | 100 | 83 | 488 |
|
||||
| src\driveModi | 16 | 595 | 469 | 208 | 1,272 |
|
||||
| src\driveModi (Files) | 3 | 116 | 105 | 43 | 264 |
|
||||
| src\driveModi\Modi | 13 | 479 | 364 | 165 | 1,008 |
|
||||
| src\driveModi\Modi\Autopilot | 3 | 154 | 115 | 53 | 322 |
|
||||
| src\driveModi\Modi\CaptureRoute | 2 | 97 | 72 | 31 | 200 |
|
||||
| src\driveModi\Modi\ConsolControl | 2 | 7 | 20 | 8 | 35 |
|
||||
| src\driveModi\Modi\ManualControl | 2 | 56 | 64 | 20 | 140 |
|
||||
| src\driveModi\Modi\Racing | 2 | 0 | 0 | 2 | 2 |
|
||||
| src\driveModi\Modi\TestMode | 2 | 165 | 93 | 51 | 309 |
|
||||
+----------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+----------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+----------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\details.md | Markdown | 60 | 0 | 6 | 66 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\diff-details.md | Markdown | 9 | 0 | 6 | 15 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\diff.md | Markdown | 12 | 0 | 7 | 19 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\results.json | JSON | 1 | 0 | 0 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-01-19_11-26-30\results.md | Markdown | 39 | 0 | 7 | 46 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\details.md | Markdown | 71 | 0 | 6 | 77 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\diff-details.md | Markdown | 52 | 0 | 6 | 58 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\diff.md | Markdown | 31 | 0 | 7 | 38 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\results.json | JSON | 1 | 0 | 0 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-02-01_10-50-06\results.md | Markdown | 44 | 0 | 7 | 51 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\details.md | Markdown | 93 | 0 | 6 | 99 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\diff-details.md | Markdown | 91 | 0 | 6 | 97 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\diff.md | Markdown | 54 | 0 | 7 | 61 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\results.json | JSON | 1 | 0 | 0 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\.VSCodeCounter\2022-12-09_11-39-58\results.md | Markdown | 57 | 0 | 7 | 64 |
|
||||
| d:\Embedded\Projektarbeit-Rover\debugMqtt\hw1\main.py | Python | 14 | 2 | 10 | 26 |
|
||||
| d:\Embedded\Projektarbeit-Rover\debugMqtt\hw1\main_debug.py | Python | 12 | 2 | 10 | 24 |
|
||||
| d:\Embedded\Projektarbeit-Rover\debugMqtt\rhede\main.py | Python | 16 | 2 | 10 | 28 |
|
||||
| d:\Embedded\Projektarbeit-Rover\debugMqtt\rhede\main_debug.py | Python | 13 | 2 | 10 | 25 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\config.h | C++ | 8 | 26 | 5 | 39 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\moveControl.h | C++ | 58 | 130 | 28 | 216 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\moveControlConfig.h | C++ | 21 | 18 | 4 | 43 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\network.h | C++ | 33 | 56 | 16 | 105 |
|
||||
| d:\Embedded\Projektarbeit-Rover\include\networkConfig.h | C++ | 98 | 37 | 17 | 152 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Battery\battery.cpp | C++ | 107 | 13 | 22 | 142 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Battery\battery.h | C++ | 55 | 65 | 16 | 136 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPad.cpp | C++ | 56 | 10 | 15 | 81 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPad.h | C++ | 25 | 10 | 16 | 51 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\ControllPad\controlPadInput.h | C++ | 50 | 10 | 15 | 75 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Counter\counter.cpp | C++ | 45 | 0 | 12 | 57 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Counter\counter.h | C++ | 21 | 0 | 10 | 31 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Illumination\underfloorLighting.cpp | C++ | 0 | 0 | 1 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Illumination\underfloorLighting.h | C++ | 0 | 0 | 1 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\LcdWrapper\LcdWrapper.cpp | C++ | 45 | 10 | 12 | 67 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\LcdWrapper\LcdWrapper.h | C++ | 25 | 41 | 15 | 81 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\MQTT\debugMqtt.cpp | C++ | 81 | 12 | 17 | 110 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\MQTT\debugMqtt.h | C++ | 41 | 120 | 18 | 179 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\MotorControl\motorControl.cpp | C++ | 142 | 24 | 35 | 201 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\MotorControl\motorControl.h | C++ | 48 | 102 | 22 | 172 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Navigation\navigation.cpp | C++ | 192 | 29 | 47 | 268 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Navigation\navigation.h | C++ | 68 | 141 | 36 | 245 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Navigation\route.cpp | C++ | 125 | 22 | 34 | 181 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Navigation\route.h | C++ | 71 | 135 | 35 | 241 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\NtripClient\ntripClient.cpp | C++ | 198 | 23 | 46 | 267 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\NtripClient\ntripClient.h | C++ | 51 | 63 | 18 | 132 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Speedometer\speedometer.cpp | C++ | 109 | 18 | 32 | 159 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Speedometer\speedometer.h | C++ | 51 | 100 | 28 | 179 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Times\debugTimes.cpp | C++ | 28 | 10 | 9 | 47 |
|
||||
| d:\Embedded\Projektarbeit-Rover\lib\Times\debugTimes.h | C++ | 19 | 45 | 13 | 77 |
|
||||
| d:\Embedded\Projektarbeit-Rover\platformio.ini | Ini | 26 | 9 | 5 | 40 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\OutputBuf\outputBuf.cpp | C++ | 36 | 11 | 13 | 60 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\OutputBuf\outputBuf.h | C++ | 24 | 48 | 14 | 86 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\GPS\menuGPS.cpp | C++ | 130 | 11 | 19 | 160 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\GPS\menuGPS.h | C++ | 17 | 19 | 8 | 44 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\PID\menuPidSettings.cpp | C++ | 9 | 10 | 4 | 23 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\PID\menuPidSettings.h | C++ | 13 | 19 | 8 | 40 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoute.cpp | C++ | 197 | 13 | 55 | 265 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoute.h | C++ | 52 | 83 | 22 | 157 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoutePoints.cpp | C++ | 54 | 12 | 11 | 77 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Route\menuRoutePoints.h | C++ | 15 | 27 | 9 | 51 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Systeminformation\menuSysteminformatio.cpp | C++ | 34 | 15 | 11 | 60 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\Systeminformation\menuSysteminformation.h | C++ | 14 | 21 | 8 | 43 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.cpp | C++ | 122 | 10 | 24 | 156 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\Autopilot\menuAutopilot.h | C++ | 14 | 31 | 9 | 54 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.cpp | C++ | 47 | 10 | 13 | 70 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\CaptureRoute\menuCaptureRoute.h | C++ | 13 | 31 | 8 | 52 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.cpp | C++ | 58 | 10 | 16 | 84 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\ManualDrive\menuManualDrive.h | C++ | 14 | 27 | 8 | 49 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\menuTestMode.cpp | C++ | 183 | 20 | 40 | 243 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\menuTestMode.h | C++ | 48 | 36 | 16 | 100 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\speedometerTest.cpp | C++ | 54 | 10 | 16 | 80 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\TestMode\speedometerTest.h | C++ | 20 | 34 | 11 | 65 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\menuDriveMode.cpp | C++ | 16 | 10 | 5 | 31 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\SpecialMenus\driveModi\menuDriveMode.h | C++ | 15 | 25 | 8 | 48 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilot.cpp | C++ | 99 | 11 | 25 | 135 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilot.h | C++ | 46 | 68 | 18 | 132 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Autopilot\autopilotConfig.h | C++ | 9 | 36 | 10 | 55 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\CaptureRoute\captureRoute.cpp | C++ | 63 | 10 | 14 | 87 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\CaptureRoute\captureRoute.h | C++ | 34 | 62 | 17 | 113 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ConsolControl\consolControl.cpp | C++ | 1 | 10 | 3 | 14 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ConsolControl\consolControl.h | C++ | 6 | 10 | 5 | 21 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ManualControl\manualControl.cpp | C++ | 26 | 15 | 8 | 49 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\ManualControl\manualControl.h | C++ | 30 | 49 | 12 | 91 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Racing\racing.cpp | C++ | 0 | 0 | 1 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\Racing\racing.h | C++ | 0 | 0 | 1 | 1 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\TestMode\testMode.cpp | C++ | 115 | 14 | 27 | 156 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\Modi\TestMode\testMode.h | C++ | 50 | 79 | 24 | 153 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\driveManager.cpp | C++ | 64 | 14 | 21 | 99 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\driveManager.h | C++ | 43 | 69 | 17 | 129 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\driveModi\driveModi.h | C++ | 9 | 22 | 5 | 36 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\main.cpp | C++ | 234 | 22 | 47 | 303 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\moveControl.cpp | C++ | 162 | 27 | 39 | 228 |
|
||||
| d:\Embedded\Projektarbeit-Rover\src\network.cpp | C++ | 113 | 17 | 26 | 156 |
|
||||
| Total | | 4,871 | 2,365 | 1,394 | 8,630 |
|
||||
+----------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+
|
||||
+1
-2
@@ -3,11 +3,10 @@
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
.vscode/ipch
|
||||
rover-cppcheck-build-dir
|
||||
|
||||
doc/Doxygen/html*
|
||||
doc/Doxygen/generated*
|
||||
|
||||
|
||||
|
||||
workspace.code-workspace
|
||||
projektarbeit.code-workspace
|
||||
|
||||
Vendored
+57
-2
@@ -77,31 +77,86 @@
|
||||
"istream": "cpp",
|
||||
"streambuf": "cpp",
|
||||
"functional": "cpp",
|
||||
"cmath": "cpp"
|
||||
"cmath": "cpp",
|
||||
"atomic": "cpp",
|
||||
"cctype": "cpp",
|
||||
"chrono": "cpp",
|
||||
"clocale": "cpp",
|
||||
"cstdarg": "cpp",
|
||||
"cstddef": "cpp",
|
||||
"cstdint": "cpp",
|
||||
"cstdio": "cpp",
|
||||
"cstdlib": "cpp",
|
||||
"cstring": "cpp",
|
||||
"ctime": "cpp",
|
||||
"cwchar": "cpp",
|
||||
"cwctype": "cpp",
|
||||
"unordered_map": "cpp",
|
||||
"unordered_set": "cpp",
|
||||
"exception": "cpp",
|
||||
"algorithm": "cpp",
|
||||
"iterator": "cpp",
|
||||
"map": "cpp",
|
||||
"memory": "cpp",
|
||||
"memory_resource": "cpp",
|
||||
"numeric": "cpp",
|
||||
"optional": "cpp",
|
||||
"random": "cpp",
|
||||
"ratio": "cpp",
|
||||
"string_view": "cpp",
|
||||
"system_error": "cpp",
|
||||
"tuple": "cpp",
|
||||
"type_traits": "cpp",
|
||||
"utility": "cpp",
|
||||
"initializer_list": "cpp",
|
||||
"iomanip": "cpp",
|
||||
"iosfwd": "cpp",
|
||||
"iostream": "cpp",
|
||||
"limits": "cpp",
|
||||
"ostream": "cpp",
|
||||
"sstream": "cpp",
|
||||
"stdexcept": "cpp",
|
||||
"cinttypes": "cpp",
|
||||
"typeinfo": "cpp"
|
||||
},
|
||||
"cSpell.words": [
|
||||
"Ahnung",
|
||||
"akku",
|
||||
"ardui",
|
||||
"Baseclass",
|
||||
"blox",
|
||||
"bluedroid",
|
||||
"carr",
|
||||
"CIPO",
|
||||
"COPI",
|
||||
"Doxygen",
|
||||
"Dutycycle",
|
||||
"gast",
|
||||
"GNSS",
|
||||
"GPGGA",
|
||||
"HSPI",
|
||||
"Huus",
|
||||
"Keine",
|
||||
"kleiax",
|
||||
"Lebennig",
|
||||
"microcontroller",
|
||||
"MQTT",
|
||||
"NMEA",
|
||||
"NMEAGPGGA",
|
||||
"NTRIP",
|
||||
"pcnt",
|
||||
"pidl",
|
||||
"pidr",
|
||||
"Punica",
|
||||
"RHEDE",
|
||||
"Rtcm",
|
||||
"Schalke",
|
||||
"Soln",
|
||||
"Systeminformation",
|
||||
"TPMOBIL",
|
||||
"UBLOX",
|
||||
"wheelspeed",
|
||||
"ZLPJ"
|
||||
]
|
||||
],
|
||||
"cmake.configureOnOpen": false
|
||||
}
|
||||
|
||||
Submodule
+1
Submodule autoVersionIncrement added at fd51b62f00
@@ -51,7 +51,7 @@ PROJECT_BRIEF = "A small verhicle which should be drive a route with GP
|
||||
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
|
||||
# the logo to the output directory.
|
||||
|
||||
PROJECT_LOGO = C:/Users/alex1/git/projektarbeit/doc/Doxygen/logo.png
|
||||
PROJECT_LOGO = logo.png
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
||||
# into which the generated documentation will be written. If a relative path is
|
||||
@@ -606,7 +606,7 @@ HIDE_COMPOUND_REFERENCE= NO
|
||||
# will show which file needs to be included to use the class.
|
||||
# The default value is: YES.
|
||||
|
||||
SHOW_HEADERFILE = YES
|
||||
# SHOW_HEADERFILE = YES
|
||||
|
||||
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
|
||||
# the files that are included by a file in the documentation of that file.
|
||||
@@ -824,7 +824,7 @@ WARN_IF_DOC_ERROR = YES
|
||||
# parameters have no documentation without warning.
|
||||
# The default value is: YES.
|
||||
|
||||
WARN_IF_INCOMPLETE_DOC = YES
|
||||
# WARN_IF_INCOMPLETE_DOC = YES
|
||||
|
||||
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
|
||||
# are documented, but have no documentation for their parameters or return
|
||||
@@ -1608,7 +1608,7 @@ GENERATE_TREEVIEW = YES
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
FULL_SIDEBAR = NO
|
||||
# FULL_SIDEBAR = NO
|
||||
|
||||
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
|
||||
# doxygen will group on one line in the generated HTML documentation.
|
||||
@@ -1691,7 +1691,7 @@ USE_MATHJAX = NO
|
||||
# The default value is: MathJax_2.
|
||||
# This tag requires that the tag USE_MATHJAX is set to YES.
|
||||
|
||||
MATHJAX_VERSION = MathJax_2
|
||||
# MATHJAX_VERSION = MathJax_2
|
||||
|
||||
# When MathJax is enabled you can set the default output format to be used for
|
||||
# the MathJax output. For more details about the output format see MathJax
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
Added this code in SparkFun_u-blox_GNSS_Arduino_Libary.cpp in the function pushRawData.
|
||||
|
||||
_spiPort->beginTransaction(SPISettings(_spiSpeed, MSBFIRST, SPI_MODE0));
|
||||
digitalWrite(_csPin, LOW);
|
||||
for (uint16_t i = 0; i < numDataBytes; i++) {
|
||||
spiTransfer(dataBytes[i]);
|
||||
}
|
||||
digitalWrite(_csPin, HIGH);
|
||||
_spiPort->endTransaction();
|
||||
@@ -1,3 +0,0 @@
|
||||
-> Program underfloorLighting
|
||||
-> Add an beeper
|
||||
-> Program the beeper
|
||||
@@ -1,26 +0,0 @@
|
||||
ps3.h
|
||||
void ps3ResetGlobals();
|
||||
|
||||
ps3.c
|
||||
void ps3ResetGlobals() {
|
||||
// Own Code
|
||||
is_active = false;
|
||||
ps3_connection_cb = NULL;
|
||||
ps3_connection_object_cb = NULL;
|
||||
ps3_connection_object = NULL;
|
||||
ps3_event_cb = NULL;
|
||||
ps3_event_object_cb = NULL;
|
||||
ps3_event_object = NULL;
|
||||
}
|
||||
|
||||
Ps3Controller.h
|
||||
private
|
||||
void resetGlobals();
|
||||
|
||||
Ps3Controller.cpp
|
||||
void Ps3Controller::resetGlobals() {
|
||||
ps3ResetGlobals();
|
||||
}
|
||||
|
||||
in -> Ps3Controller::begin
|
||||
this->resetGlobals();
|
||||
@@ -1,30 +0,0 @@
|
||||
ESP32 Rover Pinbelegung
|
||||
|
||||
3V3 GND
|
||||
x 23 DirR1
|
||||
x 22 PWMR
|
||||
x TX PC
|
||||
x RX PC Connector I2C
|
||||
BATTERY 35 21 SDA SDA
|
||||
INTL1 32 GND GND
|
||||
INTL2 33 19 SCL SCL
|
||||
INTR1 25 18 VCC
|
||||
INTR2 26 5 SPI_CSK
|
||||
DirL1 27 17 SPI_CS
|
||||
DirR2 14 16 SPI_COPI
|
||||
DirL2 12 4 SPI_CIPO
|
||||
GND x
|
||||
PWML 13 2 Probleme beim flashen
|
||||
x 15 WS2812 LED ?
|
||||
x x
|
||||
CMD x
|
||||
5V USB x
|
||||
|
||||
|
||||
Connector Encoder
|
||||
|
||||
- 2 1 +
|
||||
OB 4 3 -
|
||||
3V3 6 [5] OA
|
||||
8 7
|
||||
10 9
|
||||
@@ -0,0 +1,45 @@
|
||||
Maybe:
|
||||
-> Time Measurement in component interface
|
||||
-> Time warnings
|
||||
-> Blocking Battery Function in Battery class
|
||||
- Callback function for output and shutdown things
|
||||
|
||||
Do later:
|
||||
-> Program underfloorLighting
|
||||
-> Add an beeper
|
||||
-> Program the beeper
|
||||
-> Engine slow down without curve in motorControl
|
||||
-> Network clean up (Mqtt remove?)
|
||||
-> Extra class for maneuver, autopilot should inherit from int16_t
|
||||
-> Remote Control
|
||||
- Leds for gnss rtk etc
|
||||
- what happens exactly when no data is arriving
|
||||
-> Test Menu for big curve driving
|
||||
-> Api with Names and show on Maps in Browser
|
||||
-> Menu structure mit add functions for each menu mit pointer return to config (additional not replace)
|
||||
-> Menu Display from parent as run() to make Menu as Component
|
||||
-> Racing Mode
|
||||
-> ConsolControl
|
||||
-> Menü für Einstellungen
|
||||
- WiFi (save in Flash)
|
||||
-> Battery
|
||||
- tabelle mit eigenen Werten übergeben und nicht in header (wiederverwendbarkeit)
|
||||
- kalibrierungsmethode mit Menü
|
||||
- Daten in flash speichern können
|
||||
-> Check speration between Ui and Route (RouteMenu)
|
||||
-> update sparkfun gnss auf v3 für SPI korrekturdatenüvbetragung
|
||||
-> Rover Objekt mit Error zustand freeze, damit das wenn möglich auch auf dem Display angezeigt wird.
|
||||
-> ESP und Sensoren in den DeepSleep für Auschalten oder Akkuschutz
|
||||
-> Doxygen comments
|
||||
- navigation
|
||||
- autopilot
|
||||
|
||||
Have to:
|
||||
-> check new distance calculation between points
|
||||
-> check new course calculation between points
|
||||
-> menu route data und ui disconnecten
|
||||
-> use routeCache in captureRoute and autopilot
|
||||
-> make ntrip client useable without user and password
|
||||
-> understand gyroscope offsets
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
Controller
|
||||
|
||||
PS3-Button: Change Mode
|
||||
|
||||
Mode: ManualControl
|
||||
L3: Joystick Mode
|
||||
Left Joystick: Drive
|
||||
|
||||
R3: Shoulder Trigger Mode
|
||||
L2: Spin left side
|
||||
R2: Spin right side
|
||||
|
||||
Mode: Autopilot
|
||||
|
||||
Mode: CaptureRoute
|
||||
|
||||
Mode: ConsolControl
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
// AUTO GENERATED FILE, DO NOT EDIT
|
||||
#ifndef VERSION
|
||||
#define VERSION "1.8.36"
|
||||
#endif
|
||||
#ifndef BUILD_TIMESTAMP
|
||||
#define BUILD_TIMESTAMP "2023-10-13 15:13:34.491991"
|
||||
#endif
|
||||
+63
-18
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file config.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Some defines to configere the project.
|
||||
* @brief Some defines to configure the project.
|
||||
* @version 0.1
|
||||
* @date 2022-02-15
|
||||
*
|
||||
@@ -9,27 +9,72 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief The MAC-Address saved in PS3-Controller
|
||||
*
|
||||
* The PS3-Controller only connects to the address which is saved in it.
|
||||
*/
|
||||
#define CONTROLLER_MAC "24:62:AB:F2:4B:3A"
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @brief Prevents creation of the global object
|
||||
* @brief The numbers of pins to be used
|
||||
*
|
||||
* The PS3-Controller class creates a global object to use.
|
||||
*/
|
||||
#define NO_GLOBAL_INSTANCES
|
||||
namespace PinNumbers
|
||||
{
|
||||
constexpr uint8_t spiCopi = 16;
|
||||
constexpr uint8_t spiCipo = 4;
|
||||
constexpr uint8_t spiSck = 5;
|
||||
constexpr uint8_t gnssSpiCs = 17;
|
||||
constexpr uint8_t sda = 21;
|
||||
constexpr uint8_t scl = 19;
|
||||
constexpr uint8_t battery = 35;
|
||||
|
||||
namespace LeftMotor
|
||||
{
|
||||
constexpr uint8_t dir1 = 27;
|
||||
constexpr uint8_t dir2 = 12;
|
||||
constexpr uint8_t pwm = 13;
|
||||
constexpr uint8_t encoder = 32;
|
||||
constexpr uint8_t pmwChannel = 0;
|
||||
}
|
||||
|
||||
namespace RightMotor
|
||||
{
|
||||
constexpr uint8_t dir1 = 14;
|
||||
constexpr uint8_t dir2 = 23;
|
||||
constexpr uint8_t pwm = 22;
|
||||
constexpr uint8_t encoder = 33;
|
||||
constexpr uint8_t pmwChannel = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @name SPI-Pins
|
||||
* @brief Pins for SPI communication with the gnss module
|
||||
* @brief Default values for different components
|
||||
*
|
||||
*/
|
||||
///@{
|
||||
#define UBLOX_GNSS_SPI_CS 17
|
||||
#define UBLOX_GNSS_SPI_COPI 16
|
||||
#define UBLOX_GNSS_SPI_CIPO 4
|
||||
#define UBLOX_GNSS_SPI_SCK 5
|
||||
///@}
|
||||
namespace Settings
|
||||
{
|
||||
constexpr uint32_t baudRate = 115200;
|
||||
constexpr uint32_t i2cSpeed = 400000;
|
||||
|
||||
constexpr float wheelDiameter = 0.105;
|
||||
constexpr float wheelDistance = 0.255;
|
||||
constexpr uint16_t encoderSteps = 384;
|
||||
|
||||
namespace Pid
|
||||
{
|
||||
namespace Left
|
||||
{
|
||||
constexpr uint8_t P = 5;
|
||||
constexpr uint8_t I = 0;
|
||||
constexpr uint8_t D = 0;
|
||||
}
|
||||
|
||||
namespace Right
|
||||
{
|
||||
constexpr uint8_t P = 5;
|
||||
constexpr uint8_t I = 0;
|
||||
constexpr uint8_t D = 0;
|
||||
}
|
||||
|
||||
constexpr int8_t outMin = -100;
|
||||
constexpr int8_t outMax = 100;
|
||||
constexpr uint8_t sampleTime = 30;
|
||||
}
|
||||
}
|
||||
|
||||
+149
-152
@@ -18,18 +18,19 @@
|
||||
|
||||
#include "motorControl.h"
|
||||
#include "speedometer.h"
|
||||
#include "moveControlConfig.h"
|
||||
#include "config.h"
|
||||
#include "debugTimes.h"
|
||||
#include "component.h"
|
||||
|
||||
/**
|
||||
* @brief used to set driving status
|
||||
*
|
||||
* When set to stop all motors are set to halt
|
||||
* @brief A struct to easy set the speed
|
||||
*
|
||||
*/
|
||||
enum DrivingStatus {stop,
|
||||
drive,
|
||||
raw};
|
||||
struct DrivingSpeeds
|
||||
{
|
||||
double x;
|
||||
double rot;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief This class manages the motors and the encoders
|
||||
@@ -39,169 +40,165 @@ enum DrivingStatus {stop,
|
||||
* given target speed to calculate a new duty cycle for the motors.
|
||||
*
|
||||
*/
|
||||
class MoveControl {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Move Control object
|
||||
*
|
||||
* Initialize the motors, encoders and PIDs with given
|
||||
* values in moveControlConfig.h
|
||||
*/
|
||||
MoveControl();
|
||||
class MoveControl : public Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Used to set driving status
|
||||
*
|
||||
* When set to stop all motors are set to halt
|
||||
*
|
||||
* When set to Raw the PIDs are not used. The target
|
||||
* values must be given withe setRawPowerLeft() and
|
||||
* setRawPowerRight().
|
||||
*
|
||||
* Drive is the normal working mode.
|
||||
*
|
||||
*/
|
||||
enum Status
|
||||
{
|
||||
Stop,
|
||||
Drive,
|
||||
Raw
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Destroy the Move Control object
|
||||
*
|
||||
* Stops the motors with emergencyStop()
|
||||
*/
|
||||
~MoveControl();
|
||||
/**
|
||||
* @brief Construct a new Move Control object
|
||||
*
|
||||
* Initialize the motors, encoders and PIDs with given
|
||||
* values in config.h
|
||||
*/
|
||||
MoveControl();
|
||||
|
||||
/**
|
||||
* @brief Calls runMoveControl() to update all Values.
|
||||
*
|
||||
* Besides that this function calls the loop() functions for the motors and encodes.
|
||||
* This function should be called every mainloop. If the delay is not reached, than the
|
||||
* functions returns immediately.
|
||||
* @see runMoveControl()
|
||||
* @see setDelay()
|
||||
*/
|
||||
void loop();
|
||||
/**
|
||||
* @brief Destroy the Move Control object
|
||||
*
|
||||
* Stops the motors with emergencyStop()
|
||||
*/
|
||||
~MoveControl();
|
||||
|
||||
/**
|
||||
* @brief Normally called repeatedly by loop() to calculate new values.
|
||||
*/
|
||||
void runMoveControl();
|
||||
/**
|
||||
* @brief Set the Status
|
||||
*
|
||||
* Control if this component should work normally or with
|
||||
* raw values for the motors.
|
||||
*
|
||||
* @see Status
|
||||
* @param status
|
||||
*/
|
||||
void setDrivingStatus(Status status);
|
||||
Status getDrivingStatus() const { return this->driving_status; }
|
||||
|
||||
/**
|
||||
* @brief Set the DrivingStatus
|
||||
*
|
||||
* @see DrivingStatus
|
||||
* @param status
|
||||
*/
|
||||
void setDrivingStatus(DrivingStatus status);
|
||||
/**
|
||||
* @brief Stops the engine immediately
|
||||
*
|
||||
*/
|
||||
void emergencyStop();
|
||||
|
||||
/**
|
||||
* @brief Set the target speed
|
||||
*
|
||||
* If the given speed is close to zero, then the
|
||||
* target speed is set to zero.
|
||||
* @param speed in m/s
|
||||
*/
|
||||
void setSpeed(double speed);
|
||||
/**
|
||||
* @brief Set the target speed
|
||||
*
|
||||
* If the given speed is close to zero, then the
|
||||
* target speed is set to zero.
|
||||
* @param speed in m/s
|
||||
*/
|
||||
void setSpeed(double speed);
|
||||
|
||||
/**
|
||||
* @brief Set the rotationspeed
|
||||
*
|
||||
* If the given rotationspeed is close to zero, then the
|
||||
* target rotationspeed is set to zero.
|
||||
* @param speed rad/s
|
||||
*/
|
||||
void setRotationSpeed(double speed);
|
||||
/**
|
||||
* @brief Set the rotationSpeed
|
||||
*
|
||||
* If the given rotationSpeed is close to zero, then the
|
||||
* target rotationSpeed is set to zero.
|
||||
* @param speed rad/s
|
||||
*/
|
||||
void setRotationSpeed(double speed);
|
||||
|
||||
/**
|
||||
* @brief Set Raw Power Left
|
||||
*
|
||||
* This value has only an effect if DrivingStatus is raw.
|
||||
*
|
||||
* @param power between -100 and 100
|
||||
*/
|
||||
void setRawPowerLeft(int16_t power);
|
||||
/**
|
||||
* @brief Set the speeds
|
||||
*
|
||||
* This function is a combination of the functions setSpeed() and
|
||||
* setRotationSpeed(). The struct DrivingSpeeds
|
||||
* is used for this.
|
||||
*
|
||||
*
|
||||
* @param drivingSpeeds
|
||||
*/
|
||||
void setSpeeds(DrivingSpeeds drivingSpeeds);
|
||||
|
||||
/**
|
||||
* @brief Set the Raw Power Right
|
||||
*
|
||||
* This value has only an effect if DrivingStatus is raw.
|
||||
*
|
||||
* @param power between -100 and 100
|
||||
*/
|
||||
void setRawPowerRight(int16_t power);
|
||||
/**
|
||||
* @brief Set raw power left
|
||||
*
|
||||
* This value has only an effect if the status is raw.
|
||||
* @see setDrivingStatus
|
||||
*
|
||||
* @param power between -100 and 100
|
||||
*/
|
||||
void setRawPowerLeft(int16_t power);
|
||||
|
||||
/**
|
||||
* @brief Set the pid tunings
|
||||
*
|
||||
* @param side 0 -> left, 1 -> right
|
||||
* @param p
|
||||
* @param i
|
||||
* @param d
|
||||
*/
|
||||
void setPidTunings(uint8_t side, double p, double i, double d);
|
||||
/**
|
||||
* @brief Set the raw power right
|
||||
*
|
||||
* This value has only an effect if status is raw.
|
||||
*
|
||||
* @param power between -100 and 100
|
||||
*/
|
||||
void setRawPowerRight(int16_t power);
|
||||
|
||||
/**
|
||||
* @brief Returns the PID object of the choosen side.
|
||||
*
|
||||
* @param side 0 -> left, 1 -> right
|
||||
* @return PID*
|
||||
*/
|
||||
PID* getPID(uint8_t side);
|
||||
/**
|
||||
* @brief Set the pid tunings
|
||||
*
|
||||
* @param side 0 -> left, 1 -> right
|
||||
* @param pPart
|
||||
* @param iPart
|
||||
* @param dPart
|
||||
*/
|
||||
void setPidTunings(uint8_t side, double pPart, double iPart, double dPart);
|
||||
|
||||
/**
|
||||
* @brief Get the Speedometer Left object
|
||||
*
|
||||
* @return Speedometer*
|
||||
*/
|
||||
Speedometer* getSpeedometerLeft() const { return this->left_speedometer; }
|
||||
/**
|
||||
* @brief Returns the PID object of the choosen side.
|
||||
*
|
||||
* @param side 0 -> left, 1 -> right
|
||||
* @return PID*
|
||||
*/
|
||||
PID *getPID(uint8_t side) const;
|
||||
|
||||
/**
|
||||
* @brief Get the Speedometer Right object
|
||||
*
|
||||
* @return Speedometer*
|
||||
*/
|
||||
Speedometer* getSpeedometerRight() const { return this->right_speedometer; }
|
||||
Speedometer *getSpeedometerLeft() const { return this->leftSpeedometer; }
|
||||
Speedometer *getSpeedometerRight() const { return this->rightSpeedometer; }
|
||||
|
||||
/**
|
||||
* @brief Set the min delay between each loop
|
||||
*
|
||||
* @param delay_ time in Milliseconds
|
||||
*/
|
||||
void setDelay(uint8_t delay) { this->delay = delay; }
|
||||
uint16_t getDutycycleLeft() const { return this->leftMotor->getDutycycle(); }
|
||||
uint16_t getDutycycleRight() const { return this->rightMotor->getDutycycle(); }
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Converts values into wheel speeds
|
||||
*
|
||||
* Converts target speed and target rotationspeed into
|
||||
* wheel speeds
|
||||
*/
|
||||
void calcTargetWheelSpeed();
|
||||
private:
|
||||
void run() override;
|
||||
static void setSpeedometerDirection(Speedometer *speedometer, double value);
|
||||
void calcTargetWheelSpeed();
|
||||
void regulateMotors();
|
||||
void updateCurrentWheelSpeed();
|
||||
|
||||
/**
|
||||
* @brief Set the target power to motors
|
||||
*
|
||||
* Checks if the driving_status is set to drive.
|
||||
* If yes, then the motors get the pid_out values as targetpower.
|
||||
* If no, then the motors target power is set to zero.
|
||||
*/
|
||||
void regulateMotors();
|
||||
MotorControl *leftMotor;
|
||||
MotorControl *rightMotor;
|
||||
Speedometer *leftSpeedometer;
|
||||
Speedometer *rightSpeedometer;
|
||||
PID *leftPid;
|
||||
PID *rightPid;
|
||||
|
||||
/**
|
||||
* @brief Updates the wheel speeds with speedometer
|
||||
*/
|
||||
void updateCurrentWheelSpeed();
|
||||
Status driving_status = Status::Stop;
|
||||
DrivingSpeeds drivingSpeeds = {0, 0};
|
||||
|
||||
MotorControl *left_motor;
|
||||
MotorControl *right_motor;
|
||||
Speedometer *left_speedometer;
|
||||
Speedometer *right_speedometer;
|
||||
PID *left_pid;
|
||||
PID *right_pid;
|
||||
double wheelspeedLeftTarget = 0;
|
||||
double wheelspeedRightTarget = 0;
|
||||
double wheelspeedLeft = 0;
|
||||
double wheelspeedRight = 0;
|
||||
double leftPidOut = 0;
|
||||
double rightPidOut = 0;
|
||||
|
||||
DrivingStatus driving_status = DrivingStatus::stop;
|
||||
uint8_t overTimeCounter = 0;
|
||||
uint8_t overTimeMax = 100;
|
||||
int8_t rawPowerLeft = 0;
|
||||
int8_t rawPowerRight = 0;
|
||||
|
||||
double x_speed = 0;
|
||||
double rotation_speed = 0;
|
||||
|
||||
double wheelspeed_left_target = 0;
|
||||
double wheelspeed_right_target = 0;
|
||||
double wheelspeed_left = 0;
|
||||
double wheelspeed_right = 0;
|
||||
double left_pid_out;
|
||||
double right_pid_out;
|
||||
|
||||
uint8_t delay = 20;
|
||||
uint8_t overTimeCounter = 0;
|
||||
uint8_t overTimeMax = 100;
|
||||
int8_t rawPowerLeft = 0;
|
||||
int8_t rawPowerRight = 0;
|
||||
uint32_t lastMillis = 0;
|
||||
static constexpr int8_t maxPercentage = 100;
|
||||
static constexpr float minSpeed = 0.2;
|
||||
static constexpr uint8_t loopDelay = 20;
|
||||
};
|
||||
#endif // MOVE_CONTROL_H
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/**
|
||||
* @file moveControlConfig.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief This file inherits some configurations for moveControl.h
|
||||
* @version 0.1
|
||||
* @date 2021-12-14
|
||||
*
|
||||
* @copyright Copyright (c) 2021
|
||||
*
|
||||
*/
|
||||
//Pin config
|
||||
//Left Motor
|
||||
#define M_DIR_11 12
|
||||
#define M_DIR_12 27
|
||||
#define M_PWM_1 13
|
||||
#define M_ENCODE_LEFT 26
|
||||
//Right Motor
|
||||
#define M_DIR_21 23
|
||||
#define M_DIR_22 14
|
||||
#define M_PWM_2 22
|
||||
#define M_ENCODE_RIGHT 12
|
||||
|
||||
// PID config
|
||||
#define PID_OUT_MIN -100
|
||||
#define PID_OUT_MAX 100
|
||||
#define PID_SAMPLETIME 30
|
||||
// Left PID
|
||||
#define PID_LEFT_P 75
|
||||
#define PID_LEFT_I 0
|
||||
#define PID_LEFT_D 0
|
||||
// Right PID
|
||||
#define PID_RIGHT_P 75
|
||||
#define PID_RIGHT_I 0
|
||||
#define PID_RIGHT_D 0
|
||||
|
||||
// PWM
|
||||
#define PWM_CHANNEL_M1 0
|
||||
#define PWM_CHANNEL_M2 1
|
||||
|
||||
// SPEEDOMETER
|
||||
#define WHEEL_DIAMETER 0.1263
|
||||
#define ENC_STEPS 2048
|
||||
@@ -1,94 +0,0 @@
|
||||
/**
|
||||
* @file network.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains the Network class.
|
||||
* @version 0.1
|
||||
* @date 2021-12-14
|
||||
*
|
||||
* @copyright Copyright (c) 2021
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef NETWORK_H
|
||||
#define NETWORK_H
|
||||
|
||||
#include <iostream>
|
||||
#include <WiFi.h>
|
||||
#include <PubSubClient.h>
|
||||
|
||||
#include "networkConfig.h"
|
||||
|
||||
/**
|
||||
* @brief This class handles all network stuff
|
||||
*
|
||||
* This class only inherits static functions and members and use
|
||||
* only the configuration data is given by networkConfig.h
|
||||
*
|
||||
*/
|
||||
class Network {
|
||||
public:
|
||||
/**
|
||||
* @brief Set the all IPs needed by this class
|
||||
*/
|
||||
static void setIps();
|
||||
|
||||
/**
|
||||
* @brief Establish a connection to the WiFi.
|
||||
*
|
||||
* @return true Wifi is connected
|
||||
* @return false Timeout
|
||||
*/
|
||||
static bool connectWifi();
|
||||
|
||||
/**
|
||||
* @brief Set all general settings to connect to a broker.
|
||||
*/
|
||||
static void setupMQTT();
|
||||
|
||||
/**
|
||||
* @brief Checks if mqtt is still connected
|
||||
*
|
||||
* If mqtt is not connect, this function try a reconnect
|
||||
* with the function connectMQTT. This function should be
|
||||
* called every mainloop.
|
||||
*
|
||||
* @return true if connected
|
||||
* @return false if not connected
|
||||
*/
|
||||
static bool checkMQTT();
|
||||
|
||||
/**
|
||||
* @brief Checks if WiFi is still connected
|
||||
*
|
||||
* If WiFi is not connected, this function try a reconnect.
|
||||
* This function should be called every mainloop.
|
||||
*/
|
||||
static void checkWiFi();
|
||||
|
||||
/**
|
||||
* @brief Get the Mqtt Client object
|
||||
*
|
||||
* @return PubSubClient*
|
||||
*/
|
||||
static PubSubClient* getMqttClient();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Tries a connect to the broker
|
||||
*
|
||||
* @return true if the connect attemp was successful
|
||||
* @return false if the connect attemp was unsuccessful
|
||||
*/
|
||||
static bool connectMQTT();
|
||||
|
||||
static IPAddress local_IP;
|
||||
static IPAddress gateway;
|
||||
static IPAddress subnet;
|
||||
static IPAddress mqtt_server;
|
||||
static IPAddress dnsServer;
|
||||
|
||||
static WiFiClient wifi_client;
|
||||
static PubSubClient* mqtt_client;
|
||||
};
|
||||
|
||||
#endif // NETWORK_H
|
||||
+68
-129
@@ -12,139 +12,78 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// General config
|
||||
#define MQTT_TIME_RECONNECT 2500
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief Wlan connect timeout
|
||||
*
|
||||
* This number multiplied by WLAN_CONNECT_LOOP_TIME is the
|
||||
* timeout in milliseconds.
|
||||
*/
|
||||
#define WLAN_CONNECT_TIMEOUT 20
|
||||
#define HOTSPOT
|
||||
|
||||
/**
|
||||
* @brief Wlan connect loop time
|
||||
*
|
||||
* The time in milliseconds until the next connection attempt.
|
||||
*/
|
||||
#define WLAN_CONNECT_LOOP_TIME 500
|
||||
#define WLAN_DNS_SERVER "8.8.8.8"
|
||||
|
||||
#define NTRIP_RTK2GO
|
||||
|
||||
// NTRIP config NRW
|
||||
#ifdef NTRIP_NRW
|
||||
#define NTRIP_HOST "www.sapos-nw-ntrip.de"
|
||||
#define NTRIP_PORT 2101
|
||||
#define NTRIP_MOUNT_POINT "VRS_3_3G_NW"
|
||||
#define NTRIP_USER "nw-916771"
|
||||
#define NTRIP_PASSWORD "Schalke#246"
|
||||
#endif // NTRIP_NRW
|
||||
|
||||
// NTRIP config NS
|
||||
#ifdef NTRIP_NS
|
||||
#define NTRIP_HOST "openservice-sapos.niedersachsen.de"
|
||||
#define NTRIP_PORT 2101
|
||||
#define NTRIP_MOUNT_POINT "VRS_3_2G_NI"
|
||||
#define NTRIP_USER "ni_FHDo01"
|
||||
#define NTRIP_PASSWORD "ALdx-1-3e49"
|
||||
#endif // NTRIP_NS
|
||||
|
||||
// NTRIP config RTK2Go
|
||||
#ifdef NTRIP_RTK2GO
|
||||
#define NTRIP_HOST "rtk2go.com"
|
||||
#define NTRIP_PORT 2101
|
||||
#define NTRIP_MOUNT_POINT "GER-Papenburg"
|
||||
#define NTRIP_USER "alklein1@gmx.de"
|
||||
#define NTRIP_PASSWORD "none"
|
||||
#endif // NTRIP_RTK2GO
|
||||
|
||||
|
||||
#define RHEDE
|
||||
|
||||
//Network config ESP32
|
||||
#ifdef ESP32BROKER
|
||||
#define WLAN_SSID "ESP32-Broker"
|
||||
#define WLAN_PASSWORD "doit2022"
|
||||
#define WLAN_IP "192.168.4.77"
|
||||
#define WLAN_SUBNETMASK "255.255.255.0"
|
||||
#define WLAN_GATEWAY "192.168.4.1"
|
||||
#define MQTT_SERVER "192.168.4.1"
|
||||
#define MQTT_PORT 1883
|
||||
#endif //ESP32BROKER
|
||||
|
||||
//Network config Hotspot
|
||||
#ifdef HOTSPOT
|
||||
#define WLAN_SSID "Kleiax Handy"
|
||||
#define WLAN_PASSWORD "12345677"
|
||||
#define WLAN_IP "192.168.43.4"
|
||||
#define WLAN_SUBNETMASK "255.255.128.0"
|
||||
#define WLAN_GATEWAY "192.168.43.1"
|
||||
// Only for defines reasons
|
||||
#define MQTT_SERVER "172.22.64.216"
|
||||
#define MQTT_PORT 1883
|
||||
#endif //HOTSPOT
|
||||
namespace NetworkConfig
|
||||
{
|
||||
const char ssid[] = "Nubsi";
|
||||
const char password[] = "12345677";
|
||||
const char ip[] = "192.168.72.7";
|
||||
const char subnet[] = "255.255.255.0";
|
||||
const char gateway[] = "192.168.72.228";
|
||||
const char dns[] = "8.8.8.8";
|
||||
const bool mqtt = false;
|
||||
}
|
||||
#endif // HOTSPOT
|
||||
|
||||
//Network config Rhede
|
||||
#ifdef RHEDE
|
||||
#define WLAN_SSID "LebennigHuus"
|
||||
#define WLAN_PASSWORD "Punica-699"
|
||||
#define WLAN_IP "192.168.11.4"
|
||||
#define WLAN_SUBNETMASK "255.255.128.0"
|
||||
#define WLAN_GATEWAY "192.168.0.1"
|
||||
#define MQTT
|
||||
#define MQTT_SERVER "192.168.1.7"
|
||||
#define MQTT_PORT 1883
|
||||
#define MQTT_AUTH
|
||||
#define MQTT_USER "kleiax"
|
||||
#define MQTT_PASSWORD "p?{$_~5%hBM7wrcFkr55KWr#"
|
||||
#endif //RHEDE
|
||||
|
||||
//Network config Doro
|
||||
#ifdef DORO
|
||||
#define WLAN_SSID "Tuedelkram"
|
||||
#define WLAN_PASSWORD "3Kaesehoch!"
|
||||
#define WLAN_IP "192.168.178.4"
|
||||
#define WLAN_SUBNETMASK "255.255.255.0"
|
||||
#define WLAN_GATEWAY "192.168.178.1"
|
||||
// Only for defines reasons
|
||||
#define MQTT_SERVER "172.22.64.216"
|
||||
#define MQTT_PORT 1883
|
||||
#endif //DORO
|
||||
|
||||
//Network config HW1
|
||||
#ifdef HW1
|
||||
#define WLAN_SSID "hw1_gast"
|
||||
#define WLAN_PASSWORD "KeineAhnung"
|
||||
#define WLAN_IP "192.168.0.67"
|
||||
#define WLAN_SUBNETMASK "255.255.255.0"
|
||||
#define WLAN_GATEWAY "192.168.0.1"
|
||||
#define MQTT
|
||||
#define MQTT_SERVER "172.22.64.216"
|
||||
#define MQTT_PORT 1883
|
||||
#endif //HW1
|
||||
namespace NetworkConfig
|
||||
{
|
||||
const char ssid[] = "hw1_gast";
|
||||
const char password[] = "KeineAhnung";
|
||||
const char ip[] = "192.168.0.4";
|
||||
const char subnet[] = "255.255.255.0";
|
||||
const char gateway[] = "192.168.0.1";
|
||||
const char dns[] = "8.8.8.8";
|
||||
const bool mqtt = false;
|
||||
}
|
||||
#endif // HW1
|
||||
|
||||
//Network config FRENZY
|
||||
#ifdef FRENZY
|
||||
#define WLAN_SSID "GNX7EDD84-2"
|
||||
#define WLAN_PASSWORD "2W2ZLPJ9NVQ3"
|
||||
#define WLAN_IP 0x0F01a8c0 //192.168.1.15
|
||||
#define WLAN_SUBNETMASK 0x00FFFFFF //255.255.255.0
|
||||
#define MQTT
|
||||
#define WLAN_GATEWAY 0xfe01a8c0 //192.168.1.254
|
||||
#define MQTT_SERVER 0x0201a8c0 //192.168.1.2
|
||||
#define MQTT_PORT 1883
|
||||
#endif //FRENZY
|
||||
// Network config Rhede
|
||||
#ifdef RHEDE
|
||||
namespace NetworkConfig
|
||||
{
|
||||
const char ssid[] = "LebennigHuus";
|
||||
const char password[] = "Punica-699";
|
||||
const char ip[] = "192.168.11.4";
|
||||
const char subnet[] = "255.255.128.0";
|
||||
const char gateway[] = "192.168.0.1";
|
||||
const char dns[] = "8.8.8.8";
|
||||
const bool mqtt = true;
|
||||
}
|
||||
#endif // RHEDE
|
||||
|
||||
//Network config TPMOBIL
|
||||
#ifdef TPMOBIL
|
||||
#define WLAN_SSID "TP-Mobil"
|
||||
#define WLAN_PASSWORD "Punica-699"
|
||||
#define WLAN_IP 0x0F01a8c0 //192.168.1.15
|
||||
#define WLAN_SUBNETMASK 0x00FFFFFF //255.255.255.0
|
||||
#define WLAN_GATEWAY 0x0101a8c0 //192.168.1.1
|
||||
#define MQTT
|
||||
#define MQTT_SERVER 0x0201a8c0 //192.168.1.2
|
||||
#define MQTT_PORT 1883
|
||||
#endif //TPMOBIL
|
||||
#ifdef ZUHAUSE
|
||||
namespace NetworkConfig
|
||||
{
|
||||
const char ssid[] = "Tuedelkram";
|
||||
const char password[] = "3!Kaesehoch";
|
||||
const char ip[] = "192.168.178.11";
|
||||
const char subnet[] = "255.255.255.0";
|
||||
const char gateway[] = "192.168.178.1";
|
||||
const char dns[] = "8.8.8.8";
|
||||
const bool mqtt = false;
|
||||
}
|
||||
#endif // ZUHAUSE
|
||||
|
||||
namespace MqttConfig
|
||||
{
|
||||
const char server[] = "192.168.1.7";
|
||||
const uint16_t port = 1883;
|
||||
const char user[] = "kleiax";
|
||||
const char password[] = "p?{$_~5%hBM7wrcFkr55KWr#";
|
||||
}
|
||||
|
||||
namespace NtripConfig
|
||||
{
|
||||
const char host[] = "rtk2go.com";
|
||||
const uint16_t port = 2101;
|
||||
const char mountPoint[] = "GER-Dortmund";
|
||||
// const char mountPoint[] = "GER-Papenburg";
|
||||
// const char mountPoint[] = "Rtkramerntrip";
|
||||
const char user[] = "alklein1@gmx.de";
|
||||
const char password[] = "none";
|
||||
}
|
||||
|
||||
+210
-42
@@ -11,61 +11,229 @@
|
||||
|
||||
#include "battery.h"
|
||||
|
||||
Battery::Battery(uint8_t pin, uint32_t r1, uint32_t r2) {
|
||||
this->pin = pin;
|
||||
this->r1 = r1;
|
||||
this->r2 = r2;
|
||||
this->calculateBatteryVoltage();
|
||||
Battery::Battery(uint8_t pin, uint32_t firstResistor, uint32_t secondResistor)
|
||||
: pin{pin}, firstResistor{firstResistor}, secondResistor{secondResistor},
|
||||
batteryVoltageFactor{firstResistor + secondResistor / static_cast<double>(secondResistor)}
|
||||
{
|
||||
this->initBuffer();
|
||||
Component::loopDelay = Battery::loopDelay;
|
||||
}
|
||||
|
||||
void Battery::loop() {
|
||||
if (millis() - this->lastMillis < this->delay)
|
||||
Battery::Battery(uint8_t pin)
|
||||
: pin{pin}
|
||||
{
|
||||
this->initBuffer();
|
||||
Component::loopDelay = Battery::loopDelay;
|
||||
}
|
||||
|
||||
void Battery::run()
|
||||
{
|
||||
if (this->calibrationState != CalibrationState::None)
|
||||
{
|
||||
this->runCalibration();
|
||||
return;
|
||||
}
|
||||
|
||||
this->calculateBatteryVoltage();
|
||||
this->calculateBatteryPercent();
|
||||
this->readAdcToBuf();
|
||||
this->loopCounter++;
|
||||
|
||||
this->lastMillis = millis();
|
||||
if (this->loopCounter >= this->calculateDelayMultiplier)
|
||||
{
|
||||
this->calculateBatteryVoltage();
|
||||
this->calculateBatteryPercent();
|
||||
this->loopCounter = 0;
|
||||
this->calculatedNewValues = true;
|
||||
}
|
||||
}
|
||||
|
||||
double Battery::getBatteryVoltage() {
|
||||
double res = this->batteryVoltage;
|
||||
return (int)(res*100+0.5)/100.0;
|
||||
void Battery::runCalibration()
|
||||
{
|
||||
if (this->calibrationState != CalibrationState::Reading)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->readAdcToBuf();
|
||||
if (this->bufferPos == 0)
|
||||
{
|
||||
const uint16_t res = this->getBufAvg();
|
||||
this->newRawAdcVoltages[this->currentCalibrationVoltage] = res;
|
||||
std::cout << "Index: "
|
||||
<< (int)this->currentCalibrationVoltage
|
||||
<< " Value: "
|
||||
<< (int)res
|
||||
<< std::endl;
|
||||
this->currentCalibrationVoltage++;
|
||||
this->calibrationState = CalibrationState::Waiting;
|
||||
|
||||
if (this->currentCalibrationVoltage == Battery::rawAdcVoltagesCount)
|
||||
{
|
||||
this->calibrationState = CalibrationState::Finished;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double Battery::readInputVoltage() {
|
||||
double Battery::getBatteryVoltage() const
|
||||
{
|
||||
return static_cast<int>((this->batteryVoltage * 100 + 0.5)) / 100.0;
|
||||
}
|
||||
|
||||
bool Battery::isBatteryLow(double voltage) const
|
||||
{
|
||||
if (this->getBatteryVoltage() <= voltage && this->batteryVoltage > this->absurdLowVoltage)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Battery::isNewValue()
|
||||
{
|
||||
if (!this->calculatedNewValues)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this->calculatedNewValues = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Battery::nextVoltageIsReady()
|
||||
{
|
||||
if (this->calibrationState == CalibrationState::Waiting)
|
||||
{
|
||||
this->calibrationState = CalibrationState::Reading;
|
||||
}
|
||||
}
|
||||
|
||||
void Battery::startCalibration()
|
||||
{
|
||||
this->calibrationState = CalibrationState::Waiting;
|
||||
this->currentCalibrationVoltage = 0;
|
||||
this->bufferPos = 0;
|
||||
Component::loopDelay = Battery::loopDelay / 2;
|
||||
this->newRawAdcVoltages = new uint16_t[Battery::rawAdcVoltagesCount];
|
||||
}
|
||||
|
||||
void Battery::finishCalibration()
|
||||
{
|
||||
if (this->calibrationState != CalibrationState::None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
delete[] this->newRawAdcVoltages;
|
||||
this->calibrationState = CalibrationState::None;
|
||||
Component::loopDelay = Battery::loopDelay;
|
||||
}
|
||||
|
||||
double Battery::calculateInputVoltage()
|
||||
{
|
||||
// Reference voltage is 3v3 so maximum reading is 3v3 = 4095 in range 0 to 4095
|
||||
double reading = analogRead(this->pin);
|
||||
if(reading < 1 || reading > 4095) return 0;
|
||||
return - 0.000000000000016 * pow(reading,4)
|
||||
+ 0.000000000118171 * pow(reading,3)
|
||||
- 0.000000301211691 * pow(reading,2)
|
||||
+ 0.001109019271794 * reading
|
||||
+ 0.034143524634089;
|
||||
double reading = this->getBufAvg();
|
||||
if (reading < 1 || reading > Battery::adcMaxValue)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -this->adcCurveCoefficient[0] * pow(reading, 4) + this->adcCurveCoefficient[1] * pow(reading, 3) - this->adcCurveCoefficient[2] * pow(reading, 2) + this->adcCurveCoefficient[3] * reading + this->adcCurveCoefficient[4];
|
||||
}
|
||||
|
||||
void Battery::calculateBatteryVoltage() {
|
||||
this->batteryVoltage = (readInputVoltage() * (double) (this->r1 + this->r2)) / (double) this->r2;
|
||||
}
|
||||
void Battery::calculateBatteryVoltage()
|
||||
{
|
||||
if (this->firstResistor && this->secondResistor)
|
||||
{
|
||||
this->batteryVoltage = this->calculateInputVoltage() * this->batteryVoltageFactor;
|
||||
return;
|
||||
}
|
||||
|
||||
void Battery::calculateBatteryPercent() {
|
||||
int8_t size = sizeof(this->capacityVoltages) / sizeof(*this->capacityVoltages);
|
||||
uint8_t i;
|
||||
for (i = 0; i < size; i++) {
|
||||
if (this->batteryVoltage <= this->capacityVoltages[i])
|
||||
const uint16_t adcValue = this->getBufAvg();
|
||||
if (adcValue < this->rawAdcVoltages[0])
|
||||
{
|
||||
this->batteryVoltage = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t index = 1;
|
||||
for (; index < this->rawAdcVoltagesCount; index++)
|
||||
{
|
||||
if (adcValue < this->rawAdcVoltages[index])
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
if (this->batteryVoltage > 6)
|
||||
std::cout << "Critical low battery!" << std::endl;
|
||||
} else if (i == size - 1) {
|
||||
|
||||
} else {
|
||||
double diffToLowerVal = this->batteryVoltage - this->capacityVoltages[i - 1];
|
||||
double diffToHigherVal = this->capacityVoltages[i] - this->batteryVoltage;
|
||||
if (diffToLowerVal > diffToHigherVal)
|
||||
i--;
|
||||
}
|
||||
this->batteryPercent = i * (100 / (size - 1));
|
||||
const double indexDelta = this->rawAdcVoltages[index] - this->rawAdcVoltages[index - 1];
|
||||
const double valueDelta = this->rawAdcVoltages[index] - adcValue;
|
||||
double voltage = this->startVoltage + (index - 1) * this->stepVoltage;
|
||||
voltage += valueDelta / indexDelta * this->stepVoltage;
|
||||
this->batteryVoltage = voltage;
|
||||
}
|
||||
|
||||
void Battery::calculateBatteryPercent()
|
||||
{
|
||||
int8_t size = sizeof(this->capacityVoltages) / sizeof(*this->capacityVoltages);
|
||||
uint8_t index = 0;
|
||||
for (; index < size; index++)
|
||||
{
|
||||
if (this->batteryVoltage <= this->capacityVoltages[index])
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (index == 0)
|
||||
{
|
||||
if (this->batteryVoltage > this->absurdLowVoltage)
|
||||
{
|
||||
std::cout << "Critical low battery!" << std::endl;
|
||||
}
|
||||
}
|
||||
else if (index == size - 1)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
const double diffToLowerVal = this->batteryVoltage - this->capacityVoltages[index - 1];
|
||||
const double diffToHigherVal = this->capacityVoltages[index] - this->batteryVoltage;
|
||||
if (diffToLowerVal > diffToHigherVal)
|
||||
{
|
||||
index--;
|
||||
}
|
||||
}
|
||||
this->batteryPercent = index * (100 / (size - 1));
|
||||
}
|
||||
|
||||
void Battery::readAdcToBuf()
|
||||
{
|
||||
this->adcBuffer[this->bufferPos] = analogRead(this->pin);
|
||||
this->bufferPos++;
|
||||
if (this->bufferPos == Battery::bufferSize)
|
||||
{
|
||||
this->bufferPos = 0;
|
||||
}
|
||||
|
||||
// std::cout << "Battery::readAdcToBuf added Value: " << this->adcBuffer[this->bufferPos] << std::endl;
|
||||
}
|
||||
|
||||
void Battery::initBuffer()
|
||||
{
|
||||
for (uint8_t i = 0; i < Battery::bufferSize; i++)
|
||||
{
|
||||
this->adcBuffer[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t Battery::getBufAvg() const
|
||||
{
|
||||
uint32_t res = 0;
|
||||
uint8_t emptyPos = 0;
|
||||
for (uint8_t i = 0; i < Battery::bufferSize; i++)
|
||||
{
|
||||
if (this->adcBuffer[i] == 0)
|
||||
{
|
||||
emptyPos++;
|
||||
}
|
||||
res += this->adcBuffer[i];
|
||||
}
|
||||
return res / (Battery::bufferSize - emptyPos);
|
||||
}
|
||||
|
||||
+168
-63
@@ -9,89 +9,194 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AKKU_H
|
||||
#define AKKU_H
|
||||
#ifndef BATTERY_H
|
||||
#define BATTERY_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "component.h"
|
||||
|
||||
/**
|
||||
* @brief A class for battery monitoring
|
||||
*
|
||||
* This class reads the voltage from an analog pin to calculate the
|
||||
* charge level of a 3 Cell Li-Poly battery pack. The battery pack have
|
||||
* to be after a voltage diveder, so that maximum voltage for the
|
||||
* to be after a voltage divider, so that maximum voltage for the
|
||||
* microcontroller is 3.3 Volt.
|
||||
*/
|
||||
class Battery {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Battery object
|
||||
*
|
||||
* The voltage devider have to be calculated, so that the input
|
||||
* voltage from 3.3 Volt is never exceeded. It is assumed that
|
||||
* the microcontroller is connected to the second resistor.
|
||||
*
|
||||
* @param pin The analog to read from.
|
||||
* @param r1 First resistor of the voltage devider.
|
||||
* @param r2 Second resistor of the voltage devider.
|
||||
*/
|
||||
Battery(uint8_t pin, uint32_t r1, uint32_t r2);
|
||||
class Battery : public Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief States when the calibration modes is active
|
||||
*
|
||||
* - None means that no calibration is running
|
||||
* - Reading means that the adc takes multiple values to calculate an average
|
||||
* - Waiting means that the user has to set the new wanted voltage
|
||||
* - Finished means that all measurements was taken
|
||||
*/
|
||||
enum CalibrationState
|
||||
{
|
||||
None,
|
||||
Reading,
|
||||
Waiting,
|
||||
Finished
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Read new values if the delay is reached.
|
||||
*/
|
||||
void loop();
|
||||
/**
|
||||
* @brief Construct a new Battery object
|
||||
*
|
||||
* The voltage divider have to be calculated, so that the input
|
||||
* voltage from 3.3 Volt is never exceeded. It is assumed that
|
||||
* the microcontroller is connected to the second resistor.
|
||||
*
|
||||
* @param pin The analog to read from.
|
||||
* @param firstResistor First resistor of the voltage divider.
|
||||
* @param secondResistor Second resistor of the voltage divider.
|
||||
*/
|
||||
Battery(uint8_t pin, uint32_t firstResistor, uint32_t secondResistor);
|
||||
|
||||
/**
|
||||
* @brief Set the delay to wait befor new values are read
|
||||
*
|
||||
* @param delay in milliseconds
|
||||
*/
|
||||
void setDelay(uint16_t delay) {this->delay = delay; }
|
||||
/**
|
||||
* @brief Construct a new Battery object
|
||||
*
|
||||
* With this constructor the real voltage is not calculated with the
|
||||
* voltage divider but with a table which contains the raw reading from
|
||||
* the adc mapped to a specific voltage
|
||||
*
|
||||
* @param pin
|
||||
*/
|
||||
Battery(uint8_t pin);
|
||||
|
||||
/**
|
||||
* @brief Get the delay to wait befor new values are read
|
||||
*
|
||||
* @return uint16_t delay in milliseconds
|
||||
*/
|
||||
uint16_t getDelay() {return this->delay; }
|
||||
/**
|
||||
* @brief Get the battery voltage
|
||||
*
|
||||
* @return double in Volt
|
||||
*/
|
||||
double getBatteryVoltage() const;
|
||||
|
||||
/**
|
||||
* @brief Get the battery voltage
|
||||
*
|
||||
* @return double in Volt
|
||||
*/
|
||||
double getBatteryVoltage();
|
||||
/**
|
||||
* @brief Get the charge level of the battery
|
||||
*
|
||||
* @return uint8_t charge level in percent
|
||||
*/
|
||||
uint8_t getBatteryPercent() const { return this->batteryPercent; }
|
||||
|
||||
/**
|
||||
* @brief Get the charge level of the battery
|
||||
*
|
||||
* @return uint8_t charge level in percent
|
||||
*/
|
||||
uint8_t getBatteryPercent() {return this->batteryPercent;}
|
||||
/**
|
||||
* @brief Checks if the battery is low.
|
||||
*
|
||||
* The function will also return false if the battery voltage is
|
||||
* absurd low. This is for the case that the uController is powered
|
||||
* by usb and no battery is connected.
|
||||
*
|
||||
* @param voltage the limit the battery have to
|
||||
* @return true if the battery is low
|
||||
* @return false if the battery is high
|
||||
*/
|
||||
bool isBatteryLow(double voltage) const;
|
||||
|
||||
private:
|
||||
double readInputVoltage();
|
||||
void calculateBatteryVoltage();
|
||||
void calculateBatteryPercent();
|
||||
/**
|
||||
* @brief Check if a new voltage was been calculated
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool isNewValue();
|
||||
|
||||
uint8_t pin;
|
||||
uint8_t batteryPercent;
|
||||
uint16_t delay = 20000;
|
||||
uint32_t r1;
|
||||
uint32_t r2;
|
||||
uint64_t lastMillis = 0;
|
||||
double batteryVoltage;
|
||||
// Calibration
|
||||
CalibrationState getCalibrationState() const { return this->calibrationState; }
|
||||
|
||||
const float capacityVoltages[21] = {9.82, 10.83, 11.06, 11.12, // 0 5 10 15
|
||||
11.18, 11.24, 11.3, 11.36, // 20 25 30 35
|
||||
11.39, 11.45, 11.51, 11.56, // 40 45 50 55
|
||||
11.62, 11.74, 11.86, 11.95, // 60 65 70 75
|
||||
12.07, 12.25, 12.33, 12.45, // 80 85 90 95
|
||||
12.6 };
|
||||
/**
|
||||
* @brief Get the current calibration voltage target
|
||||
*
|
||||
* The returned value stand for the index of the table for this reason
|
||||
* the real value have to be calculated. After the returned voltage has been set
|
||||
* you have to call nextVoltageIsReady().
|
||||
*
|
||||
* @return uint8_t voltage multiply with 0,1 and add 7
|
||||
*/
|
||||
uint8_t getCurrentCalibrationVoltage() const { return this->currentCalibrationVoltage; }
|
||||
|
||||
/**
|
||||
* @brief Read next wanted voltage
|
||||
*
|
||||
* If this function is called, the calibration mode reads the new voltage
|
||||
* and save the value in the table.
|
||||
*/
|
||||
void nextVoltageIsReady();
|
||||
|
||||
/**
|
||||
* @brief Calibrate the battery readings
|
||||
*
|
||||
* This calibration has only an effect if the Component
|
||||
* uses the table with the raw adc values. The calibration gives
|
||||
* the user different voltages that have to be set with a
|
||||
* laboratory power supply. The power supply have to be connected
|
||||
* instead of the battery.
|
||||
*/
|
||||
void startCalibration();
|
||||
|
||||
/**
|
||||
* @brief abort the calibration
|
||||
*/
|
||||
void finishCalibration();
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
void runCalibration();
|
||||
double calculateInputVoltage();
|
||||
void calculateBatteryVoltage();
|
||||
void calculateBatteryPercent();
|
||||
void readAdcToBuf();
|
||||
void initBuffer();
|
||||
uint16_t getBufAvg() const;
|
||||
|
||||
static constexpr uint8_t bufferSize = 30;
|
||||
static constexpr uint8_t loopDelay = 100;
|
||||
static constexpr uint16_t adcMaxValue = 4095;
|
||||
|
||||
CalibrationState calibrationState = CalibrationState::None;
|
||||
|
||||
uint8_t absurdLowVoltage = 5;
|
||||
uint8_t pin;
|
||||
uint8_t batteryPercent = 0;
|
||||
uint8_t batteryLowPercent = 10;
|
||||
uint8_t bufferPos = 0;
|
||||
uint8_t calculateDelayMultiplier = 5;
|
||||
uint8_t loopCounter = 0;
|
||||
uint8_t currentCalibrationVoltage = 0; // *0.1 + 7
|
||||
uint16_t adcBuffer[bufferSize];
|
||||
uint16_t *newRawAdcVoltages = nullptr;
|
||||
uint32_t firstResistor = 0;
|
||||
uint32_t secondResistor = 0;
|
||||
bool calculatedNewValues = false;
|
||||
double batteryVoltage = 0;
|
||||
double batteryVoltageFactor;
|
||||
|
||||
const float capacityVoltages[21] = {9.82, 10.83, 11.06, 11.12, // 0 5 10 15
|
||||
11.18, 11.24, 11.3, 11.36, // 20 25 30 35
|
||||
11.39, 11.45, 11.51, 11.56, // 40 45 50 55
|
||||
11.62, 11.74, 11.86, 11.95, // 60 65 70 75
|
||||
12.07, 12.25, 12.33, 12.45, // 80 85 90 95
|
||||
12.6};
|
||||
|
||||
static constexpr uint8_t rawAdcVoltagesCount = 60;
|
||||
const double startVoltage = 7;
|
||||
const double stepVoltage = 0.1;
|
||||
const uint16_t rawAdcVoltages[rawAdcVoltagesCount] = // from 7.0V to 12.9V in 0.1V steps
|
||||
{1992, 2021, 2056, 2090, 2118, 2145, 2177, 2208, 2241, 2272,
|
||||
2298, 2331, 2362, 2387, 2420, 2453, 2482, 2514, 2543, 2577,
|
||||
2607, 2640, 2670, 2703, 2736, 2763, 2794, 2826, 2858, 2890,
|
||||
2920, 2956, 2983, 3019, 3054, 3088, 3121, 3158, 3189, 3226,
|
||||
3264, 3300, 3339, 3379, 3414, 3453, 3500, 3544, 3598, 3636,
|
||||
3682, 3730, 3781, 3837, 3887, 3943, 3997, 4054, 4093, 4095};
|
||||
const double adcCurveCoefficient[5] = {0.000000000000016,
|
||||
0.000000000118171,
|
||||
0.000000301211691,
|
||||
0.001109019271794,
|
||||
0.034143524634089};
|
||||
};
|
||||
|
||||
#endif // AKKU_H
|
||||
#endif // BATTERY_H
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/**
|
||||
* @file calcAzimuth.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-03
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "calcAzimuth.h"
|
||||
|
||||
CalcAzimuth::CalcAzimuth(Point point)
|
||||
: lastChangePoint{point}, currentPosition{point}
|
||||
{
|
||||
Component::loopDelay = CalcAzimuth::loopDelay;
|
||||
}
|
||||
|
||||
void CalcAzimuth::drivingDirectionChange(Point point)
|
||||
{
|
||||
if (point.isInit() && point.isValid())
|
||||
{
|
||||
this->directionChangeMode = true;
|
||||
this->lastChangePoint = point;
|
||||
this->state = State::Invalid;
|
||||
}
|
||||
}
|
||||
|
||||
void CalcAzimuth::updateCurrentPosition(Point point)
|
||||
{
|
||||
this->currentPosition = point;
|
||||
this->positionChanged = true;
|
||||
}
|
||||
|
||||
String CalcAzimuth::stateToString(State state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case State::Invalid:
|
||||
return "Invalid";
|
||||
|
||||
case State::Bad:
|
||||
return "Bad";
|
||||
|
||||
case State::Ok:
|
||||
return "Ok";
|
||||
|
||||
case State::Good:
|
||||
return "Good";
|
||||
|
||||
case State::Super:
|
||||
return "Super";
|
||||
|
||||
default:
|
||||
return "UNKOWN";
|
||||
}
|
||||
}
|
||||
|
||||
void CalcAzimuth::run()
|
||||
{
|
||||
if (!this->positionChanged)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->positionChanged = false;
|
||||
this->updateAzimuth();
|
||||
}
|
||||
|
||||
void CalcAzimuth::updateAzimuth()
|
||||
{
|
||||
if (!this->directionChangeMode || this->lastChangePoint.distanceTo(this->currentPosition) < 1.0)
|
||||
{
|
||||
this->state = State::Invalid;
|
||||
this->calcAzimuth = INT16_MIN;
|
||||
return;
|
||||
}
|
||||
|
||||
this->calcAzimuth = this->lastChangePoint.courseTo(this->currentPosition);
|
||||
|
||||
// Map point accuracy to State
|
||||
if (this->lastChangePoint.getAccuracy() == Point::Accuracy::oneDigOfCM || this->currentPosition.getAccuracy() == Point::Accuracy::oneDigOfCM)
|
||||
{
|
||||
this->state = State::Good;
|
||||
}
|
||||
else if (this->lastChangePoint.getAccuracy() == Point::Accuracy::twoDigOfCM || this->currentPosition.getAccuracy() == Point::Accuracy::twoDigOfCM)
|
||||
{
|
||||
this->state = State::Ok;
|
||||
}
|
||||
else if (this->lastChangePoint.getAccuracy() == Point::Accuracy::threeDigOfCM || this->currentPosition.getAccuracy() == Point::Accuracy::threeDigOfCM)
|
||||
{
|
||||
this->state = State::Bad;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->state = State::Invalid;
|
||||
}
|
||||
|
||||
// Upgrade quality if the range grows up
|
||||
if (this->lastChangePoint.distanceTo(this->currentPosition) > this->minDistanceForBetterQuality)
|
||||
{
|
||||
switch (this->state)
|
||||
{
|
||||
case State::Bad:
|
||||
this->state = State::Ok;
|
||||
break;
|
||||
|
||||
case State::Ok:
|
||||
this->state = State::Good;
|
||||
break;
|
||||
|
||||
case State::Good:
|
||||
this->state = State::Super;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* @file calcAzimuth.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a class that calculates the azimuth from a last and a current position
|
||||
* @version 0.1
|
||||
* @date 2023-09-03
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CALC_AZIMUTH_H
|
||||
#define CALC_AZIMUTH_H
|
||||
|
||||
#include "component.h"
|
||||
#include "point.h"
|
||||
|
||||
/**
|
||||
* @brief A class to calculate an azimuth
|
||||
*
|
||||
* This class calculates the current Azimuth with the last position
|
||||
* where the rover has been rotated and the current position
|
||||
*/
|
||||
class CalcAzimuth : public Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief States which represent the quality of the current calculated azimuth
|
||||
*/
|
||||
enum State
|
||||
{
|
||||
Invalid,
|
||||
Bad,
|
||||
Ok,
|
||||
Good,
|
||||
Super
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Construct a new Calc Azimuth object
|
||||
*
|
||||
* @param point current position
|
||||
*/
|
||||
CalcAzimuth(Point point);
|
||||
|
||||
/**
|
||||
* @brief Have to be called if the rover rotates
|
||||
*
|
||||
* @param point current position
|
||||
*/
|
||||
void drivingDirectionChange(Point point);
|
||||
|
||||
/**
|
||||
* @brief update the current position
|
||||
*
|
||||
* This function should be called if the rover has moved in
|
||||
* a straight direction, to calculated the current Azimuth.
|
||||
* More distance to the point given to drivingDirectionChange()
|
||||
* increase the accuracy of the calculation.
|
||||
*
|
||||
* @param point current position
|
||||
*/
|
||||
void updateCurrentPosition(Point point);
|
||||
void disableCalcAzimuth() { this->directionChangeMode = false; }
|
||||
|
||||
int16_t getAzimuth() const { return this->calcAzimuth; }
|
||||
|
||||
/**
|
||||
* @brief Get the State struct
|
||||
*
|
||||
* @return State current quality of the calculation
|
||||
*/
|
||||
State getState() const { return this->state; }
|
||||
|
||||
static String stateToString(State state);
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
void updateAzimuth();
|
||||
|
||||
State state = State::Invalid;
|
||||
Point lastChangePoint;
|
||||
Point currentPosition;
|
||||
|
||||
bool positionChanged = false;
|
||||
bool directionChangeMode = false;
|
||||
int16_t calcAzimuth = INT16_MAX;
|
||||
double minDistanceForBetterQuality = 2;
|
||||
|
||||
static constexpr uint8_t loopDelay = 50;
|
||||
};
|
||||
|
||||
#endif // CALC_AZIMUTH_H
|
||||
@@ -0,0 +1,206 @@
|
||||
/**
|
||||
* @file calibrateCompass.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-05-23
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "calibrateCompass.h"
|
||||
|
||||
CalibrateCompass::CalibrateCompass(QMC5883LCompass *compass)
|
||||
: compass{compass}
|
||||
{
|
||||
this->state = State::Ready;
|
||||
this->clearData();
|
||||
this->activateOnlyChilds();
|
||||
}
|
||||
|
||||
void CalibrateCompass::runAsChild()
|
||||
{
|
||||
if (this->state != State::Calibrating)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
|
||||
this->compass->read();
|
||||
const int xAxis = this->compass->getX();
|
||||
const int yAxis = this->compass->getY();
|
||||
const int zAxis = this->compass->getZ();
|
||||
|
||||
if (xAxis < this->data.data[0][0])
|
||||
{
|
||||
this->data.data[0][0] = xAxis;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (xAxis > this->data.data[0][1])
|
||||
{
|
||||
this->data.data[0][1] = xAxis;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (yAxis < this->data.data[1][0])
|
||||
{
|
||||
this->data.data[1][0] = yAxis;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (yAxis > this->data.data[1][1])
|
||||
{
|
||||
this->data.data[1][1] = yAxis;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (zAxis < this->data.data[2][0])
|
||||
{
|
||||
this->data.data[2][0] = zAxis;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (zAxis > this->data.data[2][1])
|
||||
{
|
||||
this->data.data[2][1] = zAxis;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed)
|
||||
{
|
||||
this->lastChange = millis();
|
||||
}
|
||||
|
||||
if (millis() - this->lastChange > this->maxTimeWithoutChange)
|
||||
{
|
||||
this->state = State::Finished;
|
||||
this->checkDataValidity();
|
||||
}
|
||||
}
|
||||
|
||||
void CalibrateCompass::run() {}
|
||||
|
||||
void CalibrateCompass::start()
|
||||
{
|
||||
if (this->state != State::Ready)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->clearData();
|
||||
this->state = State::Calibrating;
|
||||
this->compass->clearCalibration();
|
||||
this->lastChange = millis();
|
||||
}
|
||||
|
||||
void CalibrateCompass::useData()
|
||||
{
|
||||
if (!this->dataValid)
|
||||
{
|
||||
std::cout << "CalibrateCompass::useData - Data not valid" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
this->compass->setCalibration(this->data.data[0][0],
|
||||
this->data.data[0][1],
|
||||
this->data.data[1][0],
|
||||
this->data.data[1][1],
|
||||
this->data.data[2][0],
|
||||
this->data.data[2][1]);
|
||||
|
||||
std::cout << "CalibrateCompass::useData " << *this << std::endl;
|
||||
}
|
||||
|
||||
void CalibrateCompass::removeCalibration()
|
||||
{
|
||||
this->compass->clearCalibration();
|
||||
}
|
||||
|
||||
void CalibrateCompass::reset()
|
||||
{
|
||||
this->clearData();
|
||||
this->state = State::Ready;
|
||||
}
|
||||
|
||||
void CalibrateCompass::saveData()
|
||||
{
|
||||
if (!this->dataValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Preferences preferences;
|
||||
preferences.begin("compass", false);
|
||||
|
||||
preferences.putInt("xLow", this->data.data[0][0]);
|
||||
preferences.putInt("xHigh", this->data.data[0][1]);
|
||||
preferences.putInt("yLow", this->data.data[1][0]);
|
||||
preferences.putInt("yHigh", this->data.data[1][1]);
|
||||
preferences.putInt("zLow", this->data.data[2][0]);
|
||||
preferences.putInt("zHigh", this->data.data[2][1]);
|
||||
|
||||
preferences.end();
|
||||
}
|
||||
|
||||
void CalibrateCompass::loadData()
|
||||
{
|
||||
Preferences preferences;
|
||||
preferences.begin("compass", true);
|
||||
|
||||
this->data.data[0][0] = preferences.getInt("xLow", 0);
|
||||
this->data.data[0][1] = preferences.getInt("xHigh", 0);
|
||||
this->data.data[1][0] = preferences.getInt("yLow", 0);
|
||||
this->data.data[1][1] = preferences.getInt("yHigh", 0);
|
||||
this->data.data[2][0] = preferences.getInt("zLow", 0);
|
||||
this->data.data[2][1] = preferences.getInt("zHigh", 0);
|
||||
|
||||
preferences.end();
|
||||
this->checkDataValidity();
|
||||
}
|
||||
|
||||
void CalibrateCompass::clearData()
|
||||
{
|
||||
for (uint8_t i = 0; i < 3; i++)
|
||||
{
|
||||
this->data.data[i][0] = 0;
|
||||
this->data.data[i][1] = 0;
|
||||
}
|
||||
this->dataValid = false;
|
||||
}
|
||||
|
||||
void CalibrateCompass::checkDataValidity()
|
||||
{
|
||||
int sum = 0;
|
||||
for (uint8_t i = 0; i < 3; i++)
|
||||
{
|
||||
if (this->data.data[i][0] > INT16_MAX || this->data.data[i][0] < INT16_MIN || this->data.data[i][1] > INT16_MAX || this->data.data[i][1] < INT16_MIN)
|
||||
{
|
||||
this->dataValid = false;
|
||||
return;
|
||||
}
|
||||
sum += this->data.data[i][0];
|
||||
sum += this->data.data[i][1];
|
||||
}
|
||||
this->dataValid = static_cast<bool>(sum);
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &stream, const CalibrateCompass &caliComp)
|
||||
{
|
||||
stream << "(";
|
||||
stream << caliComp.data.data[0][0];
|
||||
stream << ", ";
|
||||
stream << caliComp.data.data[0][1];
|
||||
stream << ", ";
|
||||
stream << caliComp.data.data[1][0];
|
||||
stream << ", ";
|
||||
stream << caliComp.data.data[1][1];
|
||||
stream << ", ";
|
||||
stream << caliComp.data.data[2][0];
|
||||
stream << ", ";
|
||||
stream << caliComp.data.data[2][1];
|
||||
stream << ")";
|
||||
return stream;
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* @file calibrateCompass.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a class to calibrate the compass module
|
||||
* @version 0.1
|
||||
* @date 2023-05-23
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QMC5883LCompass.h>
|
||||
#include <Preferences.h>
|
||||
#include <iostream>
|
||||
|
||||
#include "component.h"
|
||||
|
||||
/**
|
||||
* @brief A Class to calibrate the compass
|
||||
*
|
||||
* This class reads the raw values of the compass while
|
||||
* the rove have to be moved. The lowest and highest values
|
||||
* are used to calibrate the compass to the current location.
|
||||
*/
|
||||
class CalibrateCompass : public Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief State of the calibration process
|
||||
*/
|
||||
enum State
|
||||
{
|
||||
Ready,
|
||||
Calibrating,
|
||||
Finished
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Type for calibration data
|
||||
*
|
||||
* The data consist of 6 values. For each for the 3 axis
|
||||
* are to integer needed.
|
||||
*/
|
||||
struct CalibrationData
|
||||
{
|
||||
int data[3][2];
|
||||
};
|
||||
|
||||
CalibrateCompass(QMC5883LCompass *compass);
|
||||
|
||||
/**
|
||||
* @brief Starts the calibration
|
||||
*/
|
||||
void start();
|
||||
|
||||
/**
|
||||
* @brief Use the measured calibration data
|
||||
*/
|
||||
void useData();
|
||||
|
||||
/**
|
||||
* @brief Remove the measured calibration data
|
||||
*/
|
||||
void removeCalibration();
|
||||
|
||||
/**
|
||||
* @brief Reset the calibration process to start again
|
||||
*/
|
||||
void reset();
|
||||
|
||||
/**
|
||||
* @brief Save the measured calibration data to the flash
|
||||
*/
|
||||
void saveData();
|
||||
|
||||
/**
|
||||
* @brief Load the measured calibration data from the flash
|
||||
*
|
||||
*/
|
||||
void loadData();
|
||||
|
||||
State getState() const { return this->state; }
|
||||
CalibrationData getCalibrationData() const { return this->data; }
|
||||
|
||||
/**
|
||||
* @brief Makes the calibration data printable with std::cout()
|
||||
*
|
||||
* @param stream
|
||||
* @param caliComp
|
||||
* @return std::ostream&
|
||||
*/
|
||||
friend std::ostream &operator<<(std::ostream &stream, const CalibrateCompass &caliComp);
|
||||
|
||||
private:
|
||||
void runAsChild() override;
|
||||
void run() override;
|
||||
void checkDataValidity();
|
||||
|
||||
QMC5883LCompass *compass;
|
||||
State state = State::Ready;
|
||||
CalibrationData data{};
|
||||
|
||||
void clearData();
|
||||
|
||||
bool dataValid = false;
|
||||
const uint16_t maxTimeWithoutChange = 10000;
|
||||
uint32_t lastChange = 0;
|
||||
};
|
||||
@@ -0,0 +1,54 @@
|
||||
#include "component.h"
|
||||
|
||||
Component::Component(uint16_t loopDelay) : loopDelay{loopDelay}
|
||||
{
|
||||
}
|
||||
|
||||
void Component::loop()
|
||||
{
|
||||
if (!this->active)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->childComponents.size())
|
||||
{
|
||||
std::list<Component *>::iterator it;
|
||||
for (it = this->childComponents.begin(); it != this->childComponents.end(); it++)
|
||||
{
|
||||
(*it)->loop();
|
||||
}
|
||||
}
|
||||
this->runAsChild();
|
||||
|
||||
if (this->onlyChilds)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (static_cast<bool>(this->loopDelay) && millis() - this->lastMillis < this->loopDelay)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->lastMillis = millis();
|
||||
|
||||
this->beforeRun();
|
||||
this->run();
|
||||
this->afterRun();
|
||||
|
||||
if (this->timeUpdateAfter)
|
||||
{
|
||||
this->lastMillis = millis();
|
||||
}
|
||||
}
|
||||
|
||||
void Component::addChildComponent(Component *child)
|
||||
{
|
||||
this->childComponents.push_back(child);
|
||||
}
|
||||
|
||||
void Component::removeChildComponent(Component *child)
|
||||
{
|
||||
this->childComponents.remove(child);
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
* @file component.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains an interface to make non blocking components with delay.
|
||||
* @version 0.1
|
||||
* @date 2023-08-16
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <list>
|
||||
|
||||
/**
|
||||
* @brief An Interface to make components
|
||||
*
|
||||
* A component is a task that be called in a loop which not
|
||||
* runs every loop, so every component has a non blocking delay.
|
||||
*
|
||||
* A component can manage other components which called children components.
|
||||
*/
|
||||
class Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Component object
|
||||
*
|
||||
* With the default constructor the created component is
|
||||
* by default inactive. This does not affect the execution of
|
||||
* the children components.
|
||||
*/
|
||||
Component() {}
|
||||
|
||||
/**
|
||||
* @brief Construct a new Component object
|
||||
*
|
||||
* If the given parameter is zero, there are no differences to the
|
||||
* default constructor.
|
||||
*
|
||||
* @param loopDelay the minimum time in milliseconds before the task runs
|
||||
*/
|
||||
Component(uint16_t loopDelay);
|
||||
|
||||
/**
|
||||
* @brief Runs the children components and the task
|
||||
*
|
||||
* The loop() function of the children is called every time this
|
||||
* loop is called.
|
||||
*
|
||||
* The run() function which presents the task of this component is
|
||||
* only called if the delay is reached.
|
||||
*/
|
||||
void loop();
|
||||
|
||||
/**
|
||||
* @brief Deactivate this component
|
||||
*
|
||||
* If the component is deactivated the call of loop() ha no effect
|
||||
*/
|
||||
void deactivate() { this->active = false; }
|
||||
void activate() { this->active = true; }
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief Override this function to avoid the delay
|
||||
*/
|
||||
virtual void runAsChild() {}
|
||||
|
||||
/**
|
||||
* @brief Runs befor the run() function
|
||||
*
|
||||
* This function is only called, if the delay
|
||||
* is reached.
|
||||
* The function do nothing, except the function is overwritten
|
||||
* by the class which inherits this class.
|
||||
*/
|
||||
virtual void beforeRun() {}
|
||||
|
||||
/**
|
||||
* @brief The actual task
|
||||
*
|
||||
* This function have to be overwritten by the inheriting class.
|
||||
*/
|
||||
virtual void run() = 0;
|
||||
|
||||
/**
|
||||
* @brief Runs after the run() function
|
||||
*
|
||||
* This function is only called, if the delay
|
||||
* is reached.
|
||||
* The function do nothing, except the function is overwritten
|
||||
* by the class which inherits this class.
|
||||
*/
|
||||
virtual void afterRun() {}
|
||||
|
||||
/**
|
||||
* @brief Adds a child component
|
||||
*
|
||||
* The child component will be called every time the loop() function
|
||||
* is called.
|
||||
*
|
||||
* @param child
|
||||
*/
|
||||
void addChildComponent(Component *child);
|
||||
void removeChildComponent(Component *child);
|
||||
|
||||
void activateOnlyChilds() { this->onlyChilds = true; }
|
||||
|
||||
/**
|
||||
* @brief Skip the actual task
|
||||
*
|
||||
* Same as set the loopDelay to zero.
|
||||
*/
|
||||
void deactivateOnlyChilds() { this->onlyChilds = false; }
|
||||
|
||||
/**
|
||||
* @brief Set the timer after task
|
||||
*
|
||||
* If this function is called once the measurement of the delay
|
||||
* starts after task has finished. The default is, that the
|
||||
* measurement begins at the start of the task.
|
||||
*/
|
||||
void setTimerAfterTask() { this->timeUpdateAfter = true; }
|
||||
|
||||
/**
|
||||
* @brief the minimum time in milliseconds before the task runs
|
||||
*
|
||||
* If this value is zero, the functions beforeRun(), run() and
|
||||
* afterRun() would not be called
|
||||
*/
|
||||
uint16_t loopDelay = 0;
|
||||
|
||||
private:
|
||||
std::list<Component *> childComponents;
|
||||
|
||||
bool active = true;
|
||||
bool onlyChilds = false;
|
||||
bool timeUpdateAfter = false;
|
||||
uint32_t lastMillis = 0;
|
||||
};
|
||||
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* @file controlPad.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-03-30
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "controlPad.h"
|
||||
|
||||
ControlPad::ControlPad() : Component(10), controlInput{0, 0, 0, 0} {}
|
||||
|
||||
void ControlPad::run()
|
||||
{
|
||||
if (!this->connected)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (millis() - this->lastMessageReceive > this->disconnectTime)
|
||||
{
|
||||
this->connected = false;
|
||||
this->controlInput.buttons = 0;
|
||||
this->controlInput.x = UINT8_MAX / 2;
|
||||
this->controlInput.y = UINT8_MAX / 2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->lastButtons != controlInput.buttons)
|
||||
{
|
||||
this->updated = true;
|
||||
}
|
||||
|
||||
if (static_cast<bool>(this->menuControl) && this->controlInput.buttons > 0 && this->updated)
|
||||
{
|
||||
if (this->firstButtonPress)
|
||||
{
|
||||
this->menuControl->printMenu();
|
||||
this->firstButtonPress = false;
|
||||
std::cout << "ControlPad::loop - First menu print" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ControlPadButton::isControlPadButtonPressed(&this->controlInput, ControlPadButton::PadButton::Left))
|
||||
{
|
||||
this->menuControl->left();
|
||||
}
|
||||
else if (ControlPadButton::isControlPadButtonPressed(&this->controlInput, ControlPadButton::PadButton::Right))
|
||||
{
|
||||
this->menuControl->right();
|
||||
}
|
||||
else if (ControlPadButton::isControlPadButtonPressed(&this->controlInput, ControlPadButton::PadButton::Up))
|
||||
{
|
||||
this->menuControl->up();
|
||||
}
|
||||
else if (ControlPadButton::isControlPadButtonPressed(&this->controlInput, ControlPadButton::PadButton::Down))
|
||||
{
|
||||
this->menuControl->down();
|
||||
}
|
||||
else if (ControlPadButton::isControlPadButtonPressed(&this->controlInput, ControlPadButton::PadButton::Yes))
|
||||
{
|
||||
this->menuControl->yes();
|
||||
}
|
||||
else if (ControlPadButton::isControlPadButtonPressed(&this->controlInput, ControlPadButton::PadButton::No))
|
||||
{
|
||||
this->menuControl->no();
|
||||
}
|
||||
|
||||
this->updated = false;
|
||||
this->lastButtons = controlInput.buttons;
|
||||
}
|
||||
}
|
||||
|
||||
void ControlPad::insertData(const uint8_t *data)
|
||||
{
|
||||
this->connected = true;
|
||||
this->lastMessageReceive = millis();
|
||||
|
||||
const uint8_t lastCount = this->controlInput.counter + 1;
|
||||
memcpy(&(this->controlInput), data, sizeof(this->controlInput));
|
||||
if (lastCount != this->controlInput.counter)
|
||||
std::cout << "ControlPad::insertData counter wrong value" << std::endl;
|
||||
|
||||
if (this->controlInput.x > UINT8_MAX / 2 - this->deadZoneX && this->controlInput.x < UINT8_MAX / 2 + this->deadZoneX)
|
||||
this->controlInput.x = UINT8_MAX / 2;
|
||||
|
||||
if (this->controlInput.y > UINT8_MAX / 2 - this->deadZoneY && this->controlInput.y < UINT8_MAX / 2 + this->deadZoneY)
|
||||
this->controlInput.y = UINT8_MAX / 2;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* @file controlPad.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a class that gets the input data
|
||||
* @version 0.1
|
||||
* @date 2023-03-30
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <menuControl.h>
|
||||
|
||||
#include <controlPadInput.h>
|
||||
#include <component.h>
|
||||
|
||||
/**
|
||||
* @brief A class to manage inputs
|
||||
*
|
||||
* This class converts the incoming data to the buttons and
|
||||
* the axis from the joystick. The converted data will be send
|
||||
* to the menu.
|
||||
*/
|
||||
class ControlPad : public Component
|
||||
{
|
||||
public:
|
||||
ControlPad();
|
||||
|
||||
/**
|
||||
* @brief Insert the incoming data to convert
|
||||
*
|
||||
* The data is converted to the ControlPadInput struct.
|
||||
*
|
||||
* @param data have to be 4 byte long
|
||||
*/
|
||||
void insertData(const uint8_t *data);
|
||||
|
||||
/**
|
||||
* @brief Set the MenuControl object
|
||||
*
|
||||
* The MenuControl object is used to control the Menu.
|
||||
*
|
||||
* @see Menu
|
||||
* @see ControlPadInput
|
||||
*
|
||||
* @param menuControl
|
||||
*/
|
||||
void setMenuControl(MenuControl *menuControl) { this->menuControl = menuControl; }
|
||||
|
||||
/**
|
||||
* @brief Get the Control Pad Data
|
||||
*
|
||||
* The pointer holds the lates data from the ControlPad
|
||||
*
|
||||
* @return const ControlPadInput*
|
||||
*/
|
||||
const ControlPadInput *getControlPadDataPtr() const { return &this->controlInput; }
|
||||
|
||||
bool isControlPadConnected() const { return this->connected; }
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
|
||||
MenuControl *menuControl = nullptr;
|
||||
ControlPadInput controlInput;
|
||||
|
||||
bool connected = false;
|
||||
bool updated = false;
|
||||
bool firstButtonPress = true;
|
||||
|
||||
uint8_t deadZoneX = 20;
|
||||
uint8_t deadZoneY = 20;
|
||||
uint8_t lastButtons = 0;
|
||||
|
||||
uint16_t disconnectTime = 100;
|
||||
|
||||
uint32_t lastMessageReceive = 0;
|
||||
};
|
||||
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* @file controlPadInput.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-03-30
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CONTROL_PAD_INPUT_H
|
||||
#define CONTROL_PAD_INPUT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct ControlPadInput
|
||||
{
|
||||
uint8_t buttons;
|
||||
uint8_t x;
|
||||
uint8_t y;
|
||||
uint8_t counter;
|
||||
};
|
||||
|
||||
class ControlPadButton
|
||||
{
|
||||
public:
|
||||
enum PadButton
|
||||
{
|
||||
Left = 4,
|
||||
Right = 8,
|
||||
Up = 2,
|
||||
Down = 1,
|
||||
Yes = 32,
|
||||
No = 16,
|
||||
Action = 64
|
||||
};
|
||||
|
||||
static bool isControlPadButtonPressed(const ControlPadInput *input, PadButton button)
|
||||
{
|
||||
uint8_t buttonNum = input->buttons;
|
||||
switch (button)
|
||||
{
|
||||
case PadButton::Left:
|
||||
return buttonNum & (uint8_t)PadButton::Left;
|
||||
break;
|
||||
|
||||
case PadButton::Right:
|
||||
return buttonNum & (uint8_t)PadButton::Right;
|
||||
break;
|
||||
|
||||
case PadButton::Up:
|
||||
return buttonNum & (uint8_t)PadButton::Up;
|
||||
break;
|
||||
|
||||
case PadButton::Down:
|
||||
return buttonNum & (uint8_t)PadButton::Down;
|
||||
break;
|
||||
|
||||
case PadButton::Yes:
|
||||
return buttonNum & (uint8_t)PadButton::Yes;
|
||||
break;
|
||||
|
||||
case PadButton::No:
|
||||
return buttonNum & (uint8_t)PadButton::No;
|
||||
break;
|
||||
|
||||
case PadButton::Action:
|
||||
return buttonNum & (uint8_t)PadButton::Action;
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CONTROL_PAD_INPUT_H
|
||||
@@ -0,0 +1,63 @@
|
||||
#include "counter.h"
|
||||
|
||||
uint8_t Counter::amountOfCounter = 0;
|
||||
|
||||
Counter::Counter(uint8_t pin)
|
||||
: pulsePin{pin}, unit{static_cast<pcnt_unit_t>(Counter::amountOfCounter)}
|
||||
{
|
||||
if (Counter::amountOfCounter <= Counter::maxCounter)
|
||||
{
|
||||
Counter::amountOfCounter++;
|
||||
}
|
||||
|
||||
pcnt_config_t config;
|
||||
config.unit = this->unit;
|
||||
config.channel = PCNT_CHANNEL_0;
|
||||
config.counter_h_lim = Counter::highLimit;
|
||||
config.counter_l_lim = Counter::lowLimit;
|
||||
config.ctrl_gpio_num = PCNT_PIN_NOT_USED;
|
||||
config.hctrl_mode = PCNT_CHANNEL_LEVEL_ACTION_KEEP;
|
||||
config.lctrl_mode = PCNT_CHANNEL_LEVEL_ACTION_KEEP;
|
||||
config.pulse_gpio_num = this->pulsePin;
|
||||
config.pos_mode = PCNT_CHANNEL_EDGE_ACTION_INCREASE;
|
||||
config.neg_mode = PCNT_CHANNEL_EDGE_ACTION_HOLD;
|
||||
pcnt_unit_config(&config);
|
||||
}
|
||||
|
||||
void Counter::pause()
|
||||
{
|
||||
pcnt_counter_pause(this->unit);
|
||||
}
|
||||
|
||||
void Counter::resume()
|
||||
{
|
||||
pcnt_counter_resume(this->unit);
|
||||
}
|
||||
|
||||
void Counter::clear()
|
||||
{
|
||||
pcnt_counter_clear(this->unit);
|
||||
}
|
||||
|
||||
int16_t Counter::getValue() const
|
||||
{
|
||||
int16_t res = 0;
|
||||
pcnt_get_counter_value(this->unit, &res);
|
||||
return res;
|
||||
}
|
||||
|
||||
void Counter::setFilterValue(uint16_t value)
|
||||
{
|
||||
pcnt_set_filter_value(this->unit, value);
|
||||
this->filterEnable();
|
||||
}
|
||||
|
||||
void Counter::filterEnable()
|
||||
{
|
||||
pcnt_filter_enable(this->unit);
|
||||
}
|
||||
|
||||
void Counter::filterDisable()
|
||||
{
|
||||
pcnt_filter_disable(this->unit);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* @file counter.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a class that abstract the hardware counter from the esp32
|
||||
* @version 0.1
|
||||
* @date 2023-10-12
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <driver/pcnt.h>
|
||||
#include <cinttypes>
|
||||
|
||||
/**
|
||||
* @brief A class that abstract the hardware counter from the esp32
|
||||
*/
|
||||
class Counter
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Counter object
|
||||
*
|
||||
* @param pin with incoming pulses
|
||||
*/
|
||||
Counter(uint8_t pin);
|
||||
|
||||
/**
|
||||
* @brief Pause the pulse counting
|
||||
*/
|
||||
void pause();
|
||||
|
||||
/**
|
||||
* @brief Resume the pulse counting
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* @brief Start counting by zero again
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* @brief Get the counted pulses
|
||||
*
|
||||
* @return int16_t
|
||||
*/
|
||||
int16_t getValue() const;
|
||||
|
||||
/**
|
||||
* @brief Set the filter value
|
||||
*
|
||||
* The filter skip all pulses after a pulse for the filter time.
|
||||
* The filter time depends on the frequency of the processor. The time
|
||||
* for a whole tact multiplied with the filter value results the filter time.
|
||||
*
|
||||
* @param value max 1023
|
||||
*/
|
||||
void setFilterValue(uint16_t value);
|
||||
|
||||
void filterEnable();
|
||||
void filterDisable();
|
||||
|
||||
private:
|
||||
static constexpr int16_t highLimit = INT16_MAX;
|
||||
static constexpr uint8_t lowLimit = 0;
|
||||
static constexpr uint8_t maxCounter = 6;
|
||||
|
||||
static uint8_t amountOfCounter;
|
||||
|
||||
bool initalized = false;
|
||||
|
||||
uint8_t pulsePin;
|
||||
pcnt_unit_t unit;
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file displayWrapper.cpp
|
||||
* @file LcdWrapper.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains the implementation of the class LcdWrapper
|
||||
* @version 0.1
|
||||
@@ -11,50 +11,73 @@
|
||||
|
||||
#include "LcdWrapper.h"
|
||||
|
||||
LcdWrapper::LcdWrapper(LiquidCrystal_I2C* lcd) {
|
||||
this->lcd = lcd;
|
||||
this->clear();
|
||||
LcdWrapper::LcdWrapper(LiquidCrystal_I2C *lcd)
|
||||
: lcd{lcd}, changed{false}
|
||||
{
|
||||
// this->clear();
|
||||
}
|
||||
|
||||
void LcdWrapper::run()
|
||||
{
|
||||
if (!this->changed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->lcd->clear();
|
||||
for (uint8_t i = 0; i < LcdWrapper::totalLines; i++)
|
||||
{
|
||||
this->lcd->setCursor(0, i);
|
||||
this->lcd->print(static_cast<const char *>(this->data[i]));
|
||||
}
|
||||
|
||||
if (static_cast<bool>(this->callback))
|
||||
{
|
||||
this->callback(this->data, LcdWrapper::totalLines, LcdWrapper::totalRows);
|
||||
}
|
||||
|
||||
this->changed = false;
|
||||
}
|
||||
|
||||
void LcdWrapper::loop() {
|
||||
if (this->changed) {
|
||||
this->lcd->clear();
|
||||
for (uint8_t i = 0; i < DISPLAY_WRAPPER_LINES; i++) {
|
||||
this->lcd->setCursor(0, i);
|
||||
this->lcd->print(this->data[i]);
|
||||
}
|
||||
this->changed = false;
|
||||
}
|
||||
}
|
||||
|
||||
void LcdWrapper::clear() {
|
||||
for (uint8_t i = 0; i < DISPLAY_WRAPPER_LINES; i++) {
|
||||
for (uint8_t j = 0; j < DISPLAY_WRAPPER_ROWS; j++) {
|
||||
void LcdWrapper::clear()
|
||||
{
|
||||
for (uint8_t i = 0; i < LcdWrapper::totalLines; i++)
|
||||
{
|
||||
for (uint8_t j = 0; j < LcdWrapper::totalRows; j++)
|
||||
{
|
||||
data[i][j] = ' ';
|
||||
}
|
||||
}
|
||||
this->changed = true;
|
||||
}
|
||||
|
||||
void LcdWrapper::setCursor(uint8_t row, uint8_t line) {
|
||||
if (row > DISPLAY_WRAPPER_ROWS - 1)
|
||||
row = DISPLAY_WRAPPER_ROWS - 1;
|
||||
void LcdWrapper::setCursor(uint8_t row, uint8_t line)
|
||||
{
|
||||
if (row > LcdWrapper::totalRows - 1)
|
||||
{
|
||||
row = LcdWrapper::totalRows - 1;
|
||||
}
|
||||
|
||||
if (line > DISPLAY_WRAPPER_LINES - 1)
|
||||
line = DISPLAY_WRAPPER_LINES - 1;
|
||||
if (line > LcdWrapper::totalLines - 1)
|
||||
{
|
||||
line = LcdWrapper::totalLines - 1;
|
||||
}
|
||||
|
||||
this->cursorRow = row;
|
||||
this->cursorLine = line;
|
||||
}
|
||||
|
||||
void LcdWrapper::print(const char *str) {
|
||||
void LcdWrapper::print(const char *str)
|
||||
{
|
||||
uint8_t inputStringPosition = 0;
|
||||
for (uint8_t i = this->cursorRow; i < DISPLAY_WRAPPER_ROWS; i++) {
|
||||
for (uint8_t i = this->cursorRow; i < LcdWrapper::totalRows; i++)
|
||||
{
|
||||
if (str[inputStringPosition] == '\0')
|
||||
{
|
||||
break;
|
||||
else
|
||||
this->data[this->cursorLine][i] = str[inputStringPosition];
|
||||
}
|
||||
this->data[this->cursorLine][i] = str[inputStringPosition];
|
||||
|
||||
inputStringPosition++;
|
||||
}
|
||||
this->changed = true;
|
||||
|
||||
+40
-41
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file displayWrapper.h
|
||||
* @file LcdWrapper.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains the LcdWrapper class
|
||||
* @version 0.1
|
||||
@@ -15,10 +15,9 @@
|
||||
#include <iostream>
|
||||
#include <LiquidCrystal_I2C.h>
|
||||
#include <displayWrapper.h>
|
||||
#include <component.h>
|
||||
|
||||
#define DISPLAY_WRAPPER_ROWS 16
|
||||
#define DISPLAY_WRAPPER_LINES 2
|
||||
|
||||
typedef void (*LcdWrapperCallback)(const char data[][16], uint8_t lines, uint8_t rows);
|
||||
/**
|
||||
* @brief A class for the Menu class to print information
|
||||
*
|
||||
@@ -26,51 +25,51 @@
|
||||
* The class takes the information to print from any thread. The
|
||||
* loop function has to be called to print the data.
|
||||
*/
|
||||
class LcdWrapper : public DisplayWrapper {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Lcd Wrapper object
|
||||
*
|
||||
* @param lcd
|
||||
*/
|
||||
LcdWrapper(LiquidCrystal_I2C* lcd);
|
||||
class LcdWrapper : public DisplayWrapper, public Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Lcd Wrapper object
|
||||
*
|
||||
* @param lcd
|
||||
*/
|
||||
LcdWrapper(LiquidCrystal_I2C *lcd);
|
||||
|
||||
/**
|
||||
* @brief Print the saved data
|
||||
*
|
||||
*/
|
||||
void loop();
|
||||
/**
|
||||
* @brief Empty the buffer
|
||||
*/
|
||||
void clear() override;
|
||||
|
||||
/**
|
||||
* @brief Empty the buffer
|
||||
*
|
||||
*/
|
||||
void clear() override;
|
||||
/**
|
||||
* @brief Set point where data to be saved
|
||||
*
|
||||
* @param row
|
||||
* @param line
|
||||
*/
|
||||
void setCursor(uint8_t row, uint8_t line) override;
|
||||
void setCallback(LcdWrapperCallback callback) { this->callback = callback; }
|
||||
|
||||
/**
|
||||
* @brief Set point where data to be saved
|
||||
*
|
||||
* @param row
|
||||
* @param line
|
||||
*/
|
||||
void setCursor(uint8_t row, uint8_t line) override;
|
||||
/**
|
||||
* @brief Save the data to be printed
|
||||
*
|
||||
* @param str
|
||||
*/
|
||||
void print(const char *str) override;
|
||||
|
||||
/**
|
||||
* @brief Save the data to be printed
|
||||
*
|
||||
* @param str
|
||||
*/
|
||||
void print(const char *str) override;
|
||||
static constexpr uint8_t totalRows = 16;
|
||||
static constexpr uint8_t totalLines = 2;
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
|
||||
private:
|
||||
LiquidCrystal_I2C* lcd;
|
||||
char data[DISPLAY_WRAPPER_LINES][DISPLAY_WRAPPER_ROWS];
|
||||
LiquidCrystal_I2C *lcd;
|
||||
LcdWrapperCallback callback = nullptr;
|
||||
char data[LcdWrapper::totalLines][LcdWrapper::totalRows];
|
||||
|
||||
uint8_t cursorRow = 0;
|
||||
uint8_t cursorLine = 0;
|
||||
uint8_t cursorRow = 0;
|
||||
uint8_t cursorLine = 0;
|
||||
|
||||
bool changed = false;
|
||||
bool changed = false;
|
||||
};
|
||||
|
||||
#endif // DISPLAY_WRAPPER_H
|
||||
|
||||
+49
-34
@@ -11,93 +11,109 @@
|
||||
*/
|
||||
#include "debugMqtt.h"
|
||||
|
||||
PubSubClient* DebugMqtt::client;
|
||||
PubSubClient *DebugMqtt::client;
|
||||
Loglevel DebugMqtt::loglevel;
|
||||
bool DebugMqtt::isInit = false;
|
||||
char DebugMqtt::msg[MQTT_BUFFER_SIZE];
|
||||
char DebugMqtt::topic[MQTT_BUFFER_SIZE];
|
||||
|
||||
|
||||
DebugMqtt::DebugMqtt(const char* name, uint8_t bufSize) {
|
||||
this->name = name;
|
||||
DebugMqtt::DebugMqtt(const char *name, uint8_t bufSize)
|
||||
: name{name}
|
||||
{
|
||||
if (bufSize != 0)
|
||||
{
|
||||
this->bufSize = bufSize;
|
||||
}
|
||||
this->buf = new char[this->bufSize];
|
||||
}
|
||||
|
||||
DebugMqtt::~DebugMqtt() {
|
||||
DebugMqtt::~DebugMqtt()
|
||||
{
|
||||
delete this->buf;
|
||||
}
|
||||
|
||||
void DebugMqtt::sendMsg(Loglevel loglevel, String topic, String msg) {
|
||||
snprintf (DebugMqtt::msg, MQTT_BUFFER_SIZE, "%s: %s",this->name ,msg.c_str());
|
||||
this->sendData(loglevel, topic, DebugMqtt::msg);
|
||||
void DebugMqtt::sendMsg(Loglevel loglevel, String topic, String msg)
|
||||
{
|
||||
snprintf(static_cast<char *>(DebugMqtt::msg), MQTT_BUFFER_SIZE, static_cast<const char *>("%s: %s"), this->name, msg.c_str());
|
||||
this->sendData(loglevel, topic, static_cast<const char *>(DebugMqtt::msg));
|
||||
}
|
||||
|
||||
void DebugMqtt::sendMsg(Loglevel loglevel, String msg) {
|
||||
void DebugMqtt::sendMsg(Loglevel loglevel, String msg)
|
||||
{
|
||||
this->sendMsg(loglevel, "", msg);
|
||||
}
|
||||
|
||||
void DebugMqtt::sendData(Loglevel loglevel, String topic, String data) {
|
||||
if (!DebugMqtt::isInit) {
|
||||
void DebugMqtt::sendData(Loglevel loglevel, String topic, String data)
|
||||
{
|
||||
if (!DebugMqtt::isInit)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (loglevel <= DebugMqtt::loglevel && loglevel > Loglevel::none) {
|
||||
snprintf (DebugMqtt::topic, MQTT_BUFFER_SIZE, "%s%s", DebugMqtt::enum_to_string(loglevel).c_str(), topic.c_str());
|
||||
snprintf (DebugMqtt::msg, MQTT_BUFFER_SIZE, "%s", data.c_str());
|
||||
client->publish(DebugMqtt::topic, DebugMqtt::msg);
|
||||
if (loglevel <= DebugMqtt::loglevel && loglevel > Loglevel::none)
|
||||
{
|
||||
snprintf(static_cast<char *>(DebugMqtt::topic), MQTT_BUFFER_SIZE, static_cast<const char *>("%s%s"), DebugMqtt::enum_to_string(loglevel).c_str(), topic.c_str());
|
||||
snprintf(static_cast<char *>(DebugMqtt::msg), MQTT_BUFFER_SIZE, static_cast<const char *>("%s"), data.c_str());
|
||||
client->publish(DebugMqtt::topic, static_cast<const char *>(DebugMqtt::msg));
|
||||
}
|
||||
}
|
||||
|
||||
void DebugMqtt::sendData(Loglevel loglevel, String data){
|
||||
this->sendData(loglevel, "", data);
|
||||
void DebugMqtt::sendData(Loglevel loglevel, String data)
|
||||
{
|
||||
DebugMqtt::sendData(loglevel, "", data);
|
||||
}
|
||||
|
||||
void DebugMqtt::writeToInflux(String measurement_name, String field_set, float measurement, uint64_t nanos) {
|
||||
void DebugMqtt::writeToInflux(String measurement_name, String field_set, float measurement, uint64_t nanos)
|
||||
{
|
||||
// Example String: "weather temperature=82 1465839830100400200";
|
||||
|
||||
snprintf(DebugMqtt::msg, MQTT_BUFFER_SIZE, "%s %s=%f %llu", measurement_name.c_str(), field_set.c_str(), measurement, nanos);
|
||||
this->sendData(Loglevel::influx, DebugMqtt::msg);
|
||||
snprintf(static_cast<char *>(DebugMqtt::msg), MQTT_BUFFER_SIZE, static_cast<const char *>("%s %s=%f %llu"), measurement_name.c_str(), field_set.c_str(), measurement, nanos);
|
||||
this->sendData(Loglevel::influx, static_cast<const char *>(DebugMqtt::msg));
|
||||
}
|
||||
|
||||
void DebugMqtt::addCharacter(char c) {
|
||||
this->buf[this->bufPos] = c;
|
||||
void DebugMqtt::addCharacter(char character)
|
||||
{
|
||||
this->buf[this->bufPos] = character;
|
||||
this->bufPos++;
|
||||
if (c == '\n' || this->bufPos >= this->bufSize - 1) {
|
||||
if (character == '\n' || this->bufPos >= this->bufSize - 1)
|
||||
{
|
||||
this->buf[this->bufPos - 1] = '\0';
|
||||
this->sendMsg(Loglevel::info, buf);
|
||||
this->bufPos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void DebugMqtt::init(PubSubClient *client, Loglevel max_loglevel) {
|
||||
void DebugMqtt::init(PubSubClient *client, Loglevel max_loglevel)
|
||||
{
|
||||
DebugMqtt::client = client;
|
||||
DebugMqtt::loglevel = max_loglevel;
|
||||
DebugMqtt::isInit = true;
|
||||
}
|
||||
|
||||
void DebugMqtt::changeLoglevel(Loglevel loglevel) {
|
||||
void DebugMqtt::changeLoglevel(Loglevel loglevel)
|
||||
{
|
||||
DebugMqtt::loglevel = loglevel;
|
||||
}
|
||||
|
||||
String DebugMqtt::enum_to_string(Loglevel loglevel) {
|
||||
String DebugMqtt::enum_to_string(Loglevel loglevel)
|
||||
{
|
||||
String topic = "";
|
||||
topic += MQTT_DEBUG_TOPIC;
|
||||
switch(loglevel){
|
||||
case Loglevel::error :
|
||||
switch (loglevel)
|
||||
{
|
||||
case Loglevel::error:
|
||||
topic += "/Error";
|
||||
break;
|
||||
case Loglevel::warn :
|
||||
case Loglevel::warn:
|
||||
topic += "/Warn";
|
||||
break;
|
||||
case Loglevel::info :
|
||||
case Loglevel::info:
|
||||
topic += "/Info";
|
||||
break;
|
||||
case Loglevel::debug :
|
||||
case Loglevel::debug:
|
||||
topic += "/Debug";
|
||||
break;
|
||||
case Loglevel::influx :
|
||||
case Loglevel::influx:
|
||||
topic += "/Influx";
|
||||
break;
|
||||
default:
|
||||
@@ -105,5 +121,4 @@ String DebugMqtt::enum_to_string(Loglevel loglevel) {
|
||||
break;
|
||||
}
|
||||
return topic;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+110
-107
@@ -14,7 +14,6 @@
|
||||
#include <iostream>
|
||||
#include <PubSubClient.h>
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
@@ -35,7 +34,7 @@
|
||||
*/
|
||||
#ifndef MQTT_BUFFER_SIZE
|
||||
#define MQTT_BUFFER_SIZE 128
|
||||
#endif //MQTT_BUFFER_SIZE
|
||||
#endif // MQTT_BUFFER_SIZE
|
||||
|
||||
/**
|
||||
* @brief An enum to set the log level
|
||||
@@ -48,12 +47,15 @@
|
||||
* @see sendData()
|
||||
*
|
||||
*/
|
||||
enum Loglevel { none,
|
||||
error,
|
||||
warn,
|
||||
info,
|
||||
debug,
|
||||
influx};
|
||||
enum Loglevel
|
||||
{
|
||||
none,
|
||||
error,
|
||||
warn,
|
||||
info,
|
||||
debug,
|
||||
influx
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A class to send debug messages over MQTT
|
||||
@@ -64,115 +66,116 @@ enum Loglevel { none,
|
||||
*
|
||||
* @see Loglevel
|
||||
*/
|
||||
class DebugMqtt {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Debug Mqtt object.
|
||||
*
|
||||
* @param name A String with send with every Message.
|
||||
* @param bufSize for the addCharacter function.
|
||||
*/
|
||||
DebugMqtt(const char* name, uint8_t bufSize = 0);
|
||||
class DebugMqtt
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Debug Mqtt object.
|
||||
*
|
||||
* @param name A String with send with every Message.
|
||||
* @param bufSize for the addCharacter function.
|
||||
*/
|
||||
DebugMqtt(const char *name, uint8_t bufSize = 0);
|
||||
|
||||
~DebugMqtt();
|
||||
~DebugMqtt();
|
||||
|
||||
/**
|
||||
* @brief Send a Message via MQTT
|
||||
*
|
||||
* This function uses sendData to send the given string and
|
||||
* add the name to the message given by the constructer.
|
||||
*
|
||||
* @see sendData()
|
||||
* @see Loglevel
|
||||
*
|
||||
* @param loglevel Loglevel given by the enum Loglevel
|
||||
* @param topic Additional topic behind loglevel
|
||||
* @param msg The message to send as String
|
||||
*/
|
||||
void sendMsg(Loglevel loglevel, String topic, String msg);
|
||||
void sendMsg(Loglevel loglevel, String msg);
|
||||
/**
|
||||
* @brief Send a Message via MQTT
|
||||
*
|
||||
* This function uses sendData to send the given string and
|
||||
* add the name to the message given by the constructer.
|
||||
*
|
||||
* @see sendData()
|
||||
* @see Loglevel
|
||||
*
|
||||
* @param loglevel Loglevel given by the enum Loglevel
|
||||
* @param topic Additional topic behind loglevel
|
||||
* @param msg The message to send as String
|
||||
*/
|
||||
void sendMsg(Loglevel loglevel, String topic, String msg);
|
||||
void sendMsg(Loglevel loglevel, String msg);
|
||||
|
||||
/**
|
||||
* @brief Send a Message via MQTT
|
||||
*
|
||||
* This function sends the Data via MQTT with the given topic
|
||||
* from Loglevel or followed by given String topic.
|
||||
* Normally this function is called by sendMsg() or by
|
||||
* writeToInflux()
|
||||
*
|
||||
* @see sendData()
|
||||
* @see writeToInflux()
|
||||
* @see Loglevel
|
||||
*
|
||||
* @param loglevel Loglevel given by the enum Loglevel
|
||||
* @param topic Additional topic behind loglevel
|
||||
* @param data The message to send as String
|
||||
*/
|
||||
void sendData(Loglevel loglevel, String topic, String data);
|
||||
void sendData(Loglevel loglevel, String data);
|
||||
/**
|
||||
* @brief Send a Message via MQTT
|
||||
*
|
||||
* This function sends the Data via MQTT with the given topic
|
||||
* from Loglevel or followed by given String topic.
|
||||
* Normally this function is called by sendMsg() or by
|
||||
* writeToInflux()
|
||||
*
|
||||
* @see sendData()
|
||||
* @see writeToInflux()
|
||||
* @see Loglevel
|
||||
*
|
||||
* @param loglevel Loglevel given by the enum Loglevel
|
||||
* @param topic Additional topic behind loglevel
|
||||
* @param data The message to send as String
|
||||
*/
|
||||
static void sendData(Loglevel loglevel, String topic, String data);
|
||||
static void sendData(Loglevel loglevel, String data);
|
||||
|
||||
/**
|
||||
* @brief Send a Message via MQTT for InfluxDB
|
||||
*
|
||||
* This function sends a MQTT message which is intended for
|
||||
* Telegraf. Telegraf can listen on MQTT messages and put
|
||||
* them in an Influx Database.
|
||||
*
|
||||
* @param measurement_name like a category
|
||||
* @param field_set the name of the value e.g temperature
|
||||
* @param measurement the real value
|
||||
* @param nanos Current time in nanoseconds
|
||||
*/
|
||||
void writeToInflux(String measurement_name, String field_set, float measurement, uint64_t nanos);
|
||||
/**
|
||||
* @brief Send a Message via MQTT for InfluxDB
|
||||
*
|
||||
* This function sends a MQTT message which is intended for
|
||||
* Telegraf. Telegraf can listen on MQTT messages and put
|
||||
* them in an Influx Database.
|
||||
*
|
||||
* @param measurement_name like a category
|
||||
* @param field_set the name of the value e.g temperature
|
||||
* @param measurement the real value
|
||||
* @param nanos Current time in nanoseconds
|
||||
*/
|
||||
void writeToInflux(String measurement_name, String field_set, float measurement, uint64_t nanos);
|
||||
|
||||
/**
|
||||
* @brief Adds a single character to the buf
|
||||
*
|
||||
* The buf will be flushed out:
|
||||
* 1. when the buffer is full
|
||||
* 2. when the character is '\n'
|
||||
*
|
||||
* @param c
|
||||
*/
|
||||
void addCharacter(char c);
|
||||
/**
|
||||
* @brief Adds a single character to the buf
|
||||
*
|
||||
* The buf will be flushed out:
|
||||
* 1. when the buffer is full
|
||||
* 2. when the character is '\n'
|
||||
*
|
||||
* @param character
|
||||
*/
|
||||
void addCharacter(char character);
|
||||
|
||||
/**
|
||||
* @brief Initialize debugMQTT for all instances
|
||||
*
|
||||
* You only have to call this function once for your project.
|
||||
* If you call this function again you overwrite the client and
|
||||
* the loglevel. If you only want du overwrite the max_loglevel
|
||||
* use changeLoglevel()
|
||||
*
|
||||
* @see changeLoglevel()
|
||||
*
|
||||
* @param client PubSubClient
|
||||
* @param max_loglevel Max loglevel to send.
|
||||
*/
|
||||
static void init(PubSubClient* client, Loglevel max_loglevel);
|
||||
/**
|
||||
* @brief Initialize debugMQTT for all instances
|
||||
*
|
||||
* You only have to call this function once for your project.
|
||||
* If you call this function again you overwrite the client and
|
||||
* the loglevel. If you only want du overwrite the max_loglevel
|
||||
* use changeLoglevel()
|
||||
*
|
||||
* @see changeLoglevel()
|
||||
*
|
||||
* @param client PubSubClient
|
||||
* @param max_loglevel Max loglevel to send.
|
||||
*/
|
||||
static void init(PubSubClient *client, Loglevel max_loglevel);
|
||||
|
||||
/**
|
||||
* @brief Change loglevel
|
||||
*
|
||||
* This function changes the maximum loglevel which be send.
|
||||
*
|
||||
* @param loglevel
|
||||
*/
|
||||
static void changeLoglevel(Loglevel loglevel);
|
||||
/**
|
||||
* @brief Change loglevel
|
||||
*
|
||||
* This function changes the maximum loglevel which be send.
|
||||
*
|
||||
* @param loglevel
|
||||
*/
|
||||
static void changeLoglevel(Loglevel loglevel);
|
||||
|
||||
private:
|
||||
const char* name;
|
||||
char* buf;
|
||||
uint8_t bufPos = 0;
|
||||
uint8_t bufSize = 100;
|
||||
private:
|
||||
const char *name;
|
||||
char *buf;
|
||||
uint8_t bufPos = 0;
|
||||
uint8_t bufSize = 100;
|
||||
|
||||
static String enum_to_string(Loglevel loglevel);
|
||||
static String enum_to_string(Loglevel loglevel);
|
||||
|
||||
static PubSubClient* client;
|
||||
static Loglevel loglevel;
|
||||
static bool isInit;
|
||||
static char msg[MQTT_BUFFER_SIZE];
|
||||
static char topic[MQTT_BUFFER_SIZE];
|
||||
static PubSubClient *client;
|
||||
static Loglevel loglevel;
|
||||
static bool isInit;
|
||||
static char msg[MQTT_BUFFER_SIZE];
|
||||
static char topic[MQTT_BUFFER_SIZE];
|
||||
};
|
||||
|
||||
#endif // DEBUG_MQTT_H
|
||||
|
||||
+101
-111
@@ -12,14 +12,15 @@
|
||||
|
||||
#include "motorControl.h"
|
||||
|
||||
MotorControl::MotorControl() {
|
||||
this->setMinPwm(PWMMIN);
|
||||
this->setMaxPwm(PWMMAX);
|
||||
MotorControl::MotorControl()
|
||||
{
|
||||
Component::loopDelay = MotorControl::loopDelay;
|
||||
}
|
||||
|
||||
void MotorControl::init(uint8_t pwm_pin, uint8_t pwm_channel, uint8_t dir_1, uint8_t dir_2) {
|
||||
this->pwm_pin = pwm_pin;
|
||||
this->pwm_channel = pwm_channel;
|
||||
void MotorControl::init(uint8_t pwmPin, uint8_t pwmChannel, uint8_t dir_1, uint8_t dir_2)
|
||||
{
|
||||
this->pwmPin = pwmPin;
|
||||
this->pwmChannel = pwmChannel;
|
||||
this->dir_1 = dir_1;
|
||||
this->dir_2 = dir_2;
|
||||
|
||||
@@ -29,169 +30,158 @@ void MotorControl::init(uint8_t pwm_pin, uint8_t pwm_channel, uint8_t dir_1, uin
|
||||
digitalWrite(this->dir_1, LOW);
|
||||
digitalWrite(this->dir_2, LOW);
|
||||
|
||||
ledcSetup(this->pwm_channel, PWMFREQ, this->pwm_res);
|
||||
ledcAttachPin(this->pwm_pin, this->pwm_channel);
|
||||
ledcWrite(this->pwm_channel, 0);
|
||||
ledcSetup(this->pwmChannel, MotorControl::pwmFreq, MotorControl::pwmRes);
|
||||
ledcAttachPin(this->pwmPin, this->pwmChannel);
|
||||
ledcWrite(this->pwmChannel, 0);
|
||||
std::cout << "Init pwm" << std::endl;
|
||||
}
|
||||
|
||||
uint16_t MotorControl::loop() {
|
||||
uint32_t time = millis();
|
||||
uint16_t elapsed_time = time - this->lastMillis;
|
||||
void MotorControl::run()
|
||||
{
|
||||
// Absolute difference between targetPower and power
|
||||
const uint8_t abs_difference = abs(this->targetPower - this->power);
|
||||
|
||||
//Cancel if delay is not reached
|
||||
if (elapsed_time < delay)
|
||||
return elapsed_time;
|
||||
// Difference between targetPower and power
|
||||
const int16_t difference = this->targetPower - this->power;
|
||||
|
||||
runMotorControl();
|
||||
this->lastMillis = time;
|
||||
return elapsed_time;
|
||||
}
|
||||
|
||||
void MotorControl::runMotorControl() {
|
||||
// Absolute difference between target_power and power
|
||||
uint8_t abs_difference = abs(this->target_power - this->power);
|
||||
|
||||
// Difference between target_power and power
|
||||
int16_t difference = this->target_power - this->power;
|
||||
|
||||
// Check that the target speed is close to 0 and that the abs_difference is lower than powersteps
|
||||
if (abs(this->target_power) < powersteps && abs_difference < powersteps) {
|
||||
// Check that the target speed is close to 0 and that the abs_difference is lower than MotorControl::powerSteps
|
||||
if (abs(this->targetPower) < MotorControl::powerSteps && abs_difference < MotorControl::powerSteps)
|
||||
{
|
||||
this->setRealPower(0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Correct speed
|
||||
if (abs_difference < powersteps) {
|
||||
if (abs_difference < MotorControl::powerSteps)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Positive or negative tagret speed
|
||||
if (this->target_power >= 0) {
|
||||
// Positive or negative target speed
|
||||
if (this->targetPower >= 0)
|
||||
{
|
||||
// Positive or negative speed
|
||||
if (this->power >= 0) {
|
||||
if (difference > 0) {
|
||||
this->increasePower(powersteps);
|
||||
} else {
|
||||
this->increasePower(-powersteps);
|
||||
if (this->power >= 0)
|
||||
{
|
||||
if (difference > 0)
|
||||
{
|
||||
this->increasePower(MotorControl::powerSteps);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->increasePower(-MotorControl::powerSteps);
|
||||
}
|
||||
} else {
|
||||
this->increasePower(powersteps);
|
||||
}
|
||||
|
||||
} else {
|
||||
else
|
||||
{
|
||||
this->increasePower(MotorControl::powerSteps);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Positive or negative speed
|
||||
if (this->power >= 0) {
|
||||
this->increasePower(-powersteps);
|
||||
} else {
|
||||
if (difference > 0) {
|
||||
this->increasePower(powersteps);
|
||||
} else {
|
||||
this->increasePower(-powersteps);
|
||||
if (this->power >= 0)
|
||||
{
|
||||
this->increasePower(-MotorControl::powerSteps);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (difference > 0)
|
||||
{
|
||||
this->increasePower(MotorControl::powerSteps);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->increasePower(-MotorControl::powerSteps);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MotorControl::setMinPwm(uint8_t min) {
|
||||
if (min > 80) min = 80;
|
||||
//transform percentage to real pwm value
|
||||
min = (uint8_t) (((1 << pwm_res) - 1) * (min / 100.0));
|
||||
this->dutycycle_min = min;
|
||||
}
|
||||
|
||||
void MotorControl::setMaxPwm(uint8_t max) {
|
||||
if (max > 100) max = 100;
|
||||
//transform percentage to real pwm value
|
||||
max = (uint8_t) (((1 << pwm_res) - 1) * (max / 100.0));
|
||||
this->dutycycle_max = max;
|
||||
}
|
||||
|
||||
uint16_t MotorControl::setPowerSteps(uint8_t increment) {
|
||||
this->powersteps = increment;
|
||||
return (uint16_t) (delay * ( 100 / powersteps ));
|
||||
}
|
||||
|
||||
void MotorControl::setTargetPower(int8_t power) {
|
||||
void MotorControl::setTargetPower(int8_t power)
|
||||
{
|
||||
if (power <= 100 && power >= -100)
|
||||
this->target_power = power;
|
||||
{
|
||||
this->targetPower = power;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << " MotorControl::setTargetPower: Invalid Argument - Power: " << power << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t MotorControl::setDelay(uint8_t delay) {
|
||||
this->delay = delay;
|
||||
return (uint16_t) (delay * ( 100 / powersteps ));
|
||||
void MotorControl::stop()
|
||||
{
|
||||
this->targetPower = 0;
|
||||
}
|
||||
|
||||
void MotorControl::stop() {
|
||||
this->target_power = 0;
|
||||
}
|
||||
|
||||
void MotorControl::emergencyStop() {
|
||||
void MotorControl::emergencyStop()
|
||||
{
|
||||
setRealPower(0);
|
||||
}
|
||||
|
||||
int8_t MotorControl::getPower() {
|
||||
return this->power;
|
||||
bool MotorControl::isTargetPowerReached() const
|
||||
{
|
||||
return this->targetPower == this->power;
|
||||
}
|
||||
|
||||
int8_t MotorControl::getTargetPower() {
|
||||
return this->target_power;
|
||||
bool MotorControl::isAccelerationPositive() const
|
||||
{
|
||||
return power < targetPower;
|
||||
}
|
||||
|
||||
bool MotorControl::isTargetPowerReached() {
|
||||
if (this->target_power == this->power)
|
||||
return true;
|
||||
return false;
|
||||
bool MotorControl::isAccelerationNegative() const
|
||||
{
|
||||
return power > targetPower;
|
||||
}
|
||||
|
||||
bool MotorControl::isAccelerationPositive() {
|
||||
if (power < target_power)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MotorControl::isAccelerationNegative() {
|
||||
if (power > target_power)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void MotorControl::setRealPower(int8_t power) {
|
||||
//TODO: Exceptionhandling
|
||||
if (power <= 100 || power <= -100) {
|
||||
void MotorControl::setRealPower(int8_t power)
|
||||
{
|
||||
if (power <= 100 && power >= -100)
|
||||
{
|
||||
this->power = power;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->power == 0) {
|
||||
if (this->power == 0)
|
||||
{
|
||||
this->direction = 0;
|
||||
digitalWrite(this->dir_1, LOW);
|
||||
digitalWrite(this->dir_2, LOW);
|
||||
ledcWrite(this->pwm_channel, 0);
|
||||
ledcWrite(this->pwmChannel, 0);
|
||||
this->dutycycle = 0;
|
||||
// std::cout << "abort" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t pwm_val = map(abs(power), 0, 100, this->dutycycle_min, this->dutycycle_max);
|
||||
const uint8_t pwm_val = map(abs(power), 0, 100, MotorControl::minPwmVal, MotorControl::maxPwmVal);
|
||||
|
||||
if ((this->direction == 1 || this->direction == 0) && power < 0){ // new direction backward
|
||||
if ((this->direction == 1 || this->direction == 0) && power < 0)
|
||||
{ // new direction backward
|
||||
this->direction = 2;
|
||||
digitalWrite(this->dir_1, LOW);
|
||||
digitalWrite(this->dir_2, HIGH);
|
||||
} else if ((this->direction == 2 || this->direction == 0) && power > 0){ // new direction forward
|
||||
}
|
||||
else if ((this->direction == 2 || this->direction == 0) && power > 0)
|
||||
{ // new direction forward
|
||||
this->direction = 1;
|
||||
digitalWrite(this->dir_1, HIGH);
|
||||
digitalWrite(this->dir_2, LOW);
|
||||
}
|
||||
|
||||
ledcWrite(this->pwm_channel, pwm_val);
|
||||
std::cout << "MotorControl::setRealPower pwm_val: " << (int) pwm_val << " channel:" << (int) this->pwmChannel << std::endl;
|
||||
ledcWrite(this->pwmChannel, pwm_val);
|
||||
std::cout << "MotorControl::serRealPower - pwm: " << static_cast<int>(pwm_val) << std::endl;
|
||||
this->dutycycle = pwm_val;
|
||||
}
|
||||
|
||||
void MotorControl::increasePower(int8_t power) {
|
||||
//TODO: Exceptionhandling
|
||||
//TODO: make a stop befor a direction change
|
||||
if (abs(power) > 2 * powersteps) {
|
||||
void MotorControl::increasePower(int8_t power)
|
||||
{
|
||||
if (abs(power) > 2 * MotorControl::powerSteps)
|
||||
{
|
||||
Serial.println("Invalid Argument in MotorControl::increasePower");
|
||||
return;
|
||||
}
|
||||
|
||||
+68
-133
@@ -16,156 +16,91 @@
|
||||
#include <iostream>
|
||||
#include <Arduino.h>
|
||||
|
||||
#define DELAY 10
|
||||
#define PWMFREQ 16000
|
||||
#define PWMRES 8
|
||||
#define POWERSTEPS 2 // A total of 20 levels ( 100 / SPEED_STEPS ) * RUN_MOTOR_CONTROL_DELAY = 500ms
|
||||
#define PWMMIN 55
|
||||
#define PWMMAX 95 // Max 98% of 2^PWM_RES
|
||||
#include "component.h"
|
||||
|
||||
/**
|
||||
* @brief A class which use PWM to control the power of DC Motor
|
||||
* You can control the acceleration of the motor, for example to
|
||||
* prevent a damage on your H-Bridge.
|
||||
*/
|
||||
class MotorControl {
|
||||
public:
|
||||
MotorControl();
|
||||
class MotorControl : public Component
|
||||
{
|
||||
public:
|
||||
MotorControl();
|
||||
|
||||
/**
|
||||
* @brief Initialize the motorController
|
||||
*
|
||||
* @param pwm_pin The output pin for the signal on the esp.
|
||||
* @param pwm_channel One of the pwm channels from the esp.
|
||||
* @param dir_1 First direction pin for the H-Bridge.
|
||||
* @param dir_2 Second direction pin for the H-Bridge.
|
||||
*/
|
||||
void init(uint8_t pwm_pin, uint8_t pwm_channel, uint8_t dir_1, uint8_t dir_2);
|
||||
/**
|
||||
* @brief Initialize the motorController
|
||||
*
|
||||
* @param pwmPin The output pin for the signal on the esp.
|
||||
* @param pwmChannel One of the pwm channels from the esp.
|
||||
* @param dir_1 First direction pin for the H-Bridge.
|
||||
* @param dir_2 Second direction pin for the H-Bridge.
|
||||
*/
|
||||
void init(uint8_t pwmPin, uint8_t pwmChannel, uint8_t dir_1, uint8_t dir_2);
|
||||
|
||||
/**
|
||||
* @brief Calls runMotorControl() to update the pwm signal
|
||||
*
|
||||
* This function should be called every mainloop. If the delay is not reached, than the
|
||||
* functions returns immediately.
|
||||
* @see runMotorControl()
|
||||
* @see DELAY
|
||||
* @return time since the last call in Milliseconds
|
||||
*/
|
||||
uint16_t loop();
|
||||
/**
|
||||
* @brief Set the Target Power
|
||||
*
|
||||
* If the given power is greater than 100 or smaller than -100, then
|
||||
* this function only print an error to consol.
|
||||
*
|
||||
* @param power power in percent
|
||||
*/
|
||||
void setTargetPower(int8_t power);
|
||||
|
||||
/**
|
||||
* @brief Normally called repeatedly by loop() to update the pwm signal.
|
||||
*
|
||||
* Checks the difference between target power and current power to
|
||||
* increase or decrease the duty cycle. The amount of decrease or increase
|
||||
* is set by setPowerSetps() (default = 2).
|
||||
*/
|
||||
void runMotorControl();
|
||||
/**
|
||||
* @brief Stops the motor like setTargetPower() to 0
|
||||
*
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* @brief Set the minimum duty cycle
|
||||
*
|
||||
* @param min duty cycle in percent
|
||||
*/
|
||||
void setMinPwm(uint8_t min);
|
||||
/**
|
||||
* @brief Stops the motor immediately
|
||||
*
|
||||
*/
|
||||
void emergencyStop();
|
||||
|
||||
/**
|
||||
* @brief Set the maximum duty cycle
|
||||
*
|
||||
* @param max duty cycle in percent
|
||||
*/
|
||||
void setMaxPwm(uint8_t max);
|
||||
/**
|
||||
* @brief Get the current power
|
||||
*
|
||||
* @return int8_t percent of power (-100 to 100)
|
||||
*/
|
||||
int8_t getPower() const { return this->power; };
|
||||
|
||||
/**
|
||||
* @brief Set the Power Steps
|
||||
*
|
||||
* Set the increment of the steps with which the dutycycle is
|
||||
* increased or decreased. Note the dependency between the increment
|
||||
* and delay().
|
||||
*
|
||||
* The formula for the time between 0% and 100% power is:
|
||||
* time[ms] = delay * ( 100 / increment )
|
||||
* 500 ms are recommended
|
||||
*
|
||||
* @see setDelay()
|
||||
*
|
||||
* @param increment
|
||||
* @return time from 0% power to 100% power in Milliseconds
|
||||
*/
|
||||
uint16_t setPowerSteps(uint8_t increment);
|
||||
/**
|
||||
* @brief Get the target power
|
||||
*
|
||||
* @return int8_t percent of power (-100 to 100)
|
||||
*/
|
||||
int8_t getTargetPower() const { return this->targetPower; };
|
||||
|
||||
/**
|
||||
* @brief Set the Target Power
|
||||
*
|
||||
* If the given power is greater than 100 or smaller than -100, then
|
||||
* this function only print an error to consol.
|
||||
*
|
||||
* @param power power in percent
|
||||
*/
|
||||
void setTargetPower(int8_t power);
|
||||
uint16_t getDutycycle() const { return this->dutycycle; }
|
||||
bool isTargetPowerReached() const;
|
||||
bool isAccelerationPositive() const;
|
||||
bool isAccelerationNegative() const;
|
||||
|
||||
/**
|
||||
* @brief Set the min delay between each loop
|
||||
*
|
||||
* Note the dependency between delay and
|
||||
* setPowerSteps().
|
||||
*
|
||||
* @see setPowerSteps()
|
||||
*
|
||||
* @param delay time in Milliseconds
|
||||
* @return time from 0% power to 100% power in Milliseconds
|
||||
*/
|
||||
uint16_t setDelay(uint8_t delay);
|
||||
private:
|
||||
void run() override;
|
||||
void setRealPower(int8_t power);
|
||||
void increasePower(int8_t power);
|
||||
|
||||
/**
|
||||
* @brief Stops the motor like setTargetPower() to 0
|
||||
*
|
||||
*/
|
||||
void stop();
|
||||
static constexpr uint8_t loopDelay = 10;
|
||||
static constexpr uint16_t pwmFreq = 16000;
|
||||
static constexpr uint8_t pwmRes = 8;
|
||||
static constexpr uint8_t powerSteps = 2; // A total of 20 levels ( 100 / SPEED_STEPS ) * RUN_MOTOR_CONTROL_DELAY = 500ms
|
||||
static constexpr uint8_t maxPwmMin = 80;
|
||||
static constexpr uint8_t maxPwmVal = 250;
|
||||
static constexpr uint8_t minPwmVal = 55; // Max 98% of 2^PWM_RES
|
||||
|
||||
/**
|
||||
* @brief Stops the motor immediately
|
||||
*
|
||||
*/
|
||||
void emergencyStop();
|
||||
|
||||
/**
|
||||
* @brief Get the current power
|
||||
*
|
||||
* @return int8_t percent of power (-100 to 100)
|
||||
*/
|
||||
int8_t getPower();
|
||||
|
||||
/**
|
||||
* @brief Get the target power
|
||||
*
|
||||
* @return int8_t percent of power (-100 to 100)
|
||||
*/
|
||||
int8_t getTargetPower();
|
||||
bool isTargetPowerReached();
|
||||
bool isAccelerationPositive();
|
||||
bool isAccelerationNegative();
|
||||
|
||||
private:
|
||||
void setRealPower(int8_t power);
|
||||
void increasePower(int8_t power);
|
||||
|
||||
int8_t target_power = 0;
|
||||
int8_t power = 0;
|
||||
uint8_t direction = 0; // 0 = stop, 1 = forward, 2 = backward
|
||||
|
||||
uint8_t pwm_pin;
|
||||
uint8_t pwm_channel;
|
||||
uint8_t pwm_res = PWMRES;
|
||||
uint8_t dutycycle_min;
|
||||
uint8_t dutycycle_max;
|
||||
uint8_t dir_1;
|
||||
uint8_t dir_2;
|
||||
uint8_t delay = DELAY;
|
||||
uint8_t powersteps = POWERSTEPS;
|
||||
|
||||
uint32_t lastMillis = 0;
|
||||
int8_t targetPower = 0;
|
||||
int8_t power = 0;
|
||||
uint8_t direction = 0; // 0 = stop, 1 = forward, 2 = backward
|
||||
|
||||
uint8_t pwmPin = 0;
|
||||
uint8_t pwmChannel = 0;
|
||||
uint16_t dutycycle = 0;
|
||||
uint8_t dir_1 = 0;
|
||||
uint8_t dir_2 = 0;
|
||||
};
|
||||
|
||||
#endif // MOTOR_CONTROL_H
|
||||
|
||||
+112
-198
@@ -11,254 +11,168 @@
|
||||
|
||||
#include "navigation.h"
|
||||
|
||||
bool Navigation::outputStatusPrintPVTdata = false;
|
||||
bool Navigation::newData = false;
|
||||
uint32_t Navigation::ubxUpdateTimeStatic = 0;
|
||||
UBX_NAV_PVT_data_t* Navigation::ubxDataStatic = nullptr;
|
||||
|
||||
Navigation::Navigation(Route* route) {
|
||||
this->gps = new SFE_UBLOX_GNSS();
|
||||
if (this->gps->begin() == false) {
|
||||
std::cout << "u-blox GNSS not detected at default I2C address. Please check wiring. Freezing." << std::endl;
|
||||
while (1);
|
||||
}
|
||||
Navigation::Navigation(const SensorData *sensorData, Route *route)
|
||||
: sensorData{sensorData}
|
||||
{
|
||||
this->init(route);
|
||||
}
|
||||
|
||||
Navigation::Navigation(SPIClass* spiPort, uint8_t csPin, Route* route) {
|
||||
this->gps = new SFE_UBLOX_GNSS();
|
||||
if (this->gps->begin(*spiPort, csPin, 4000000) == false) {
|
||||
std::cout << "u-blox GNSS not detected on SPI bus. Please check wiring. Freezing." << std::endl;
|
||||
while (1);
|
||||
}
|
||||
this->init(route);
|
||||
}
|
||||
|
||||
void Navigation::init(Route* route) {
|
||||
uint8_t versionHigh = this->gps->getProtocolVersionHigh();
|
||||
uint8_t versionLow = this->gps->getProtocolVersionLow();
|
||||
std::cout << "u-blox protocol version: " << unsigned(versionHigh) << "." << unsigned(versionLow) << std::endl;
|
||||
|
||||
// std::cout << "Set GNSS Module to factory settings... ";
|
||||
// this->gps->factoryReset();
|
||||
// delay(5000);
|
||||
// std::cout << "Complete" << std::endl;
|
||||
|
||||
this->gps->setSPIOutput(COM_TYPE_UBX);
|
||||
this->gps->enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_SPI, 10);
|
||||
this->gps->setUSBOutput(COM_TYPE_UBX | COM_TYPE_NMEA);
|
||||
this->gps->setAutoPVTcallbackPtr(&(Navigation::savePVTdata));
|
||||
// Navigation::setOutputStatusPrintPVTdata(true);
|
||||
this->gps->setNavigationFrequency(1);
|
||||
this->gps->setAutoPVT(true);
|
||||
|
||||
if (route)
|
||||
void Navigation::init(Route *route)
|
||||
{
|
||||
if (static_cast<bool>(route))
|
||||
{
|
||||
this->route = route;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->route = new Route();
|
||||
}
|
||||
|
||||
this->compass = new QMC5883LCompass();
|
||||
|
||||
// Init Compass
|
||||
Wire.beginTransmission(0x0d);
|
||||
Wire.write(0x0b);
|
||||
Wire.write(0x01);
|
||||
Wire.endTransmission();
|
||||
this->compass->setMode(0x01,0x0C,0x10,0X00);
|
||||
this->compass->setCalibration(-1903, 367, -893, 1468, -1110, 310);
|
||||
Component::loopDelay = Navigation::loopDelay;
|
||||
}
|
||||
|
||||
Navigation::~Navigation() {
|
||||
delete this->gps;
|
||||
delete this->compass;
|
||||
delete this->ntripClient;
|
||||
Navigation::~Navigation()
|
||||
{
|
||||
delete this->route;
|
||||
}
|
||||
|
||||
void Navigation::initNtrip(String host, uint16_t port, String mountPoint, String user, String password) {
|
||||
this->ntripClient = new NTRIPClient(this->gps, host.c_str(), port, mountPoint.c_str(), user.c_str(), password.c_str());
|
||||
this->ntripClient->gpsConfiguration();
|
||||
this->ntripClient->loop();
|
||||
this->ntripClient->setActivated(false);
|
||||
this->isNtripInit = true;
|
||||
}
|
||||
void Navigation::run() {}
|
||||
|
||||
void Navigation::loop() {
|
||||
this->gps->checkUblox();
|
||||
this->gps->checkCallbacks();
|
||||
|
||||
if (Navigation::newData) {
|
||||
this->updateCurrentLocation();
|
||||
Navigation::newData = false;
|
||||
}
|
||||
|
||||
if (this->ntripClient)
|
||||
this->ntripClient->loop();
|
||||
|
||||
if (millis() - this->lastMillis > AZIMUTH_UPDATE_DELAY) {
|
||||
this->compass->read();
|
||||
this->azimuth = this->compass->getAzimuth();
|
||||
this->lastMillis = millis();
|
||||
}
|
||||
}
|
||||
|
||||
void Navigation::newRoute() {
|
||||
if (this->route)
|
||||
delete this->route;
|
||||
void Navigation::newRoute()
|
||||
{
|
||||
delete this->route;
|
||||
this->route = new Route();
|
||||
}
|
||||
|
||||
bool Navigation::startNavigation() {
|
||||
Point newTargetPoint = this->route->startRoute();
|
||||
bool Navigation::startNavigation()
|
||||
{
|
||||
const Point newTargetPoint = this->route->startRoute();
|
||||
this->navigationStarted = this->setTargetPoint(newTargetPoint);
|
||||
if (this->navigationStarted)
|
||||
{
|
||||
this->navigationFinished = false;
|
||||
}
|
||||
return this->navigationStarted;
|
||||
}
|
||||
|
||||
CourseCorrection Navigation::getCourseCorrection() {
|
||||
//TODO: Check accuracy befor make something
|
||||
CourseCorrection courseCorrection = {0, 0};
|
||||
|
||||
int16_t targetCourse = this->currentPosition.courseTo(this->targetPoint);
|
||||
double distance = this->currentPosition.distanceTo(this->targetPoint);
|
||||
|
||||
if (distance < 0 || this->navigationFinished)
|
||||
return courseCorrection;
|
||||
|
||||
// Check if I need a new Point
|
||||
if (distance < MIN_DISTANCE_TO_REACH_POINT) {
|
||||
bool goOn = this->nextPoint();
|
||||
if (!goOn) {
|
||||
this->navigationFinished = true;
|
||||
this->navigationStarted = false;
|
||||
return courseCorrection; // End of navigation
|
||||
}
|
||||
Navigation::Status Navigation::getCourseCorrection(CourseCorrection &correction, bool forceUpdate)
|
||||
{
|
||||
if (this->navigationFinished)
|
||||
{
|
||||
return Status::Complete;
|
||||
}
|
||||
|
||||
// correction = targetCourse - currentCourse
|
||||
int16_t signedAzimuth = this->azimuth > 180 ? this->azimuth - 360 : this->azimuth;
|
||||
int16_t correction = targetCourse - signedAzimuth;
|
||||
if (correction > 180)
|
||||
correction -= 360;
|
||||
else if (correction < -180)
|
||||
correction += 360;
|
||||
if (this->currentPosition.getAccuracy() <= this->minAccuracy)
|
||||
{
|
||||
return Status::InsufficientAccuracy;
|
||||
}
|
||||
|
||||
courseCorrection.correction = correction;
|
||||
courseCorrection.distance = distance;
|
||||
return courseCorrection;
|
||||
// Check if the Rover has moved, if the Rover hasnt moved this function will be return.
|
||||
if (this->currentPosition.distanceTo(this->lastPointCalcCorrection) < (this->minDistanceToReachPoint) / 2 && !forceUpdate)
|
||||
{
|
||||
correction.correction = this->calculateCourseCorrection(this->lastPointCalcCorrection);
|
||||
correction.distance = this->lastPointCalcCorrection.distanceTo(this->targetPoint);
|
||||
return Status::Unchanged;
|
||||
}
|
||||
|
||||
double distance = this->currentPosition.distanceTo(this->targetPoint);
|
||||
|
||||
// Check if I need a new Point
|
||||
if (distance < this->minDistanceToReachPoint && this->preventNextPoint == false)
|
||||
{
|
||||
if (!this->nextPoint())
|
||||
{
|
||||
this->navigationFinished = true;
|
||||
this->navigationStarted = false;
|
||||
return Status::Complete; // End of navigation
|
||||
}
|
||||
distance = this->currentPosition.distanceTo(this->targetPoint);
|
||||
}
|
||||
|
||||
correction.correction = this->calculateCourseCorrection(this->currentPosition);
|
||||
correction.distance = distance;
|
||||
this->lastPointCalcCorrection = this->currentPosition;
|
||||
return Status::Updated;
|
||||
}
|
||||
|
||||
bool Navigation::addCurrentPosToRoute() {
|
||||
if (!this->currentPosition.isValid()) { return false; }
|
||||
Navigation::Status Navigation::addCurrentPosToRoute()
|
||||
{
|
||||
if (this->currentPosition.getAccuracy() <= this->minAccuracy)
|
||||
{
|
||||
return Status::InsufficientAccuracy;
|
||||
}
|
||||
|
||||
// First Point
|
||||
if (this->route->getRouteInfo().totalPoints == 0) {
|
||||
if (this->route->getRouteInfo().totalPoints == 0)
|
||||
{
|
||||
this->route->addPointToRoute(this->currentPosition);
|
||||
this->lastPoint = this->currentPosition;
|
||||
return true;
|
||||
this->lastPointRouteInsert = this->currentPosition;
|
||||
return Status::Updated;
|
||||
}
|
||||
|
||||
// Every Point after the first
|
||||
if (MIN_DISTANCE_BETWEEN_POINTS <= this->currentPosition.distanceTo(this->lastPoint)) {
|
||||
const double distance = this->currentPosition.distanceTo(this->lastPointRouteInsert);
|
||||
if (Navigation::minDisBetweenPoints <= distance && Navigation::maxDisBetweenPoints >= distance)
|
||||
{
|
||||
this->route->addPointToRoute(this->currentPosition);
|
||||
this->lastPoint = this->currentPosition;
|
||||
return true;
|
||||
this->lastPointRouteInsert = this->currentPosition;
|
||||
return Status::Updated;
|
||||
}
|
||||
return false;
|
||||
return Status::Unchanged;
|
||||
}
|
||||
|
||||
// bool Navigation::setPointBeforeTurn() {
|
||||
// if (millis() - this->currentPosition.getCreationTime() > 1000)
|
||||
// return false;
|
||||
// this->beforeTurnPoint = this->currentPosition;
|
||||
// return true;
|
||||
// }
|
||||
int16_t Navigation::calculateCourseCorrection(Point &point)
|
||||
{
|
||||
const int16_t targetCourse = point.courseTo(this->targetPoint);
|
||||
int16_t correctionCourse = 0;
|
||||
|
||||
void Navigation::updateCurrentLocation() {
|
||||
if (Navigation::ubxUpdateTimeStatic == this->ubxUpdateTime)
|
||||
return;
|
||||
if (this->sensorData->getCalcAzimuthState() == CalcAzimuth::State::Good || this->sensorData->getCalcAzimuthState() == CalcAzimuth::State::Super)
|
||||
{
|
||||
correctionCourse = targetCourse - this->sensorData->getCalcAzimuth();
|
||||
this->lastUsedCalcAzimuth = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
correctionCourse = targetCourse - this->sensorData->getRealAzimuth();
|
||||
this->lastUsedCalcAzimuth = false;
|
||||
}
|
||||
|
||||
this->ubxData = Navigation::ubxDataStatic;
|
||||
this->ubxUpdateTime = Navigation::ubxUpdateTimeStatic;
|
||||
|
||||
Point::Coordinates coords;
|
||||
coords.lat = this->ubxData->lat / 10000000.0;
|
||||
coords.lon = this->ubxData->lon / 10000000.0;
|
||||
|
||||
this->currentPosition = Point(coords, this->ubxData->hAcc);
|
||||
return Navigation::fixDegree(correctionCourse);
|
||||
}
|
||||
|
||||
bool Navigation::nextPoint() {
|
||||
bool Navigation::nextPoint()
|
||||
{
|
||||
if (!this->navigationStarted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return this->setTargetPoint(this->route->getNextPoint());
|
||||
}
|
||||
|
||||
bool Navigation::setTargetPoint(Point target) {
|
||||
if (target.isValid()) {
|
||||
bool Navigation::setTargetPoint(Point target)
|
||||
{
|
||||
if (target.isInit())
|
||||
{
|
||||
this->targetPoint = target;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Navigation::setOutputStatusPrintPVTdata(bool status) {
|
||||
Navigation::outputStatusPrintPVTdata = status;
|
||||
int16_t Navigation::fixDegree(int16_t degree)
|
||||
{
|
||||
static constexpr uint16_t fullCircle = 360;
|
||||
|
||||
while (degree < -fullCircle / 2 || degree > fullCircle / 2)
|
||||
{
|
||||
if (degree > fullCircle / 2)
|
||||
{
|
||||
degree -= fullCircle;
|
||||
}
|
||||
else if (degree < -fullCircle / 2)
|
||||
{
|
||||
degree += fullCircle;
|
||||
}
|
||||
}
|
||||
return degree;
|
||||
}
|
||||
|
||||
void Navigation::printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct) {
|
||||
if (!Navigation::outputStatusPrintPVTdata)
|
||||
return;
|
||||
|
||||
double latitude = (double) ubxDataStruct->lat / 10000000.0;
|
||||
double longitude = (double) ubxDataStruct->lon / 10000000.0;
|
||||
double altitude = (double) ubxDataStruct->hMSL / 1000.0;
|
||||
|
||||
uint8_t fixType = ubxDataStruct->fixType;
|
||||
char fixTypeString[32];
|
||||
if (fixType == 0)
|
||||
strcpy(fixTypeString, "None");
|
||||
else if (fixType == 1)
|
||||
strcpy(fixTypeString, "Dead Reckoning");
|
||||
else if (fixType == 2)
|
||||
strcpy(fixTypeString, "2D");
|
||||
else if (fixType == 3)
|
||||
strcpy(fixTypeString, "3D");
|
||||
else if (fixType == 3)
|
||||
strcpy(fixTypeString, "GNSS + Dead Reckoning");
|
||||
else if (fixType == 5)
|
||||
strcpy(fixTypeString, "Time Only");
|
||||
else
|
||||
strcpy(fixTypeString, "UNKNOWN");
|
||||
|
||||
uint8_t carrSoln = ubxDataStruct->flags.bits.carrSoln;
|
||||
char carrSolnString[16];
|
||||
if (carrSoln == 0)
|
||||
strcpy(carrSolnString, "None");
|
||||
else if (carrSoln == 1)
|
||||
strcpy(carrSolnString, "Floating");
|
||||
else if (carrSoln == 2)
|
||||
strcpy(carrSolnString, "Fixed");
|
||||
else
|
||||
strcpy(carrSolnString, "UNKNOWN");
|
||||
|
||||
uint32_t hAcc = ubxDataStruct->hAcc;
|
||||
|
||||
std::cout << "Lat: " << latitude
|
||||
<< " Lng: " << longitude
|
||||
<< " Alt: " << altitude << std::endl;
|
||||
|
||||
std::cout << "Fix: " << fixTypeString
|
||||
<< " Carrier Solution: " << carrSolnString
|
||||
<< " Horizontal Accuracy Estimate: " << hAcc << " mm" << std::endl;
|
||||
}
|
||||
|
||||
void Navigation::savePVTdata(UBX_NAV_PVT_data_t *ubxDataStruct) {
|
||||
Navigation::printPVTdata(ubxDataStruct);
|
||||
|
||||
Navigation::newData = true;
|
||||
Navigation::ubxDataStatic = ubxDataStruct;
|
||||
Navigation::ubxUpdateTimeStatic = millis();
|
||||
}
|
||||
|
||||
|
||||
+106
-184
@@ -12,25 +12,12 @@
|
||||
#ifndef NAVIGATION_H
|
||||
#define NAVIGATION_H
|
||||
|
||||
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
|
||||
#include <QMC5883LCompass.h>
|
||||
#include <Arduino.h>
|
||||
#include <iostream>
|
||||
#include <SPI.h>
|
||||
|
||||
#include "route.h"
|
||||
#include "NTRIPClient.h"
|
||||
|
||||
/**
|
||||
* @brief The minimal distance between Points
|
||||
*
|
||||
* This is a very critical option. It have to be
|
||||
* around the half accuracy of the positioning system
|
||||
*
|
||||
*/
|
||||
#define MIN_DISTANCE_BETWEEN_POINTS 0.1
|
||||
#define MIN_DISTANCE_TO_REACH_POINT 3 // TODO: Only for testing!
|
||||
#define AZIMUTH_UPDATE_DELAY 20
|
||||
#include "sensorData.h"
|
||||
#include "component.h"
|
||||
|
||||
/**
|
||||
* @brief This struct inherits the result of the navigation
|
||||
@@ -39,7 +26,8 @@
|
||||
* correct the direction in dependency on this.
|
||||
*
|
||||
*/
|
||||
struct CourseCorrection {
|
||||
struct CourseCorrection
|
||||
{
|
||||
int16_t correction;
|
||||
double distance;
|
||||
};
|
||||
@@ -47,195 +35,129 @@ struct CourseCorrection {
|
||||
/**
|
||||
* @brief This class navigate an object
|
||||
*
|
||||
* The class use the given Route and the gps device
|
||||
* The class use the given Route and the gnss device
|
||||
* to tell the driver in which direction he have to
|
||||
* be drive and the distance to the next checkpoint.
|
||||
*
|
||||
*/
|
||||
class Navigation {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Navigation object and using I2C
|
||||
*
|
||||
* @param route with which to navigate
|
||||
*/
|
||||
Navigation(Route* route = nullptr);
|
||||
class Navigation : public Component
|
||||
{
|
||||
public:
|
||||
enum Status
|
||||
{
|
||||
InsufficientAccuracy,
|
||||
Unchanged,
|
||||
Updated,
|
||||
Complete
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Construct a new Navigation object and using SPI
|
||||
*
|
||||
* @param route with which to navigate
|
||||
*/
|
||||
Navigation(SPIClass* spiPort, uint8_t csPin, Route* route = nullptr);
|
||||
/**
|
||||
* @brief Construct a new Navigation object
|
||||
*
|
||||
* @param sensorData
|
||||
* @param route
|
||||
*/
|
||||
Navigation(const SensorData *sensorData, Route *route = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Destroy the Navigation object
|
||||
*
|
||||
*/
|
||||
~Navigation();
|
||||
/**
|
||||
* @brief Destroy the Navigation object
|
||||
*
|
||||
*/
|
||||
~Navigation();
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param host
|
||||
* @param port
|
||||
* @param mountPoint
|
||||
* @param user
|
||||
* @param password
|
||||
*/
|
||||
void initNtrip(String host, uint16_t port, String mountPoint, String user, String password);
|
||||
/**
|
||||
* @brief creates a new empty route
|
||||
*
|
||||
*/
|
||||
void newRoute();
|
||||
|
||||
/**
|
||||
* @brief Decodes new GPS information
|
||||
*
|
||||
* Should be called ever main loop.
|
||||
*/
|
||||
void loop();
|
||||
/**
|
||||
* @brief Tries to start the route
|
||||
*
|
||||
* For example the route can not be started
|
||||
* if there are no Points or wrong Points.
|
||||
*
|
||||
* @return true route is started
|
||||
* @return false route can not be started
|
||||
*/
|
||||
bool startNavigation();
|
||||
void freezeTargetPoint(bool val = true) { this->preventNextPoint = val; };
|
||||
|
||||
/**
|
||||
* @brief creates a new empty route
|
||||
*
|
||||
*/
|
||||
void newRoute();
|
||||
double increaseMinDistanceToReachPoint() { return this->minDistanceToReachPoint += 0.1; }
|
||||
double decreaseMinDistanceToReachPoint() { return this->minDistanceToReachPoint -= 0.1; }
|
||||
|
||||
/**
|
||||
* @brief Tries to start the route
|
||||
*
|
||||
* For example the route can not be started
|
||||
* if there are no Points or wrong Points.
|
||||
*
|
||||
* @return true route is started
|
||||
* @return false route can not be started
|
||||
*/
|
||||
bool startNavigation();
|
||||
// TODO: Dokumentation korrigieren.
|
||||
/**
|
||||
* @brief Get the Course Correction object
|
||||
*
|
||||
* @param correction
|
||||
* @param forceUpdate
|
||||
* @return Status
|
||||
*/
|
||||
Status getCourseCorrection(CourseCorrection &correction, bool forceUpdate = false);
|
||||
|
||||
/**
|
||||
* @brief Get the Course Correction object
|
||||
*
|
||||
* This should be called by the driver to get new instructions.
|
||||
*
|
||||
* @return CourseCorrection
|
||||
*/
|
||||
CourseCorrection getCourseCorrection();
|
||||
// TODO: Dokumentation korrigieren.
|
||||
/**
|
||||
* @brief Tries to add the current Position to the route
|
||||
*
|
||||
* This can be go wrong if there is no valid GPS signal
|
||||
*
|
||||
* @return true successful added point
|
||||
* @return false no point added to route
|
||||
*/
|
||||
Status addCurrentPosToRoute();
|
||||
|
||||
/**
|
||||
* @brief Tries to add the current Position to the route
|
||||
*
|
||||
* This can be go wrong if there is no valid GPS signal
|
||||
*
|
||||
* @return true successful added point
|
||||
* @return false no point added to route
|
||||
*/
|
||||
bool addCurrentPosToRoute();
|
||||
/**
|
||||
* @brief Get the Route Info object
|
||||
*
|
||||
* This object contains information about the route.
|
||||
* For example the stored points.
|
||||
*
|
||||
* @return RouteInfo
|
||||
*/
|
||||
RouteInfo getRouteInfo() const { return this->route->getRouteInfo(); }
|
||||
Route *getRoute() const { return this->route; }
|
||||
Point getCurrentPosition() const { return this->currentPosition; }
|
||||
|
||||
// TODO: can be deleted?
|
||||
// bool setPointBeforeTurn();
|
||||
Point::Accuracy getMinAccuracy() const { return this->minAccuracy; }
|
||||
void setMinAccuracy(Point::Accuracy accuracy) { this->minAccuracy = accuracy; }
|
||||
|
||||
/**
|
||||
* @brief Get the Ubx Data object
|
||||
*
|
||||
* This struct includes the most Data from the GNSS-Module.
|
||||
*
|
||||
* @return UBX_NAV_PVT_data_t*
|
||||
*/
|
||||
UBX_NAV_PVT_data_t* getUbxData() { return this->ubxData; }
|
||||
// map input in range from -180 to 180 degree
|
||||
static int16_t fixDegree(int16_t degree);
|
||||
|
||||
/**
|
||||
* @brief Returns the NTRIPClient object
|
||||
*
|
||||
* @return NTRIPClient*
|
||||
*/
|
||||
NTRIPClient* getNTRIPClient() { return this->ntripClient; }
|
||||
private:
|
||||
void run() override;
|
||||
void init(Route *route);
|
||||
bool nextPoint();
|
||||
bool setTargetPoint(Point target);
|
||||
int16_t calculateCourseCorrection(Point &point);
|
||||
|
||||
/**
|
||||
* @brief Get the Route Info object
|
||||
*
|
||||
* This object contains information about the route.
|
||||
* For example the stored points.
|
||||
*
|
||||
* @return RouteInfo
|
||||
*/
|
||||
RouteInfo getRouteInfo() const { return this->route->getRouteInfo(); }
|
||||
Route* getRoute() const { return this->route; }
|
||||
static constexpr uint8_t loopDelay = 20;
|
||||
static constexpr uint8_t maxDisBetweenPoints = 10;
|
||||
static constexpr float minDisBetweenPoints = 0.3;
|
||||
|
||||
/**
|
||||
* @brief Get azimuth
|
||||
*
|
||||
* This value represents the angle between north and
|
||||
* the line of sight. Clockwise.
|
||||
*
|
||||
* @return uint16_t degree
|
||||
*/
|
||||
uint16_t getAzimuth() const { return this->azimuth; }
|
||||
const SensorData *sensorData;
|
||||
Route *route = nullptr;
|
||||
|
||||
/**
|
||||
* @brief Set the output status for PVTdata.
|
||||
*
|
||||
* If this is true, a lot of information from the gnss module will be printed in
|
||||
* the interval of navigation frequency.
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
static void setOutputStatusPrintPVTdata(bool status);
|
||||
Point lastPointRouteInsert;
|
||||
Point lastPointCalcCorrection;
|
||||
Point lastPointDrivingDirectionChange;
|
||||
Point targetPoint;
|
||||
Point currentPosition;
|
||||
Point::Accuracy minAccuracy = Point::Accuracy::twoDigOfCM;
|
||||
|
||||
private:
|
||||
void updateCurrentLocation();
|
||||
bool navigationStarted = false;
|
||||
bool navigationFinished = false;
|
||||
bool isNtripInit = false;
|
||||
bool preventNextPoint = false;
|
||||
bool directionChangeMode = false;
|
||||
bool lastUsedCalcAzimuth = false;
|
||||
|
||||
/**
|
||||
* @brief Set the next point as target
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool nextPoint();
|
||||
uint8_t timeToWait = 200;
|
||||
uint32_t lastMillis = 0;
|
||||
uint32_t ubxUpdateTime = 0;
|
||||
|
||||
/**
|
||||
* @brief Set the target point
|
||||
*
|
||||
* @param target
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool setTargetPoint(Point target);
|
||||
|
||||
void init(Route* route);
|
||||
|
||||
SFE_UBLOX_GNSS* gps;
|
||||
UBX_NAV_PVT_data_t* ubxData = nullptr;
|
||||
Route* route = nullptr;
|
||||
NTRIPClient* ntripClient = nullptr;
|
||||
QMC5883LCompass* compass;
|
||||
|
||||
Point lastPoint;
|
||||
Point targetPoint;
|
||||
Point currentPosition;
|
||||
Point beforeTurnPoint;
|
||||
|
||||
|
||||
bool navigationStarted = false;
|
||||
bool navigationFinished = false;
|
||||
bool isNtripInit = false;
|
||||
|
||||
char* host;
|
||||
char* mountPoint;
|
||||
char* user;
|
||||
char* password;
|
||||
|
||||
uint8_t timeToWait = 200;
|
||||
uint16_t port;
|
||||
uint16_t azimuth = UINT16_MAX;
|
||||
uint32_t lastMillis = 0;
|
||||
uint32_t ubxUpdateTime = 0;
|
||||
|
||||
static void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct);
|
||||
static void savePVTdata(UBX_NAV_PVT_data_t *ubxDataStruct);
|
||||
|
||||
static UBX_NAV_PVT_data_t* ubxDataStatic;
|
||||
|
||||
static uint32_t ubxUpdateTimeStatic;
|
||||
|
||||
static bool outputStatusPrintPVTdata;
|
||||
static bool newData;
|
||||
double minDistanceToReachPoint = 0.5;
|
||||
};
|
||||
|
||||
#endif // NAVIGATION_H
|
||||
|
||||
@@ -1,178 +0,0 @@
|
||||
/**
|
||||
* @file route.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Implements the class Route and Point
|
||||
* @version 0.1
|
||||
* @date 2022-01-31
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#include "route.h"
|
||||
|
||||
Point::Point(double lat, double lon, uint32_t horizontalAccuracy) {
|
||||
this->coordinates.lat = lat;
|
||||
this->coordinates.lon = lon;
|
||||
this->init(horizontalAccuracy);
|
||||
}
|
||||
|
||||
Point::Point(int32_t lat, int32_t lon, uint32_t horizontalAccuracy) {
|
||||
this->coordinates.lat = lat / 10000000.0;
|
||||
this->coordinates.lon = lon / 10000000.0;
|
||||
this->init(horizontalAccuracy);
|
||||
}
|
||||
|
||||
Point::Point(Coordinates coords, uint32_t horizontalAccuracy) {
|
||||
this->coordinates = coords;
|
||||
this->init(horizontalAccuracy);
|
||||
}
|
||||
|
||||
Point::Point(Coordinates coords, bool imported) {
|
||||
this->coordinates = coords;
|
||||
if (imported)
|
||||
this->init(UINT32_MAX);
|
||||
else
|
||||
this->init(0);
|
||||
}
|
||||
|
||||
Point::Point() {
|
||||
this->coordinates.lat = 0;
|
||||
this->coordinates.lon = 0;
|
||||
this->init(0);
|
||||
}
|
||||
|
||||
bool Point::operator==(const Point& rhs) const {
|
||||
return this->coordinates == rhs.getCoordinates();
|
||||
}
|
||||
|
||||
// distance = sqrt(dx * dx + dy * dy)
|
||||
// mit distance: Entfernung in km
|
||||
// dx = 111.3 * cos(lat) * (lon1 - lon2)
|
||||
// lat = (lat1 + lat2) / 2 * 0.01745
|
||||
// dy = 111.3 * (lat1 - lat2)
|
||||
// lat1, lat2, lon1, lon2: Breite, Länge in Grad
|
||||
double Point::distanceTo(const Coordinates& point) const {
|
||||
Coordinates begin = this->coordinates;
|
||||
Coordinates end = point;
|
||||
|
||||
double lat = (begin.lat + end.lat) / 2 * ROUTE_DEGREE_TO_RADIANT;
|
||||
double dy = ROUTE_DISTANCE_BETWEEN_LATITUDE * (begin.lat - end.lat);
|
||||
double dx = ROUTE_DISTANCE_BETWEEN_LATITUDE * cos(lat) * (begin.lon - end.lon);
|
||||
|
||||
return sqrt(dx * dx + dy * dy);
|
||||
}
|
||||
|
||||
double Point::distanceTo(const Point &point) const {
|
||||
return this->distanceTo(point.getCoordinates());
|
||||
}
|
||||
|
||||
int16_t Point::courseTo(const Coordinates& point) const {
|
||||
Coordinates begin = this->coordinates;
|
||||
Coordinates end = point;
|
||||
|
||||
double phi = log( tan(end.lat * ROUTE_DEGREE_TO_RADIANT / 2 + ROUTE_PI / 4) / tan(begin.lat * ROUTE_DEGREE_TO_RADIANT / 2 + ROUTE_PI / 4) );
|
||||
double lon = (begin.lon * ROUTE_DEGREE_TO_RADIANT - end.lon * ROUTE_DEGREE_TO_RADIANT);
|
||||
|
||||
int16_t res = (int16_t) atan2(lon, phi) / ROUTE_DEGREE_TO_RADIANT;
|
||||
|
||||
// if (res < 0)
|
||||
// res += 360;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
int16_t Point::courseTo(const Point &point) const {
|
||||
return this->courseTo(point.getCoordinates());
|
||||
}
|
||||
|
||||
void Point::init(uint32_t horizontalAccuracy) {
|
||||
this->creationTime = millis();
|
||||
|
||||
if (horizontalAccuracy == UINT32_MAX)
|
||||
this->accuracy = PointAccuracy::imported;
|
||||
else if (horizontalAccuracy > 9999)
|
||||
this->accuracy = PointAccuracy::fourDigOfCM;
|
||||
else if (horizontalAccuracy > 999)
|
||||
this->accuracy = PointAccuracy::threeDigOfCM;
|
||||
else if (horizontalAccuracy > 99)
|
||||
this->accuracy = PointAccuracy::twoDigOfCM;
|
||||
else
|
||||
this->accuracy = PointAccuracy::oneDigOfCM;
|
||||
|
||||
}
|
||||
|
||||
Route::Route() {
|
||||
|
||||
}
|
||||
|
||||
void Route::addPointToRoute(Point point) {
|
||||
this->points.push_back(point);
|
||||
}
|
||||
|
||||
void Route::clear() {
|
||||
this->points.clear();
|
||||
this->currentPoint = 0;
|
||||
this->started = false;
|
||||
}
|
||||
|
||||
Point Route::startRoute() {
|
||||
if (this->points.size() < 1) {
|
||||
this->started = false;
|
||||
return Point();
|
||||
}
|
||||
|
||||
this->it = this->points.begin();
|
||||
this->currentPoint = 1;
|
||||
this->started = true;
|
||||
return *this->it;
|
||||
}
|
||||
|
||||
Point Route::endRoute() {
|
||||
if (this->points.size() < 1) {
|
||||
this->started = false;
|
||||
return Point();
|
||||
}
|
||||
|
||||
this->it = this->points.end();
|
||||
// TODO: Understand why i have to decrement the iterator first to get realy the last element.
|
||||
this->it--;
|
||||
this->currentPoint = this->points.size();
|
||||
this->started = true;
|
||||
return *this->it;
|
||||
}
|
||||
|
||||
Point Route::getNextPoint() {
|
||||
if (!this->started)
|
||||
return Point();
|
||||
|
||||
if (this->it != this->points.end()) {
|
||||
this->it++;
|
||||
this->currentPoint++;
|
||||
return *this->it;
|
||||
// } else if (this->it == this->points.end() && this->currentPoint != this->points.size()) {
|
||||
// this->currentPoint++;
|
||||
// return *this->it;
|
||||
} else
|
||||
return Point();
|
||||
}
|
||||
|
||||
Point Route::getPreviousPoint() {
|
||||
if (!this->started)
|
||||
return Point();
|
||||
|
||||
if (this->it != this->points.begin()) {
|
||||
this->it--;
|
||||
this->currentPoint--;
|
||||
return *this->it;
|
||||
} else {
|
||||
return Point();
|
||||
}
|
||||
}
|
||||
|
||||
RouteInfo Route::getRouteInfo() {
|
||||
RouteInfo info;
|
||||
info.totalPoints = this->points.size();
|
||||
info.currentPoint = this->currentPoint;
|
||||
return info;
|
||||
}
|
||||
@@ -1,240 +0,0 @@
|
||||
/**
|
||||
* @file route.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains the class Point and Route
|
||||
* @version 0.1
|
||||
* @date 2022-01-31
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ROUTE_H
|
||||
#define ROUTE_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
#include <cmath>
|
||||
|
||||
#define ROUTE_DEGREE_TO_RADIANT 0.01745
|
||||
#define ROUTE_DISTANCE_BETWEEN_LATITUDE 111300
|
||||
#define ROUTE_PI 3.14159265358979323846
|
||||
|
||||
/**
|
||||
* @brief A to handle points on the earth
|
||||
*
|
||||
* The points inherits latidue and longitude as doubles
|
||||
*
|
||||
*/
|
||||
class Point{
|
||||
public:
|
||||
/**
|
||||
* @brief Hold the data longitude and latitude
|
||||
*
|
||||
*/
|
||||
struct Coordinates {
|
||||
double lon;
|
||||
double lat;
|
||||
|
||||
bool operator==(const Coordinates rhs) const {
|
||||
return ( this->lon == rhs.lon ) && ( this->lon == rhs.lon );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The Accuracy is set by the constructor
|
||||
*
|
||||
*/
|
||||
enum PointAccuracy {
|
||||
none,
|
||||
fourDigOfCM,
|
||||
threeDigOfCM,
|
||||
twoDigOfCM,
|
||||
oneDigOfCM,
|
||||
imported
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief Construct a new Point object
|
||||
*
|
||||
* @param lat latitude
|
||||
* @param lon longitude
|
||||
* @param horizontalAccuracy mm
|
||||
* @param coords Coordinates
|
||||
* @param imported if true than highest accuracy
|
||||
*/
|
||||
Point(double lat, double lon, uint32_t horizontalAccuracy = 0);
|
||||
Point(int32_t lat, int32_t lon, uint32_t horizontalAccuracy = 0);
|
||||
Point(Coordinates coords, uint32_t horizontalAccuracy = 0);
|
||||
Point(Coordinates coords, bool imported);
|
||||
Point();
|
||||
|
||||
/**
|
||||
* @brief Checks if to points are equal.
|
||||
*
|
||||
* @param rhs
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool operator==(const Point& rhs) const;
|
||||
|
||||
/**
|
||||
* @brief Checks if the point is initalized.
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool isInit() const { return this->coordinates.lat + this->coordinates.lon; }
|
||||
|
||||
/**
|
||||
* @brief Checks if the point is valid.
|
||||
*
|
||||
* If the accuracy is higher than zero, true will be returned.
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool isValid() const { return (this->accuracy > 0) ? true : false; }
|
||||
|
||||
/**
|
||||
* @brief Calculates the distance between to points.
|
||||
*
|
||||
* @param point
|
||||
* @return double meter
|
||||
*/
|
||||
double distanceTo(const Coordinates& point) const;
|
||||
double distanceTo(const Point& point) const;
|
||||
|
||||
/**
|
||||
* @brief Calculates the course to an other point.
|
||||
*
|
||||
* @param point
|
||||
* @return int16_t degree
|
||||
*/
|
||||
int16_t courseTo(const Coordinates& point) const;
|
||||
int16_t courseTo(const Point& point) const;
|
||||
|
||||
uint32_t getCreationTime() const { return this->creationTime; }
|
||||
double getLongitude() const { return this->coordinates.lon; }
|
||||
double getLatitude() const { return this->coordinates.lat; }
|
||||
Coordinates getCoordinates() const { return this->coordinates; }
|
||||
|
||||
/**
|
||||
* @brief Get the Accuracy object
|
||||
*
|
||||
* The higher the value, the greater the accuracy.
|
||||
* You can check it by PointAccuracy.
|
||||
*
|
||||
* @return PointAccuracy
|
||||
*/
|
||||
PointAccuracy getAccuracy() { return this->accuracy; }
|
||||
|
||||
private:
|
||||
void init(uint32_t horizontalAccuracy);
|
||||
|
||||
PointAccuracy accuracy = PointAccuracy::none;
|
||||
Coordinates coordinates;
|
||||
|
||||
uint32_t creationTime = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Holds some route information
|
||||
*
|
||||
*/
|
||||
struct RouteInfo{
|
||||
/**
|
||||
* @brief Selected number of Points
|
||||
*/
|
||||
uint16_t currentPoint;
|
||||
|
||||
/**
|
||||
* @brief Total points stored in route
|
||||
*/
|
||||
uint16_t totalPoints;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A class to manage multiple points
|
||||
*
|
||||
* The list of point presents a route which can be driven
|
||||
*/
|
||||
class Route {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Route object.
|
||||
*/
|
||||
Route();
|
||||
|
||||
/**
|
||||
* @brief Adds a point to the list.
|
||||
*
|
||||
* @param point
|
||||
*/
|
||||
void addPointToRoute(Point point);
|
||||
|
||||
/**
|
||||
* @brief Delete all points.
|
||||
*
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* @brief Select the first point as target.
|
||||
*
|
||||
* @return Point
|
||||
*/
|
||||
Point startRoute();
|
||||
|
||||
/**
|
||||
* @brief Select the last point as target.
|
||||
*
|
||||
* @return Point
|
||||
*/
|
||||
Point endRoute();
|
||||
|
||||
/**
|
||||
* @brief Get the next point and set it as target.
|
||||
*
|
||||
* @return Point is zero if there are no more Points.
|
||||
*/
|
||||
Point getNextPoint();
|
||||
|
||||
/**
|
||||
* @brief Get the previous point and set it as target.
|
||||
*
|
||||
* @return Point
|
||||
*/
|
||||
Point getPreviousPoint();
|
||||
|
||||
/**
|
||||
* @brief Get the Route Info object
|
||||
*
|
||||
* @return RouteInfo
|
||||
*/
|
||||
RouteInfo getRouteInfo();
|
||||
|
||||
/**
|
||||
* @brief Get the Started object
|
||||
*
|
||||
* The Route will be marked as started when startRoute or
|
||||
* endRoute has been called.
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool getStarted() const { return this->started; }
|
||||
|
||||
private:
|
||||
uint16_t currentPoint = 0;
|
||||
bool started = false;
|
||||
|
||||
std::list<Point> points;
|
||||
std::list<Point>::iterator it;
|
||||
|
||||
};
|
||||
|
||||
#endif // ROUTE_H
|
||||
@@ -0,0 +1,201 @@
|
||||
/**
|
||||
* @file network.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-18
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "network.h"
|
||||
|
||||
Network::Network(const char *ssid, const char *passphrase)
|
||||
{
|
||||
if (!WiFiGenericClass::mode(WIFI_AP_STA))
|
||||
{
|
||||
std::cout << "Network::connectWiFi failed WiFi.mode" << std::endl;
|
||||
}
|
||||
|
||||
this->init(ssid, passphrase);
|
||||
}
|
||||
|
||||
Network::Network(const char *ssid, const char *passphrase, NetworkAddresses adresses)
|
||||
: addresses{adresses}
|
||||
{
|
||||
if (!WiFiGenericClass::mode(WIFI_AP_STA))
|
||||
{
|
||||
std::cout << "Network::connectWiFi failed WiFi.mode" << std::endl;
|
||||
}
|
||||
|
||||
if (!WiFi.config(this->addresses.localIP,
|
||||
this->addresses.gateway,
|
||||
this->addresses.subnet,
|
||||
this->addresses.dnsServer))
|
||||
{
|
||||
std::cout << "STA Failed to configure" << std::endl;
|
||||
}
|
||||
|
||||
this->init(ssid, passphrase);
|
||||
}
|
||||
|
||||
Network::~Network()
|
||||
{
|
||||
delete mqttClient;
|
||||
}
|
||||
|
||||
bool Network::activateEspNow(receiveCallbackPtr reci, sendCallbackPtr send)
|
||||
{
|
||||
if (esp_now_init() != ESP_OK)
|
||||
{
|
||||
std::cout << "Network::activateEspNow - Error initializing ESP-NOW" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
esp_now_register_send_cb(send);
|
||||
|
||||
esp_now_peer_info_t peerInfo = {};
|
||||
memcpy(static_cast<void *>(peerInfo.peer_addr), static_cast<const void *>(this->broadcastAddress), 6);
|
||||
peerInfo.channel = 0;
|
||||
peerInfo.encrypt = false;
|
||||
|
||||
if (esp_now_add_peer(&peerInfo) != ESP_OK)
|
||||
{
|
||||
std::cout << "Network::connectEspNow - Failed to add peer" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
esp_now_register_recv_cb(reci);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Network::activateMqtt(const char *user, const char *passphrase)
|
||||
{
|
||||
this->mqttUser = user;
|
||||
this->mqttPassphrase = passphrase;
|
||||
|
||||
this->mqttClient = new PubSubClient(this->wifiClient);
|
||||
this->mqttClient->setServer(this->addresses.mqttServer, this->addresses.mqttPort);
|
||||
this->mqttClient->setSocketTimeout(1);
|
||||
|
||||
if (this->wifiConnected)
|
||||
{
|
||||
return this->connectMqtt();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const void Network::printIPs()
|
||||
{
|
||||
std::cout << std::endl;
|
||||
if (!this->wifiConnected)
|
||||
{
|
||||
std::cout << "WiFi is not connected." << std::endl;
|
||||
return;
|
||||
}
|
||||
std::cout << "WiFi is connected to" << std::endl;
|
||||
std::cout << "IP address: " << std::endl;
|
||||
std::cout << WiFi.localIP().toString().c_str() << std::endl;
|
||||
std::cout << "WiFi MAC Address: " << WiFi.macAddress().c_str() << std::endl
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
uint8_t Network::getCurrentChannel()
|
||||
{
|
||||
uint8_t channel = 0;
|
||||
wifi_second_chan_t secondChannel = WIFI_SECOND_CHAN_NONE;
|
||||
if (esp_wifi_get_channel(&channel, &secondChannel) != ESP_OK)
|
||||
{
|
||||
std::cout << "Network::getCurrentChannel - Error!" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
||||
void Network::runAsChild()
|
||||
{
|
||||
if (!this->initSuccessful)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->checkWifi();
|
||||
|
||||
if (this->wifiConnected && static_cast<bool>(this->mqttClient))
|
||||
{
|
||||
this->checkMqtt();
|
||||
}
|
||||
}
|
||||
|
||||
void Network::init(const char *ssid, const char *passphrase)
|
||||
{
|
||||
// Connect to Wi-Fi network with SSID and password
|
||||
std::cout << "Connecting to " << ssid << std::endl;
|
||||
WiFi.begin(ssid, passphrase);
|
||||
uint8_t timeout = Network::wifiConnectTimeout;
|
||||
while (WiFiSTAClass::status() != WL_CONNECTED)
|
||||
{
|
||||
delay(Network::wifiConnectLoopTime);
|
||||
std::cout << "." << std::flush;
|
||||
timeout--;
|
||||
if (timeout == 0)
|
||||
{
|
||||
std::cout << std::endl;
|
||||
std::cout << "WiFi NOT connected." << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this->wifiConnected = true;
|
||||
this->printIPs();
|
||||
}
|
||||
|
||||
void Network::checkWifi()
|
||||
{
|
||||
if ((WiFiSTAClass::status() != WL_CONNECTED) && (millis() - this->lastWifiReconnectAttempt >= Network::wifiReconnectDelay))
|
||||
{
|
||||
std::cout << "Reconnecting to WiFi..." << std::endl;
|
||||
WiFi.disconnect();
|
||||
this->wifiConnected = WiFi.reconnect();
|
||||
this->lastWifiReconnectAttempt = millis();
|
||||
}
|
||||
}
|
||||
|
||||
void Network::checkMqtt()
|
||||
{
|
||||
if (!this->mqttClient->connected() && millis() - this->lastMqttReconnectAttempt > Network::mqttReconnectDelay)
|
||||
{
|
||||
this->mqttConnected = this->connectMqtt();
|
||||
this->lastMqttReconnectAttempt = millis();
|
||||
}
|
||||
|
||||
if (this->mqttConnected)
|
||||
{
|
||||
this->mqttClient->loop();
|
||||
}
|
||||
}
|
||||
|
||||
bool Network::connectMqtt()
|
||||
{
|
||||
String clientId = "ESP32Rover-";
|
||||
clientId += String(random(), HEX);
|
||||
|
||||
if (static_cast<bool>(this->mqttUser))
|
||||
{
|
||||
if (this->mqttClient->connect(clientId.c_str(), this->mqttUser, this->mqttPassphrase))
|
||||
{
|
||||
this->mqttClient->publish("Rover/Info", "Connected to Mqtt-Broker");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this->mqttClient->connect(clientId.c_str()))
|
||||
{
|
||||
this->mqttClient->publish("Rover/Info", "Connected to Mqtt-Broker");
|
||||
}
|
||||
}
|
||||
|
||||
return this->mqttClient->connected();
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* @file network.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-18
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef NETWORK_H
|
||||
#define NETWORK_H
|
||||
|
||||
#include "component.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <WiFi.h>
|
||||
#include <PubSubClient.h>
|
||||
#include <esp_now.h>
|
||||
#include <esp_wifi.h>
|
||||
|
||||
/**
|
||||
* @brief Typedef to easy handle the receive Callback
|
||||
*/
|
||||
typedef void (*receiveCallbackPtr)(const uint8_t *mac, const uint8_t *incomingData, int len);
|
||||
|
||||
/**
|
||||
* @brief Typedef to easy handle the send Callback
|
||||
*/
|
||||
typedef void (*sendCallbackPtr)(const uint8_t *mac_addr, esp_now_send_status_t status);
|
||||
|
||||
/**
|
||||
* @brief A Struct to hold all network addresses
|
||||
*/
|
||||
struct NetworkAddresses
|
||||
{
|
||||
IPAddress localIP;
|
||||
IPAddress gateway;
|
||||
IPAddress subnet;
|
||||
IPAddress dnsServer;
|
||||
IPAddress mqttServer;
|
||||
uint16_t mqttPort = 1883;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A class to manage the wireless connections
|
||||
*/
|
||||
class Network : public Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Network object
|
||||
*
|
||||
* With this constructor the esp gets its ip from a Dhcp server
|
||||
*
|
||||
* @param ssid
|
||||
* @param passphrase
|
||||
*/
|
||||
Network(const char *ssid, const char *passphrase);
|
||||
|
||||
/**
|
||||
* @brief Construct a new Network object
|
||||
*
|
||||
* This constructor is used for a static ip setup
|
||||
*
|
||||
* @param ssid
|
||||
* @param passphrase
|
||||
* @param addresses
|
||||
*/
|
||||
Network(const char *ssid, const char *passphrase, NetworkAddresses addresses);
|
||||
|
||||
~Network();
|
||||
|
||||
/**
|
||||
* @brief Activate ESP-NOW to communicate with the remote Control
|
||||
*
|
||||
* @param receive
|
||||
* @param send
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool activateEspNow(receiveCallbackPtr receive, sendCallbackPtr send);
|
||||
|
||||
/**
|
||||
* @brief Activate MQTT to send debug messages
|
||||
*
|
||||
* @param user
|
||||
* @param passphrase
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool activateMqtt(const char *user = nullptr, const char *passphrase = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Print the current used IPs
|
||||
*/
|
||||
const void printIPs();
|
||||
|
||||
bool isWifiConnected() const { return this->wifiConnected; }
|
||||
bool isMqttConnected() const { return this->mqttConnected; }
|
||||
const uint8_t *getBroadcastAddress() const { return this->broadcastAddress; }
|
||||
PubSubClient *getMqttClient() const { return this->mqttClient; }
|
||||
|
||||
static uint8_t getCurrentChannel();
|
||||
|
||||
private:
|
||||
void run() override{};
|
||||
void runAsChild() override;
|
||||
void init(const char *ssid, const char *passphrase);
|
||||
void checkWifi();
|
||||
void checkMqtt();
|
||||
bool connectMqtt();
|
||||
|
||||
NetworkAddresses addresses;
|
||||
WiFiClient wifiClient;
|
||||
PubSubClient *mqttClient = nullptr;
|
||||
|
||||
bool initSuccessful = false;
|
||||
bool wifiConnected = false;
|
||||
bool mqttConnected = false;
|
||||
|
||||
const char *mqttUser = nullptr;
|
||||
const char *mqttPassphrase = nullptr;
|
||||
|
||||
uint8_t broadcastAddress[6] = {0xC8, 0xC9, 0xA3, 0xC8, 0x57, 0x10};
|
||||
uint32_t lastWifiReconnectAttempt = 0;
|
||||
uint32_t lastMqttReconnectAttempt = 0;
|
||||
|
||||
static constexpr uint8_t wifiConnectTimeout = 20;
|
||||
static constexpr uint16_t wifiConnectLoopTime = 500;
|
||||
static constexpr uint16_t wifiReconnectDelay = 5000;
|
||||
static constexpr uint16_t mqttReconnectDelay = 2500;
|
||||
};
|
||||
|
||||
#endif // NETWORK_H
|
||||
+283
-145
@@ -11,167 +11,232 @@
|
||||
|
||||
#include "ntripClient.h"
|
||||
|
||||
|
||||
NTRIPClient::NTRIPClient(SFE_UBLOX_GNSS* gps, const char* host, uint16_t port, const char* mountPoint, const char* user, const char* password) {
|
||||
this->gps = gps;
|
||||
NTRIPClient::NTRIPClient(SFE_UBLOX_GNSS *gnss, const char *host, uint16_t port, const char *mountPoint, const char *user, const char *password)
|
||||
: gnss{gnss}, port{port}, ntripClient{new WiFiClient}, state{NTRIPClientStates::closingConnection}
|
||||
{
|
||||
strcpy(this->host, host);
|
||||
this->port = port;
|
||||
strcpy(this->mountPoint, mountPoint);
|
||||
strcpy(this->user, user);
|
||||
strcpy(this->password, password);
|
||||
|
||||
this->ntripClient = new WiFiClient;
|
||||
this->state = NTRIPClientStates::closeConnection;
|
||||
Component::loopDelay = NTRIPClient::loopDelay;
|
||||
}
|
||||
|
||||
NTRIPClient::~NTRIPClient() {
|
||||
NTRIPClient::~NTRIPClient()
|
||||
{
|
||||
delete this->ntripClient;
|
||||
}
|
||||
|
||||
void NTRIPClient::loop() {
|
||||
if (millis() - this->lastLoopTime < this->delayTime)
|
||||
return;
|
||||
this->lastLoopTime = millis();
|
||||
|
||||
if (millis() - this->lastGPGGAPushTime > this->pushGPGGATime && this->activated) {
|
||||
this->lastGPGGAPushTime = millis();
|
||||
// std::cout << "Try to push GPGGA data." << std::endl;
|
||||
NMEA_GGA_data_t *data = new NMEA_GGA_data_t;
|
||||
DebugTimes requestGpsData;
|
||||
uint8_t res = this->gps->getLatestNMEAGPGGA(data);
|
||||
requestGpsData.stopConsol("RequestGpsData", 5);
|
||||
if (res == 2)
|
||||
this->pushGPGGA(data);
|
||||
delete data;
|
||||
}
|
||||
|
||||
switch (this->state) {
|
||||
case NTRIPClientStates::openConnection:
|
||||
if (millis() - this->lastNtripConnectTime < this->tryReconnectTime)
|
||||
break;
|
||||
|
||||
if (!this->activated) {
|
||||
this->state = NTRIPClientStates::closeConnection;
|
||||
break;
|
||||
}
|
||||
|
||||
std::cout << "Connecting to the NTRIP caster..." << std::endl;
|
||||
if (this->beginClient()) {
|
||||
std::cout << "Connected to the NTRIP caster!" << std::endl;
|
||||
this->state = NTRIPClientStates::pushData;
|
||||
} else {
|
||||
uint8_t seconds = this->tryReconnectTime / 1000;
|
||||
std::cout << "Could not connect to the caster. Trying again in "
|
||||
<< (int) seconds << " seconds." << std::endl;
|
||||
this->lastNtripConnectTime = millis();
|
||||
}
|
||||
void NTRIPClient::run()
|
||||
{
|
||||
switch (this->state)
|
||||
{
|
||||
case NTRIPClientStates::openingConnection:
|
||||
if (!this->activated)
|
||||
{
|
||||
this->state = NTRIPClientStates::closingConnection;
|
||||
break;
|
||||
}
|
||||
|
||||
case NTRIPClientStates::pushData:
|
||||
if (!processConnection() || !this->activated)
|
||||
this->state = NTRIPClientStates::closeConnection;
|
||||
break;
|
||||
std::cout << "Connecting to the NTRIP caster..." << std::endl;
|
||||
if (this->beginClient())
|
||||
{
|
||||
std::cout << "Connected to the NTRIP caster!" << std::endl;
|
||||
this->state = NTRIPClientStates::pushingData;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Failed!" << std::endl;
|
||||
this->state = NTRIPClientStates::waiting;
|
||||
this->activated = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case NTRIPClientStates::closeConnection:
|
||||
std::cout << "Closing the connection to the NTRIP caster..." << std::endl;
|
||||
this->closeConnection();
|
||||
state = NTRIPClientStates::wait;
|
||||
break;
|
||||
case NTRIPClientStates::pushingData:
|
||||
if (!processConnection() || !this->activated)
|
||||
{
|
||||
this->state = NTRIPClientStates::closingConnection;
|
||||
}
|
||||
break;
|
||||
|
||||
case NTRIPClientStates::wait:
|
||||
if (this->activated)
|
||||
this->state = NTRIPClientStates::openConnection;
|
||||
if (this->activated) {
|
||||
// std::cout << "state is openConnection" << std::endl;
|
||||
}
|
||||
break;
|
||||
case NTRIPClientStates::closingConnection:
|
||||
std::cout << "Closing the connection to the NTRIP caster..." << std::endl;
|
||||
this->closeConnection();
|
||||
state = NTRIPClientStates::waiting;
|
||||
break;
|
||||
|
||||
case NTRIPClientStates::notAvailable:
|
||||
break;
|
||||
case NTRIPClientStates::waiting:
|
||||
if (this->activated)
|
||||
{
|
||||
this->state = NTRIPClientStates::openingConnection;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->checkAutoReconnect();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cout << "Wrong state in NTRIPClient.cpp..." << std::endl;
|
||||
this->state = NTRIPClientStates::closeConnection;
|
||||
break;
|
||||
case NTRIPClientStates::notAvailable:
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cout << "Wrong state in NTRIPClient.cpp..." << std::endl;
|
||||
this->state = NTRIPClientStates::closingConnection;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void NTRIPClient::gpsConfiguration() {
|
||||
this->gps->setSPIOutput(COM_TYPE_UBX | COM_TYPE_NMEA);
|
||||
this->gps->setPortInput(COM_PORT_SPI, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3);
|
||||
void NTRIPClient::runAsChild()
|
||||
{
|
||||
this->pushGPGGA();
|
||||
}
|
||||
|
||||
void NTRIPClient::gnssConfiguration()
|
||||
{
|
||||
this->gnss->setSPIOutput(COM_TYPE_UBX | COM_TYPE_NMEA);
|
||||
this->gnss->setPortInput(COM_PORT_SPI, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3);
|
||||
// Set the differential mode - ambiguities are fixed whenever possible
|
||||
this->gps->setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED);
|
||||
this->gps->setMainTalkerID(SFE_UBLOX_MAIN_TALKER_ID_GP);
|
||||
this->gps->enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_SPI, 10);
|
||||
this->gnss->setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED);
|
||||
this->gnss->setMainTalkerID(SFE_UBLOX_MAIN_TALKER_ID_GP);
|
||||
this->gnss->enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_SPI, 10);
|
||||
}
|
||||
|
||||
bool NTRIPClient::setActivated(bool b) {
|
||||
// std::cout << "NTRIPClient::setActivated: b - " << b << std::endl;
|
||||
if (b && this->state != NTRIPClientStates::notAvailable)
|
||||
bool NTRIPClient::setActivated(bool state)
|
||||
{
|
||||
if (state && this->state != NTRIPClientStates::notAvailable)
|
||||
{
|
||||
this->activated = true;
|
||||
else if (b)
|
||||
}
|
||||
else if (state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->activated = false;
|
||||
this->autoReconnect = false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
bool NTRIPClient::beginClient() {
|
||||
void NTRIPClient::setAutoReconnect(bool state)
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
this->reconnectAttemps = 0;
|
||||
this->autoReconnect = true;
|
||||
return;
|
||||
}
|
||||
|
||||
this->autoReconnect = false;
|
||||
}
|
||||
|
||||
bool NTRIPClient::beginClient()
|
||||
{
|
||||
static constexpr uint16_t httpError = 401;
|
||||
static constexpr uint16_t httpCheck = 200;
|
||||
|
||||
std::cout << "Opening socket to " << this->host << std::endl;
|
||||
|
||||
char serverRequest[this->bufferSize];
|
||||
char credentials[this->bufferSize];
|
||||
|
||||
if (!this->ntripClient->connect(this->host, this->port)) {
|
||||
if (!static_cast<bool>(this->ntripClient->connect(static_cast<const char *>(this->host), this->port)))
|
||||
{
|
||||
std::cout << "Connection to caster failed" << std::endl;
|
||||
return false;
|
||||
} else {
|
||||
std::cout << "Connected to " << this->host << " : " << this->port << std::endl;
|
||||
std::cout << "Requesting NTRIP Data from mount point " << this->mountPoint << std::endl;
|
||||
}
|
||||
std::cout << "Connected to " << this->host << " : " << this->port << std::endl;
|
||||
std::cout << "Requesting NTRIP Data from mount point " << this->mountPoint << std::endl;
|
||||
|
||||
// Generate the server request (GET)
|
||||
snprintf(serverRequest,
|
||||
// Generate the server request (GET)
|
||||
if (this->useNtripRev1)
|
||||
{
|
||||
snprintf(static_cast<char *>(serverRequest),
|
||||
this->bufferSize,
|
||||
"GET /%s HTTP/1.0\r\nUser-Agent: NTRIP SparkFun u-blox Client v1.0\r\n",
|
||||
this->mountPoint);
|
||||
|
||||
// Credentials
|
||||
uint8_t userCredentialsLength = strlen(this->user) + strlen(this->password) + 2;
|
||||
char* userCredentials = new char[userCredentialsLength];
|
||||
snprintf(userCredentials, userCredentialsLength, "%s:%s", this->user, this->password);
|
||||
|
||||
std::cout << "Sending credentials: " << userCredentials << std::endl;
|
||||
|
||||
//Encode
|
||||
base64 b;
|
||||
String strEncodedCredentials = b.encode(userCredentials);
|
||||
delete userCredentials;
|
||||
char encodedCredentials[strEncodedCredentials.length() + 1];
|
||||
strEncodedCredentials.toCharArray(encodedCredentials, sizeof(encodedCredentials));
|
||||
|
||||
snprintf(credentials, sizeof(credentials), "Authorization: Basic %s\r\n", encodedCredentials);
|
||||
static_cast<const char *>("GET /%s HTTP/1.0\r\n\
|
||||
Host: %s:%u\r\n\
|
||||
User-Agent: NTRIP KleiaxNtripClient/0.1\r\n\
|
||||
Accept: */*\r\n\
|
||||
Connection: close\r\n"),
|
||||
this->mountPoint,
|
||||
this->host,
|
||||
this->port);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(static_cast<char *>(serverRequest),
|
||||
this->bufferSize,
|
||||
static_cast<const char *>("GET /%s HTTP/1.1\r\n\
|
||||
Host: %s:%u\r\n\
|
||||
Ntrip-Version: Ntrip/2.0\r\n\
|
||||
User-Agent: NTRIP KleiaxNtripClient/0.1\r\n\
|
||||
Accept: */*\r\n\
|
||||
Connection: close\r\n"),
|
||||
this->mountPoint,
|
||||
this->host,
|
||||
this->port);
|
||||
}
|
||||
|
||||
// Add the encoded credentials to the server request
|
||||
strncat(serverRequest, credentials, this->bufferSize);
|
||||
strncat(serverRequest, "\r\n", this->bufferSize);
|
||||
// Add own Position if activated
|
||||
if (this->transmitLocation && !this->useNtripRev1)
|
||||
{
|
||||
auto *data = new NMEA_GGA_data_t;
|
||||
const uint8_t res = this->gnss->getLatestNMEAGPGGA(data);
|
||||
if (res > 0) // valid data
|
||||
{
|
||||
char positionUpdate[this->bufferSizePushGPGGA];
|
||||
snprintf(static_cast<char *>(positionUpdate),
|
||||
this->bufferSizePushGPGGA,
|
||||
static_cast<const char *>("Ntrip-GGA: %s\r\n"),
|
||||
data->nmea);
|
||||
strncat(static_cast<char *>(serverRequest), static_cast<const char *>(positionUpdate), this->bufferSize);
|
||||
}
|
||||
delete data;
|
||||
|
||||
std::cout << "serverRequest size: "
|
||||
<< strlen(serverRequest)
|
||||
<< " of "
|
||||
<< this->bufferSize
|
||||
<< " bytes available"
|
||||
<< std::endl;
|
||||
this->lastGPGGAPushTime = millis();
|
||||
}
|
||||
|
||||
if (this->user && this->password)
|
||||
{
|
||||
// Credentials
|
||||
const uint8_t userCredentialsLength = strlen(this->user) + strlen(this->password) + 2;
|
||||
auto *userCredentials = new char[userCredentialsLength];
|
||||
snprintf(static_cast<char *>(userCredentials), userCredentialsLength, static_cast<const char *>("%s:%s"), this->user, this->password);
|
||||
|
||||
std::cout << "Sending credentials: " << userCredentials << std::endl;
|
||||
|
||||
// Encode
|
||||
const base64 base;
|
||||
const String strEncodedCredentials = base64::encode(userCredentials);
|
||||
delete userCredentials;
|
||||
char encodedCredentials[strEncodedCredentials.length() + 1];
|
||||
strEncodedCredentials.toCharArray(static_cast<char *>(encodedCredentials), sizeof(encodedCredentials));
|
||||
|
||||
snprintf(credentials, sizeof(credentials), static_cast<const char *>("Authorization: Basic %s\r\n"), static_cast<const char *>(encodedCredentials));
|
||||
|
||||
// Add the encoded credentials to the server request
|
||||
strncat(static_cast<char *>(serverRequest), static_cast<const char *>(credentials), this->bufferSize);
|
||||
}
|
||||
|
||||
strncat(static_cast<char *>(serverRequest), static_cast<const char *>("\r\n"), this->bufferSize);
|
||||
|
||||
std::cout << static_cast<const char *>("serverRequest size: ")
|
||||
<< strlen(serverRequest)
|
||||
<< static_cast<const char *>(" of ")
|
||||
<< this->bufferSize
|
||||
<< static_cast<const char *>(" bytes available")
|
||||
<< std::endl;
|
||||
|
||||
// Send the server request
|
||||
std::cout << "Sending server request: " << serverRequest << std::endl;
|
||||
this->ntripClient->write(serverRequest, strlen(serverRequest));
|
||||
|
||||
//Wait up to 5 seconds for response
|
||||
uint32_t lastMillis = millis();
|
||||
while (!ntripClient->available()) {
|
||||
if (millis() - lastMillis > this->timeOut) {
|
||||
// Wait up to 5 seconds for response
|
||||
const uint32_t lastMillis = millis();
|
||||
while (static_cast<bool>(!ntripClient->available()))
|
||||
{
|
||||
if (millis() - lastMillis > this->timeOut)
|
||||
{
|
||||
std::cout << "Caster timed out!" << std::endl;
|
||||
this->ntripClient->stop();
|
||||
return false;
|
||||
@@ -179,35 +244,48 @@ bool NTRIPClient::beginClient() {
|
||||
delay(10);
|
||||
}
|
||||
|
||||
//Check reply
|
||||
// Check reply
|
||||
uint16_t httpStatusCode = 0;
|
||||
char response[this->bufferSize];
|
||||
uint16_t responseIndex = 0;
|
||||
while (this->ntripClient->available()) {
|
||||
while (static_cast<bool>(this->ntripClient->available()))
|
||||
{
|
||||
if (responseIndex == sizeof(response))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
response[responseIndex++] = ntripClient->read();
|
||||
|
||||
if (httpStatusCode == 0) {
|
||||
if (strstr(response, "200") != nullptr)
|
||||
httpStatusCode = 200;
|
||||
if (strstr(response, "401") != nullptr)
|
||||
httpStatusCode = 401;
|
||||
if (httpStatusCode == 0)
|
||||
{
|
||||
if (strstr(response, static_cast<const char *>("200")) != nullptr)
|
||||
{
|
||||
httpStatusCode = httpCheck;
|
||||
}
|
||||
if (strstr(response, static_cast<const char *>("401")) != nullptr)
|
||||
{
|
||||
httpStatusCode = httpError;
|
||||
}
|
||||
}
|
||||
}
|
||||
response[responseIndex] = '\0';
|
||||
|
||||
// std::cout << "Caster response: " << response << std::endl;
|
||||
|
||||
if (httpStatusCode != 200) {
|
||||
std::cout << "Failed to connect to " << this->host << " - HTTP Code: " << (int) httpStatusCode
|
||||
if (httpStatusCode != httpCheck)
|
||||
{
|
||||
std::cout << "Failed to connect to " << this->host << " - HTTP Code: " << (int)httpStatusCode
|
||||
<< " Length of Response: " << responseIndex << std::endl;
|
||||
|
||||
if (httpStatusCode == 0)
|
||||
{
|
||||
std::cout << "Response: " << response << std::endl;
|
||||
else if (httpStatusCode == 401)
|
||||
}
|
||||
else if (httpStatusCode == httpError)
|
||||
{
|
||||
std::cout << "Statuscode 401 - Unauthorized" << std::endl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -216,35 +294,47 @@ bool NTRIPClient::beginClient() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void NTRIPClient::closeConnection() {
|
||||
if (this->ntripClient->connected())
|
||||
void NTRIPClient::closeConnection()
|
||||
{
|
||||
if (static_cast<bool>(this->ntripClient->connected()))
|
||||
{
|
||||
this->ntripClient->stop();
|
||||
}
|
||||
this->activated = false;
|
||||
std::cout << "NtripClient disconnected from: " << this->host << std::endl;
|
||||
}
|
||||
|
||||
bool NTRIPClient::processConnection() {
|
||||
if (this->ntripClient->connected()) {
|
||||
uint8_t rtcmData[this->bufferSize * 4];
|
||||
bool NTRIPClient::processConnection()
|
||||
{
|
||||
if (static_cast<bool>(this->ntripClient->connected()))
|
||||
{
|
||||
uint8_t rtcmData[this->bufferSize * 8];
|
||||
uint16_t rtcmCount = 0;
|
||||
|
||||
while (this->ntripClient->available()) {
|
||||
while (static_cast<bool>(this->ntripClient->available()))
|
||||
{
|
||||
rtcmData[rtcmCount++] = ntripClient->read();
|
||||
if (rtcmCount == sizeof(rtcmData))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (rtcmCount > 0) {
|
||||
if (rtcmCount > 0)
|
||||
{
|
||||
this->lastReceivedRtcmTime = millis();
|
||||
this->gps->pushRawData(rtcmData, rtcmCount);
|
||||
this->gnss->pushRawData(static_cast<uint8_t *>(rtcmData), rtcmCount);
|
||||
// std::cout << "Pushed " << rtcmCount << " RTCM bytes to ZED." << std::endl;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Connection to " << this->host << " dropped!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (millis() - this->lastReceivedRtcmTime > this->timeOut) {
|
||||
if (millis() - this->lastReceivedRtcmTime > this->timeOut)
|
||||
{
|
||||
std::cout << "RTCM timeout!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
@@ -252,15 +342,63 @@ bool NTRIPClient::processConnection() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void NTRIPClient::pushGPGGA(NMEA_GGA_data_t *nmeaData) {
|
||||
if (this->ntripClient->connected() && this->transmitLocation)
|
||||
this->ntripClient->print((const char *)nmeaData->nmea);
|
||||
else
|
||||
std::cout << "Failed to pushing GGA to server: " << (const char *)nmeaData->nmea << std::endl;
|
||||
void NTRIPClient::checkAutoReconnect()
|
||||
{
|
||||
if (!this->autoReconnect)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (millis() - this->lastReconnectTime < this->reconnectDelayTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->lastReconnectTime = millis();
|
||||
|
||||
if (this->reconnectAttemps >= this->maxReconnectAttemps)
|
||||
{
|
||||
this->autoReconnect = false;
|
||||
return;
|
||||
}
|
||||
|
||||
this->activated = true;
|
||||
this->reconnectAttemps++;
|
||||
}
|
||||
|
||||
bool NTRIPClient::isConnected() {
|
||||
if (this->state == NTRIPClientStates::pushData)
|
||||
return true;
|
||||
return false;
|
||||
void NTRIPClient::pushGPGGA()
|
||||
{
|
||||
if (!this->transmitLocation && !this->activated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (millis() - this->lastGPGGAPushTime < this->pushGPGGATime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->lastGPGGAPushTime = millis();
|
||||
|
||||
if (!this->ntripClient->connected())
|
||||
{
|
||||
std::cout << "Failed to pushing GGA to server: " << std::endl;
|
||||
}
|
||||
|
||||
auto *data = new NMEA_GGA_data_t;
|
||||
const uint8_t res = this->gnss->getLatestNMEAGPGGA(data);
|
||||
if (res == 2) // 2 means fresh data
|
||||
{
|
||||
char positionUpdate[this->bufferSizePushGPGGA];
|
||||
snprintf(static_cast<char *>(positionUpdate),
|
||||
this->bufferSizePushGPGGA,
|
||||
static_cast<const char *>("%s\r\n"),
|
||||
data->nmea);
|
||||
this->ntripClient->write(positionUpdate, strlen(positionUpdate));
|
||||
std::cout << "Position update: " << positionUpdate << std::endl;
|
||||
}
|
||||
delete data;
|
||||
}
|
||||
|
||||
bool NTRIPClient::isConnected()
|
||||
{
|
||||
return this->state == NTRIPClientStates::pushingData;
|
||||
}
|
||||
|
||||
@@ -19,17 +19,19 @@
|
||||
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
|
||||
|
||||
#include "debugTimes.h"
|
||||
#include "component.h"
|
||||
|
||||
/**
|
||||
* @brief States for the state machine.
|
||||
*
|
||||
*/
|
||||
enum NTRIPClientStates {
|
||||
openConnection,
|
||||
pushData,
|
||||
closeConnection,
|
||||
wait,
|
||||
notAvailable
|
||||
enum NTRIPClientStates
|
||||
{
|
||||
openingConnection,
|
||||
pushingData,
|
||||
closingConnection,
|
||||
waiting,
|
||||
notAvailable
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -39,93 +41,98 @@ enum NTRIPClientStates {
|
||||
* data and push it to a given gnss module. This module have to be compatible
|
||||
* with the SparkFun u-blox GNSS Arduino Library.
|
||||
*/
|
||||
class NTRIPClient {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new NTRIPClient object
|
||||
*
|
||||
* @param gps The Gnss module
|
||||
* @param host
|
||||
* @param port
|
||||
* @param mountPoint
|
||||
* @param user
|
||||
* @param password
|
||||
*/
|
||||
NTRIPClient(SFE_UBLOX_GNSS* gps, const char* host, uint16_t port, const char* mountPoint, const char* user, const char* password);
|
||||
~NTRIPClient();
|
||||
class NTRIPClient : public Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new NTRIPClient object
|
||||
*
|
||||
* @param gnss The Gnss module
|
||||
* @param host
|
||||
* @param port
|
||||
* @param mountPoint
|
||||
* @param user
|
||||
* @param password
|
||||
*/
|
||||
NTRIPClient(SFE_UBLOX_GNSS *gnss, const char *host, uint16_t port, const char *mountPoint, const char *user = nullptr, const char *password = nullptr);
|
||||
~NTRIPClient();
|
||||
|
||||
/**
|
||||
* @brief Runs the state machine.
|
||||
*
|
||||
* See NTRIPClientStates for more information.
|
||||
* Should be called ever main loop.
|
||||
*/
|
||||
void loop();
|
||||
/**
|
||||
* @brief Configure the Gnss module to accept correction data
|
||||
*
|
||||
*/
|
||||
void gnssConfiguration();
|
||||
|
||||
/**
|
||||
* @brief Configure the Gnss module to accept correction data
|
||||
*
|
||||
*/
|
||||
void gpsConfiguration();
|
||||
/**
|
||||
* @brief Activate or deactivate the location transmission
|
||||
*
|
||||
* Some server need the position of the Gnss module to send the
|
||||
* right correction data.
|
||||
*
|
||||
* @param b
|
||||
*/
|
||||
void setTransmitLocation(bool b) { this->transmitLocation = b; }
|
||||
|
||||
/**
|
||||
* @brief Activate or deactivate the location transmission
|
||||
*
|
||||
* Some server need the position of the Gnss module to send the
|
||||
* right correction data.
|
||||
*
|
||||
* @param b
|
||||
*/
|
||||
void setTransmitLocation(bool b) { this->transmitLocation = b; }
|
||||
/**
|
||||
* @brief Activate or deactivate the connection to the server.
|
||||
*
|
||||
* @param state
|
||||
* @return true success
|
||||
* @return false failure
|
||||
*/
|
||||
bool setActivated(bool state);
|
||||
void setAutoReconnect(bool state);
|
||||
void useOutdatedNtripRev1 (bool rev1 = false ) { this->useNtripRev1 = rev1; }
|
||||
|
||||
/**
|
||||
* @brief Activate or deactivate the connection to the server.
|
||||
*
|
||||
* @param b
|
||||
* @return true success
|
||||
* @return false failure
|
||||
*/
|
||||
bool setActivated(bool b);
|
||||
bool isConnected();
|
||||
|
||||
bool isConnected();
|
||||
/**
|
||||
* @brief Get the Client State object
|
||||
*
|
||||
* Returns the state of the State machine
|
||||
*
|
||||
* @return NTRIPClientStates
|
||||
*/
|
||||
NTRIPClientStates getClientState() { return this->state; }
|
||||
|
||||
/**
|
||||
* @brief Get the Client State object
|
||||
*
|
||||
* Returns the state of the State machine
|
||||
*
|
||||
* @return NTRIPClientStates
|
||||
*/
|
||||
NTRIPClientStates getClientState() { return this->state; }
|
||||
private:
|
||||
void run() override;
|
||||
void runAsChild() override;
|
||||
void pushGPGGA();
|
||||
bool beginClient();
|
||||
void closeConnection();
|
||||
bool processConnection();
|
||||
void checkAutoReconnect();
|
||||
|
||||
private:
|
||||
void pushGPGGA(NMEA_GGA_data_t *nmeaData);
|
||||
bool beginClient();
|
||||
void closeConnection();
|
||||
bool processConnection();
|
||||
SFE_UBLOX_GNSS *gnss;
|
||||
WiFiClient *ntripClient;
|
||||
NTRIPClientStates state = NTRIPClientStates::notAvailable;
|
||||
|
||||
SFE_UBLOX_GNSS* gps;
|
||||
WiFiClient* ntripClient;
|
||||
NTRIPClientStates state = NTRIPClientStates::notAvailable;
|
||||
bool transmitLocation = false;
|
||||
bool activated = true;
|
||||
bool autoReconnect = false;
|
||||
bool useNtripRev1 = false;
|
||||
|
||||
bool transmitLocation = true;
|
||||
bool activated = true;
|
||||
uint8_t reconnectAttemps = 0;
|
||||
uint16_t port;
|
||||
uint32_t lastReceivedRtcmTime = 0;
|
||||
// uint32_t lastNtripConnectTime = 0; // can deleted?
|
||||
uint32_t lastGPGGAPushTime = 0;
|
||||
uint32_t lastReconnectTime = 0;
|
||||
|
||||
uint16_t port;
|
||||
uint32_t lastReceivedRtcmTime = 0;
|
||||
uint32_t lastNtripConnectTime = 0;
|
||||
uint32_t lastGPGGAPushTime = 0;
|
||||
uint32_t lastLoopTime = 0;
|
||||
static const uint8_t connectionDataLength = 32;
|
||||
char host[connectionDataLength];
|
||||
char mountPoint[connectionDataLength];
|
||||
char user[connectionDataLength];
|
||||
char password[connectionDataLength];
|
||||
const uint8_t maxReconnectAttemps = 10;
|
||||
const uint16_t reconnectDelayTime = 5000;
|
||||
const uint16_t timeOut = 10000;
|
||||
const uint16_t bufferSize = 512;
|
||||
const uint16_t bufferSizePushGPGGA = 128;
|
||||
const uint16_t pushGPGGATime = 10000;
|
||||
|
||||
char host[128];
|
||||
char mountPoint[128];
|
||||
char user[128];
|
||||
char password[128];
|
||||
const uint8_t delayTime = 20;
|
||||
const uint16_t timeOut = 5000;
|
||||
const uint16_t tryReconnectTime = 5000;
|
||||
const uint16_t bufferSize = 512;
|
||||
const uint16_t pushGPGGATime = 10000;
|
||||
static constexpr uint8_t loopDelay = 20;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
* @file point.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-03
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "point.h"
|
||||
|
||||
Point::Point(double lat, double lon, uint32_t horizontalAccuracy, uint32_t creationTime)
|
||||
: coordinates{lat, lon}
|
||||
{
|
||||
this->init(horizontalAccuracy, creationTime);
|
||||
}
|
||||
|
||||
Point::Point(int32_t lat, int32_t lon, uint32_t horizontalAccuracy, uint32_t creationTime)
|
||||
: coordinates{lat / 10000000.0, lon / 10000000.0}
|
||||
{
|
||||
this->init(horizontalAccuracy, creationTime);
|
||||
}
|
||||
|
||||
Point::Point(Coordinates coords, uint32_t horizontalAccuracy, uint32_t creationTime)
|
||||
: coordinates{coords}
|
||||
{
|
||||
this->init(horizontalAccuracy, creationTime);
|
||||
}
|
||||
|
||||
Point::Point(Coordinates coords, bool imported)
|
||||
{
|
||||
this->coordinates = coords;
|
||||
if (imported)
|
||||
{
|
||||
this->init(UINT32_MAX, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->init(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Point::Point()
|
||||
{
|
||||
this->coordinates.lat = 0;
|
||||
this->coordinates.lon = 0;
|
||||
this->init(0, 0);
|
||||
}
|
||||
|
||||
bool Point::operator==(const Point &rhs) const
|
||||
{
|
||||
return this->coordinates == rhs.getCoordinates();
|
||||
}
|
||||
|
||||
double Point::distanceTo(const Coordinates &point) const
|
||||
{
|
||||
// Old implementation
|
||||
// const Coordinates begin = this->coordinates;
|
||||
// const Coordinates end = point;
|
||||
|
||||
// const double lat = (begin.lat + end.lat) / 2 * ROUTE_DEGREE_TO_RADIANT;
|
||||
// const double dy = ROUTE_DISTANCE_BETWEEN_LATITUDE * (begin.lat - end.lat);
|
||||
// const double dx = ROUTE_DISTANCE_BETWEEN_LATITUDE * cos(lat) * (begin.lon - end.lon);
|
||||
|
||||
// return sqrt(dx * dx + dy * dy);
|
||||
|
||||
double latStart = this->toRad(this->coordinates.lat);
|
||||
double lonStart = this->toRad(this->coordinates.lon);
|
||||
double latEnd = this->toRad(point.lat);
|
||||
double lonEnd = this->toRad(point.lon);
|
||||
|
||||
const double earthRadius = 6371.0; //km
|
||||
double cartesianX_1 = cos(latStart) * lonStart * earthRadius;
|
||||
double cartesianY_1 = latStart * earthRadius;
|
||||
double cartesianX_2 = cos(latEnd) * lonEnd * earthRadius;
|
||||
double cartesianY_2 = latEnd * earthRadius;
|
||||
|
||||
return sqrt(pow(cartesianX_2 - cartesianX_1, 2)
|
||||
+ pow(cartesianY_2 - cartesianY_1, 2));
|
||||
}
|
||||
|
||||
double Point::distanceTo(const Point &point) const
|
||||
{
|
||||
return this->distanceTo(point.getCoordinates());
|
||||
}
|
||||
|
||||
int16_t Point::courseTo(const Coordinates &point) const
|
||||
{
|
||||
// const Coordinates begin = this->coordinates;
|
||||
// const Coordinates end = point;
|
||||
|
||||
// const double phi = log(tan(end.lat * ROUTE_DEGREE_TO_RADIANT / 2 + M_PI / 4) / tan(begin.lat * ROUTE_DEGREE_TO_RADIANT / 2 + M_PI / 4));
|
||||
// const double lon = (begin.lon * ROUTE_DEGREE_TO_RADIANT - end.lon * ROUTE_DEGREE_TO_RADIANT);
|
||||
|
||||
// return static_cast<int16_t>(atan2(lon, phi) / ROUTE_DEGREE_TO_RADIANT) * -1;
|
||||
|
||||
double latStart = this->toRad(this->coordinates.lat);
|
||||
double lonStart = this->toRad(this->coordinates.lon);
|
||||
double latEnd = this->toRad(point.lat);
|
||||
double lonEnd = this->toRad(point.lon);
|
||||
|
||||
double y = sin(lonEnd - lonStart) * cos(latEnd);
|
||||
double x = cos(latStart) * sin(latEnd) - sin(latStart) * cos(latEnd) * cos(lonEnd - lonStart);
|
||||
double theta = atan2(y, x);
|
||||
|
||||
return static_cast<int16_t>(this->toDeg(theta)) % 360;
|
||||
}
|
||||
|
||||
int16_t Point::courseTo(const Point &point) const
|
||||
{
|
||||
return this->courseTo(point.getCoordinates());
|
||||
}
|
||||
|
||||
void Point::init(uint32_t horizontalAccuracy, uint32_t creationTime)
|
||||
{
|
||||
this->creationTime = creationTime;
|
||||
|
||||
if (horizontalAccuracy == UINT32_MAX)
|
||||
{
|
||||
this->accuracy = Accuracy::imported;
|
||||
}
|
||||
else if (horizontalAccuracy > 9999)
|
||||
{
|
||||
this->accuracy = Accuracy::fourDigOfCM;
|
||||
}
|
||||
else if (horizontalAccuracy > 999)
|
||||
{
|
||||
this->accuracy = Accuracy::threeDigOfCM;
|
||||
}
|
||||
else if (horizontalAccuracy > 99)
|
||||
{
|
||||
this->accuracy = Accuracy::twoDigOfCM;
|
||||
}
|
||||
else if (horizontalAccuracy > 1)
|
||||
{
|
||||
this->accuracy = Accuracy::oneDigOfCM;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->accuracy = Accuracy::none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
/**
|
||||
* @file point.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-03
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef POINT_H
|
||||
#define POINT_H
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#define ROUTE_DEGREE_TO_RADIANT 0.01745
|
||||
#define ROUTE_DISTANCE_BETWEEN_LATITUDE 111300
|
||||
|
||||
/**
|
||||
* @brief A class to handle points on the earth
|
||||
*
|
||||
* The points inherits latitude and longitude as doubles
|
||||
*
|
||||
*/
|
||||
class Point
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Hold the data longitude and latitude
|
||||
*
|
||||
*/
|
||||
struct Coordinates
|
||||
{
|
||||
double lon;
|
||||
double lat;
|
||||
|
||||
bool operator==(const Coordinates rhs) const
|
||||
{
|
||||
return (this->lon == rhs.lon) && (this->lon == rhs.lon);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The Accuracy is set by the constructor
|
||||
*
|
||||
*/
|
||||
enum Accuracy
|
||||
{
|
||||
none,
|
||||
fourDigOfCM,
|
||||
threeDigOfCM,
|
||||
twoDigOfCM,
|
||||
oneDigOfCM,
|
||||
imported
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Construct a new Point object
|
||||
*
|
||||
* @param lat
|
||||
* @param lon
|
||||
* @param horizontalAccuracy
|
||||
* @param creationTime
|
||||
*/
|
||||
Point(double lat, double lon, uint32_t horizontalAccuracy = 0, uint32_t creationTime = 0);
|
||||
Point(int32_t lat, int32_t lon, uint32_t horizontalAccuracy = 0, uint32_t creationTime = 0);
|
||||
Point(Coordinates coords, uint32_t horizontalAccuracy = 0, uint32_t creationTime = 0);
|
||||
Point(Coordinates coords, bool imported);
|
||||
Point();
|
||||
|
||||
/**
|
||||
* @brief Checks if to points are equal.
|
||||
*
|
||||
* @param rhs
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool operator==(const Point &rhs) const;
|
||||
|
||||
/**
|
||||
* @brief Checks if the point is initalized.
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool isInit() const { return this->coordinates.lat + this->coordinates.lon; }
|
||||
|
||||
/**
|
||||
* @brief Checks if the point is valid.
|
||||
*
|
||||
* If the accuracy is higher than zero, true will be returned.
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool isValid() const { return (this->accuracy > 0) ? true : false; }
|
||||
|
||||
/**
|
||||
* @brief Calculates the distance between to points.
|
||||
*
|
||||
* @param point
|
||||
* @return double meter
|
||||
*/
|
||||
double distanceTo(const Coordinates &point) const;
|
||||
double distanceTo(const Point &point) const;
|
||||
|
||||
/**
|
||||
* @brief Calculates the course to an other point.
|
||||
*
|
||||
* @param point
|
||||
* @return int16_t degree
|
||||
*/
|
||||
int16_t courseTo(const Coordinates &point) const;
|
||||
int16_t courseTo(const Point &point) const;
|
||||
|
||||
uint32_t getCreationTime() const { return this->creationTime; }
|
||||
double getLongitude() const { return this->coordinates.lon; }
|
||||
double getLatitude() const { return this->coordinates.lat; }
|
||||
Coordinates getCoordinates() const { return this->coordinates; }
|
||||
|
||||
/**
|
||||
* @brief Get the Accuracy object
|
||||
*
|
||||
* The higher the value, the greater the accuracy.
|
||||
* You can check it by Accuracy.
|
||||
*
|
||||
* @return Accuracy
|
||||
*/
|
||||
Accuracy getAccuracy() const { return this->accuracy; }
|
||||
|
||||
private:
|
||||
void init(uint32_t horizontalAccuracy, uint32_t creationTime);
|
||||
double toRad (double degree) const
|
||||
{
|
||||
constexpr double radFactor = M_PI / 180.0;
|
||||
return degree * radFactor;
|
||||
};
|
||||
|
||||
double toDeg(double radiant) const
|
||||
{
|
||||
constexpr double degFactor = 180.0 / M_PI;
|
||||
return radiant * degFactor;
|
||||
};
|
||||
|
||||
Accuracy accuracy = Accuracy::none;
|
||||
Coordinates coordinates{0, 0};
|
||||
|
||||
uint32_t creationTime = 0;
|
||||
};
|
||||
|
||||
#endif // POINT_H
|
||||
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* @file route.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Implements the class Route and Point
|
||||
* @version 0.1
|
||||
* @date 2022-01-31
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#include "route.h"
|
||||
|
||||
Route Route::routeCache = Route();
|
||||
|
||||
void Route::addPointToRoute(Point point)
|
||||
{
|
||||
this->points.push_back(point);
|
||||
}
|
||||
|
||||
void Route::clear()
|
||||
{
|
||||
this->points.clear();
|
||||
this->currentPoint = 0;
|
||||
this->started = false;
|
||||
}
|
||||
|
||||
Point Route::startRoute()
|
||||
{
|
||||
if (this->points.empty())
|
||||
{
|
||||
this->started = false;
|
||||
return Point();
|
||||
}
|
||||
|
||||
this->it = this->points.begin();
|
||||
this->currentPoint = 1;
|
||||
this->started = true;
|
||||
return *this->it;
|
||||
}
|
||||
|
||||
Point Route::endRoute()
|
||||
{
|
||||
if (this->points.empty())
|
||||
{
|
||||
this->started = false;
|
||||
return Point();
|
||||
}
|
||||
|
||||
this->it = this->points.end();
|
||||
// TODO: Understand why i have to decrement the iterator first to get realy the last element.
|
||||
this->it--;
|
||||
this->currentPoint = this->points.size();
|
||||
this->started = true;
|
||||
return *this->it;
|
||||
}
|
||||
|
||||
Point Route::getNextPoint()
|
||||
{
|
||||
Point point;
|
||||
if (!this->started)
|
||||
{
|
||||
return point;
|
||||
}
|
||||
|
||||
if (this->it != --this->points.end())
|
||||
{
|
||||
this->it++;
|
||||
this->currentPoint++;
|
||||
return *this->it;
|
||||
// } else if (this->it == this->points.end() && this->currentPoint != this->points.size()) {
|
||||
// this->currentPoint++;
|
||||
// return *this->it;
|
||||
}
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
Point Route::getPreviousPoint()
|
||||
{
|
||||
Point point;
|
||||
if (!this->started)
|
||||
{
|
||||
return point;
|
||||
}
|
||||
|
||||
if (this->it != this->points.begin())
|
||||
{
|
||||
this->it--;
|
||||
this->currentPoint--;
|
||||
return *this->it;
|
||||
}
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
RouteInfo Route::getRouteInfo()
|
||||
{
|
||||
RouteInfo info{0, 0};
|
||||
info.totalPoints = this->points.size();
|
||||
info.currentPoint = this->currentPoint;
|
||||
return info;
|
||||
}
|
||||
|
||||
Route& Route::getRouteCache() {
|
||||
return Route::routeCache;
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* @file route.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains the class Route
|
||||
* @version 0.1
|
||||
* @date 2022-01-31
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ROUTE_H
|
||||
#define ROUTE_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
|
||||
#include "point.h"
|
||||
|
||||
/**
|
||||
* @brief Holds some route information
|
||||
*
|
||||
*/
|
||||
struct RouteInfo
|
||||
{
|
||||
/**
|
||||
* @brief Selected number of Points
|
||||
*/
|
||||
uint16_t currentPoint;
|
||||
|
||||
/**
|
||||
* @brief Total points stored in route
|
||||
*/
|
||||
uint16_t totalPoints;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A class to manage multiple points
|
||||
*
|
||||
* The list of point presents a route which can be driven
|
||||
*/
|
||||
class Route
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Adds a point to the list.
|
||||
*
|
||||
* @param point
|
||||
*/
|
||||
void addPointToRoute(Point point);
|
||||
|
||||
/**
|
||||
* @brief Delete all points
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* @brief Select the first point as target.
|
||||
*
|
||||
* @return Point
|
||||
*/
|
||||
Point startRoute();
|
||||
|
||||
/**
|
||||
* @brief Select the last point as target.
|
||||
*
|
||||
* @return Point
|
||||
*/
|
||||
Point endRoute();
|
||||
|
||||
/**
|
||||
* @brief Get the next point and set it as target.
|
||||
*
|
||||
* @return Point is zero if there are no more Points.
|
||||
*/
|
||||
Point getNextPoint();
|
||||
|
||||
/**
|
||||
* @brief Get the previous point and set it as target.
|
||||
*
|
||||
* @return Point
|
||||
*/
|
||||
Point getPreviousPoint();
|
||||
|
||||
/**
|
||||
* @brief Get the Route Info object
|
||||
*
|
||||
* @return RouteInfo
|
||||
*/
|
||||
RouteInfo getRouteInfo();
|
||||
|
||||
/**
|
||||
* @brief Get the Started object
|
||||
*
|
||||
* The Route will be marked as started when startRoute or
|
||||
* endRoute has been called.
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool getStarted() const { return this->started; }
|
||||
|
||||
static Route& getRouteCache();
|
||||
|
||||
private:
|
||||
uint16_t currentPoint = 0;
|
||||
bool started = false;
|
||||
|
||||
std::list<Point> points;
|
||||
std::list<Point>::iterator it;
|
||||
|
||||
static Route routeCache;
|
||||
};
|
||||
|
||||
#endif // ROUTE_H
|
||||
@@ -0,0 +1,285 @@
|
||||
/**
|
||||
* @file sensorData.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-02
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sensorData.h"
|
||||
|
||||
bool SensorData::outputStatusPrintPVTdata = false;
|
||||
uint32_t SensorData::ubxUpdateTimeStatic = 0;
|
||||
UBX_NAV_PVT_data_t *SensorData::ubxDataStatic = nullptr;
|
||||
|
||||
SensorData::SensorData()
|
||||
{
|
||||
Component::loopDelay = SensorData::loopDelay;
|
||||
}
|
||||
|
||||
SensorData::~SensorData()
|
||||
{
|
||||
delete this->ntripClient;
|
||||
}
|
||||
|
||||
void SensorData::enableNtrip(String host, uint16_t port, String mountPoint, String user, String password)
|
||||
{
|
||||
this->ntripClient = new NTRIPClient(this->gnss, host.c_str(), port, mountPoint.c_str(), user.c_str(), password.c_str());
|
||||
this->ntripClient->gnssConfiguration();
|
||||
this->ntripClient->loop();
|
||||
this->ntripClient->setActivated(false);
|
||||
this->isNtripInit = true;
|
||||
this->addChildComponent(this->ntripClient);
|
||||
}
|
||||
|
||||
void SensorData::enableGnss(SPIClass *spiPort, uint8_t csPin)
|
||||
{
|
||||
this->gnss = new SFE_UBLOX_GNSS();
|
||||
if (this->gnss->begin(*spiPort, csPin, 4000000) == false)
|
||||
{
|
||||
std::cout << "u-blox GNSS not detected on SPI bus. Please check wiring. Freezing." << std::endl;
|
||||
while (true)
|
||||
{
|
||||
}
|
||||
}
|
||||
this->initGnss();
|
||||
}
|
||||
|
||||
void SensorData::enableGnss()
|
||||
{
|
||||
this->gnss = new SFE_UBLOX_GNSS();
|
||||
if (this->gnss->begin() == false)
|
||||
{
|
||||
std::cout << "u-blox GNSS not detected at default I2C address. Please check wiring. Freezing." << std::endl;
|
||||
while (true)
|
||||
{
|
||||
}
|
||||
}
|
||||
this->initGnss();
|
||||
}
|
||||
|
||||
void SensorData::enableRealCompass()
|
||||
{
|
||||
static constexpr byte address = 0x0d;
|
||||
|
||||
this->realCompass = new QMC5883LCompass();
|
||||
// Init Compass
|
||||
Wire.beginTransmission(address);
|
||||
// TODO: describe Bytes !!!
|
||||
Wire.write(0x0b);
|
||||
Wire.write(0x01);
|
||||
Wire.endTransmission();
|
||||
this->realCompass->setMode(0x01, 0x0C, 0x10, 0X00);
|
||||
CalibrateCompass caliCompass(this->realCompass);
|
||||
caliCompass.loadData();
|
||||
caliCompass.useData();
|
||||
}
|
||||
|
||||
void SensorData::enableCalcCompass()
|
||||
{
|
||||
// TODO: !!! implementieren
|
||||
}
|
||||
|
||||
void SensorData::enableGyroscope()
|
||||
{
|
||||
this->gyroscope = new MPU6050();
|
||||
this->gyroscope->initialize();
|
||||
if (!this->gyroscope->testConnection())
|
||||
{
|
||||
std::cout << "SensorData::enableGyroscope: Gyroscope is not connected. Freeze!" << std::endl;
|
||||
while (true)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
const uint8_t deviceStatus = this->gyroscope->dmpInitialize();
|
||||
|
||||
// TODO: !!! MagicNumer 6x
|
||||
this->gyroscope->setXGyroOffset(220);
|
||||
this->gyroscope->setYGyroOffset(76);
|
||||
this->gyroscope->setZGyroOffset(-85);
|
||||
this->gyroscope->setZAccelOffset(1788);
|
||||
|
||||
if (deviceStatus == 0)
|
||||
{
|
||||
this->gyroscope->CalibrateAccel(6);
|
||||
this->gyroscope->CalibrateGyro(6);
|
||||
// this->gyroscope->PrintActiveOffsets();
|
||||
this->gyroscope->setDMPEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ERROR!
|
||||
// 1 = initial memory load failed
|
||||
// 2 = DMP configuration updates failed
|
||||
// (if it's going to break, usually the code will be 1)
|
||||
std::cout << "SensorData::enableGyroscope: DMP Initialization failed (code" << static_cast<int>(deviceStatus) << "). Freeze!" << std::endl;
|
||||
while (true)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CalcAzimuth::State SensorData::getCalcAzimuthState() const
|
||||
{
|
||||
if (static_cast<bool>(this->calcCompass))
|
||||
{
|
||||
return this->calcCompass->getState();
|
||||
}
|
||||
return CalcAzimuth::State::Invalid;
|
||||
}
|
||||
|
||||
NTRIPClientStates SensorData::getNtripState() const
|
||||
{
|
||||
if (static_cast<bool>(this->ntripClient))
|
||||
{
|
||||
return this->ntripClient->getClientState();
|
||||
}
|
||||
return NTRIPClientStates::notAvailable;
|
||||
}
|
||||
|
||||
void SensorData::printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
|
||||
{
|
||||
static constexpr uint8_t stringSize = 32;
|
||||
|
||||
if (!SensorData::outputStatusPrintPVTdata)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const double latitude = ubxDataStruct->lat / 10000000.0;
|
||||
const double longitude = ubxDataStruct->lon / 10000000.0;
|
||||
const double altitude = ubxDataStruct->hMSL / 1000.0;
|
||||
|
||||
const uint8_t fixType = ubxDataStruct->fixType;
|
||||
char fixTypeString[stringSize];
|
||||
if (fixType == 0)
|
||||
{
|
||||
strcpy(fixTypeString, static_cast<const char *>("None"));
|
||||
}
|
||||
else if (fixType == 1)
|
||||
{
|
||||
strcpy(fixTypeString, static_cast<const char *>("Dead Reckoning"));
|
||||
}
|
||||
else if (fixType == 2)
|
||||
{
|
||||
strcpy(fixTypeString, static_cast<const char *>("2D"));
|
||||
}
|
||||
else if (fixType == 3)
|
||||
{
|
||||
strcpy(fixTypeString, static_cast<const char *>("3D"));
|
||||
}
|
||||
else if (fixType == 3)
|
||||
{
|
||||
strcpy(fixTypeString, static_cast<const char *>("GNSS + Dead Reckoning"));
|
||||
}
|
||||
else if (fixType == 5)
|
||||
{
|
||||
strcpy(fixTypeString, static_cast<const char *>("Time Only"));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(fixTypeString, static_cast<const char *>("UNKNOWN"));
|
||||
}
|
||||
|
||||
const uint8_t carrSoln = ubxDataStruct->flags.bits.carrSoln;
|
||||
char carrSolnString[stringSize];
|
||||
if (carrSoln == 0)
|
||||
{
|
||||
strcpy(carrSolnString, static_cast<const char *>("None"));
|
||||
}
|
||||
else if (carrSoln == 1)
|
||||
{
|
||||
strcpy(carrSolnString, static_cast<const char *>("Floating"));
|
||||
}
|
||||
else if (carrSoln == 2)
|
||||
{
|
||||
strcpy(carrSolnString, static_cast<const char *>("Fixed"));
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(carrSolnString, static_cast<const char *>("UNKNOWN"));
|
||||
}
|
||||
|
||||
const uint32_t hAcc = ubxDataStruct->hAcc;
|
||||
|
||||
std::cout << "Lat: " << latitude
|
||||
<< " Lng: " << longitude
|
||||
<< " Alt: " << altitude << std::endl;
|
||||
|
||||
std::cout << "Fix: " << fixTypeString
|
||||
<< " Carrier Solution: " << carrSolnString
|
||||
<< " Horizontal Accuracy Estimate: " << hAcc << " mm" << std::endl;
|
||||
}
|
||||
|
||||
void SensorData::savePVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
|
||||
{
|
||||
SensorData::printPVTdata(ubxDataStruct);
|
||||
|
||||
SensorData::ubxDataStatic = ubxDataStruct;
|
||||
SensorData::ubxUpdateTimeStatic = millis();
|
||||
}
|
||||
|
||||
void SensorData::setOutputStatusPrintPVTdata(bool status)
|
||||
{
|
||||
SensorData::outputStatusPrintPVTdata = status;
|
||||
}
|
||||
|
||||
void SensorData::run()
|
||||
{
|
||||
if (static_cast<bool>(this->realCompass))
|
||||
{
|
||||
this->realCompass->read();
|
||||
this->realAzimuth = this->realCompass->getAzimuth();
|
||||
}
|
||||
|
||||
if (static_cast<bool>(this->gyroscope) && this->gyroscope->dmpGetCurrentFIFOPacket(static_cast<uint8_t *>(this->gyroBuffer)))
|
||||
{
|
||||
this->gyroscope->dmpGetQuaternion(&this->quaternion, static_cast<uint8_t *>(this->gyroBuffer));
|
||||
this->gyroscope->dmpGetGravity(&this->gravity, &this->quaternion);
|
||||
this->gyroscope->dmpGetYawPitchRoll(static_cast<float *>(this->yawPitchRoll), &this->quaternion, &this->gravity);
|
||||
}
|
||||
}
|
||||
|
||||
void SensorData::runAsChild()
|
||||
{
|
||||
if (static_cast<bool>(this->gnss))
|
||||
{
|
||||
this->gnss->checkUblox();
|
||||
this->gnss->checkCallbacks();
|
||||
if (SensorData::ubxUpdateTimeStatic != this->lastUbxUpdate)
|
||||
{
|
||||
this->updateUbxData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SensorData::initGnss()
|
||||
{
|
||||
const uint8_t versionHigh = this->gnss->getProtocolVersionHigh();
|
||||
const uint8_t versionLow = this->gnss->getProtocolVersionLow();
|
||||
std::cout << "u-blox protocol version: " << static_cast<int>(versionHigh) << "." << static_cast<int>(versionLow) << std::endl;
|
||||
|
||||
this->gnss->setSPIOutput(COM_TYPE_UBX);
|
||||
this->gnss->enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_SPI, 10);
|
||||
this->gnss->setUSBOutput(COM_TYPE_UBX | COM_TYPE_NMEA);
|
||||
this->gnss->setAutoPVTcallbackPtr(&(SensorData::savePVTdata));
|
||||
// SensorData::setOutputStatusPrintPVTdata(true);
|
||||
this->gnss->setNavigationFrequency(1);
|
||||
this->gnss->setAutoPVT(true);
|
||||
}
|
||||
|
||||
void SensorData::updateUbxData()
|
||||
{
|
||||
this->gnssData = SensorData::ubxDataStatic;
|
||||
this->lastUbxUpdate = SensorData::ubxUpdateTimeStatic;
|
||||
|
||||
Point::Coordinates coords{0, 0};
|
||||
coords.lat = this->gnssData->lat / 10000000.0;
|
||||
coords.lon = this->gnssData->lon / 10000000.0;
|
||||
|
||||
this->currentPosition = Point(coords, this->gnssData->hAcc);
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
/**
|
||||
* @file sensorData.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains the SensorData class
|
||||
* @version 0.1
|
||||
* @date 2023-09-02
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SENSOR_DATA_H
|
||||
#define SENSOR_DATA_H
|
||||
|
||||
#include <SPI.h>
|
||||
#include <I2Cdev.h>
|
||||
#include <iostream>
|
||||
|
||||
#include "component.h"
|
||||
#include "calibrateCompass.h"
|
||||
|
||||
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
|
||||
#include <QMC5883LCompass.h>
|
||||
#include <MPU6050_6Axis_MotionApps612.h>
|
||||
#include "calcAzimuth.h"
|
||||
#include "ntripClient.h"
|
||||
|
||||
#include "point.h"
|
||||
|
||||
/**
|
||||
* @brief A class to manage all sensors
|
||||
*
|
||||
* Each sensor have separately to be enabled
|
||||
*/
|
||||
class SensorData : public Component
|
||||
{
|
||||
public:
|
||||
SensorData();
|
||||
~SensorData();
|
||||
|
||||
void enableNtrip(String host, uint16_t port, String mountPoint, String user, String password);
|
||||
|
||||
/**
|
||||
* @brief Enable the gnss module over spi
|
||||
*
|
||||
* @param spiPort
|
||||
* @param csPin
|
||||
*/
|
||||
void enableGnss(SPIClass *spiPort, uint8_t csPin);
|
||||
|
||||
/**
|
||||
* @brief Enable the gnss module over i2c
|
||||
*/
|
||||
void enableGnss();
|
||||
|
||||
void enableRealCompass();
|
||||
void enableCalcCompass();
|
||||
void enableGyroscope();
|
||||
|
||||
// Interface Const
|
||||
/**
|
||||
* @brief Get the azimuth measured by the compass module
|
||||
*
|
||||
* @return int16_t
|
||||
*/
|
||||
int16_t getRealAzimuth() const { return this->realAzimuth; }
|
||||
|
||||
/**
|
||||
* @brief Get the azimuth calculated by CalcAzimuth
|
||||
*
|
||||
* Consider to call getCalcAzimuthState() to check, if the data is valid.
|
||||
*
|
||||
* @return int16_t
|
||||
*/
|
||||
int16_t getCalcAzimuth() const { return this->calcAzimuth; }
|
||||
|
||||
/**
|
||||
* @brief Get the CalcAzimuth::State object
|
||||
*
|
||||
* Needed to check the quality of calculated azimuth
|
||||
*
|
||||
* @return CalcAzimuth::State
|
||||
*/
|
||||
CalcAzimuth::State getCalcAzimuthState() const;
|
||||
|
||||
Point getCurrentPos() const { return this->currentPosition; }
|
||||
const UBX_NAV_PVT_data_t *getGnssData() const { return this->gnssData; };
|
||||
NTRIPClientStates getNtripState() const;
|
||||
|
||||
/**
|
||||
* @brief Get the data from the gyroscope
|
||||
*
|
||||
* The returned float pointer is an array of 3 floats
|
||||
* - Yaw
|
||||
* - Pitch
|
||||
* - Roll
|
||||
*
|
||||
* @return const float*
|
||||
*/
|
||||
const float *getGyroData() const { return this->yawPitchRoll; }
|
||||
|
||||
/**
|
||||
* @brief Get the CalcCompass object
|
||||
* @return CalcAzimuth*
|
||||
*/
|
||||
CalcAzimuth *getCalcCompass() const { return this->calcCompass; }
|
||||
|
||||
/**
|
||||
* @brief Get the RealCompass object
|
||||
* @return QMC5883LCompass*
|
||||
*/
|
||||
QMC5883LCompass *getRealCompass() const { return this->realCompass; }
|
||||
|
||||
/**
|
||||
* @brief Get the NTRIPClient object
|
||||
* @return NTRIPClient*
|
||||
*/
|
||||
NTRIPClient *getNtripClient() const { return this->ntripClient; }
|
||||
|
||||
/**
|
||||
* @brief Get the Gyroscope object
|
||||
* @return MPU6050*
|
||||
*/
|
||||
MPU6050 *getGyroscope() const { return this->gyroscope; }
|
||||
|
||||
// static
|
||||
/**
|
||||
* @brief Set the output status for PVTdata.
|
||||
*
|
||||
* If this is true, a lot of information from the gnss module will be printed in
|
||||
* the interval of navigation frequency.
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
static void setOutputStatusPrintPVTdata(bool status);
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
void runAsChild() override;
|
||||
void initGnss();
|
||||
void updateUbxData();
|
||||
|
||||
QMC5883LCompass *realCompass = nullptr;
|
||||
CalcAzimuth *calcCompass = nullptr;
|
||||
SFE_UBLOX_GNSS *gnss = nullptr;
|
||||
NTRIPClient *ntripClient = nullptr;
|
||||
MPU6050 *gyroscope = nullptr;
|
||||
|
||||
UBX_NAV_PVT_data_t *gnssData = nullptr;
|
||||
Point currentPosition;
|
||||
Quaternion quaternion;
|
||||
VectorFloat gravity;
|
||||
|
||||
char *host = nullptr;
|
||||
char *mountPoint = nullptr;
|
||||
char *user = nullptr;
|
||||
char *password = nullptr;
|
||||
|
||||
bool isNtripInit = false;
|
||||
|
||||
uint8_t gyroBuffer[64];
|
||||
uint16_t port = 0;
|
||||
int16_t realAzimuth = INT16_MAX;
|
||||
int16_t calcAzimuth = INT16_MAX;
|
||||
uint32_t lastUbxUpdate = 0;
|
||||
|
||||
float yawPitchRoll[3]{0, 0, 0};
|
||||
|
||||
// static
|
||||
static void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct);
|
||||
static void savePVTdata(UBX_NAV_PVT_data_t *ubxDataStruct);
|
||||
|
||||
static UBX_NAV_PVT_data_t *ubxDataStatic;
|
||||
static uint32_t ubxUpdateTimeStatic;
|
||||
static bool outputStatusPrintPVTdata;
|
||||
|
||||
static constexpr uint8_t loopDelay = 50;
|
||||
};
|
||||
|
||||
#endif // SENSOR_DATA_H
|
||||
+103
-101
@@ -11,142 +11,144 @@
|
||||
*/
|
||||
#include "speedometer.h"
|
||||
|
||||
Speedometer::Speedometer(uint8_t pin, double diameter, uint16_t steps, uint8_t numOfValForAvg) {
|
||||
this->init(pin, diameter, steps);
|
||||
this->bufSize = numOfValForAvg;
|
||||
}
|
||||
|
||||
Speedometer::Speedometer(uint8_t pin, double diameter, uint16_t steps) {
|
||||
this->init(pin, diameter, steps);
|
||||
}
|
||||
|
||||
Speedometer::~Speedometer() {
|
||||
delete[] this->buf;
|
||||
delete this->pulseCounter;
|
||||
}
|
||||
|
||||
uint16_t Speedometer::loop() {
|
||||
if (this->calibrationRunning)
|
||||
return -1;
|
||||
|
||||
uint32_t time = millis();
|
||||
uint16_t elapsed_time = time - this->last_millis_loop;
|
||||
|
||||
//Cancel if delayLoop is not reached
|
||||
if (elapsed_time < this->delayLoop)
|
||||
return elapsed_time;
|
||||
|
||||
runSpeedometer();
|
||||
this->last_millis_loop = time;
|
||||
return elapsed_time;
|
||||
}
|
||||
|
||||
void Speedometer::runSpeedometer() {
|
||||
uint32_t time = millis();
|
||||
|
||||
uint16_t elapsed_time = time - last_millis_calc;
|
||||
last_millis_calc = time;
|
||||
|
||||
int16_t count = this->pulseCounter->get_value();
|
||||
switch (this->currentDirection) {
|
||||
case Direction::Forward :
|
||||
this->addValToBuf(count);
|
||||
break;
|
||||
|
||||
case Direction::Backward :
|
||||
this->addValToBuf(-count);
|
||||
break;
|
||||
|
||||
case Direction::None :
|
||||
this->addValToBuf(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cout << "Wrong value in Speedometer::runSpeedometer" << std::endl;
|
||||
break;
|
||||
}
|
||||
Speedometer::Speedometer(uint8_t pin, double diameter, uint16_t steps)
|
||||
: pulseCounter{new Counter(pin)}, diameter{diameter}, steps{steps}, buf{}
|
||||
{
|
||||
this->pulseCounter->setFilterValue(Speedometer::maxFilterValue); // ignore pulses less than 1000 x 2.5ns
|
||||
|
||||
this->pulseCounter->clear();
|
||||
this->pulseCounter->resume();
|
||||
|
||||
uint16_t count_abs = abs(this->calcAverage()); // Absolute time in milliseconds
|
||||
double n = (double)count_abs / steps; // Wheel revolutions in absolute time
|
||||
double u = (double)n / ((double)elapsed_time / 1000); // Wheel revolutions per second
|
||||
double ms = u * (diameter * PI); // Speed in m/s
|
||||
Component::loopDelay = Speedometer::loopDelay;
|
||||
|
||||
if (count > 0) {
|
||||
this->speed = ms;
|
||||
} else if (count < 0) {
|
||||
this->speed = ms * (-1);
|
||||
} else {
|
||||
this->speed = 0;
|
||||
this->clearAvgBuf();
|
||||
}
|
||||
|
||||
Speedometer::~Speedometer()
|
||||
{
|
||||
delete this->pulseCounter;
|
||||
}
|
||||
|
||||
void Speedometer::run()
|
||||
{
|
||||
static constexpr float minimalSpeed = 0.1;
|
||||
|
||||
if (this->calibrationRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// std::cout << "Speedometer::runSpeedometer speed: " << (int) this->speed << std::endl;
|
||||
const uint32_t time = millis();
|
||||
|
||||
const uint16_t elapsedTime = time - this->lastMillisCalc;
|
||||
this->lastMillisCalc = time;
|
||||
|
||||
const double pulse = this->pulseCounter->getValue();
|
||||
this->pulseCounter->clear();
|
||||
this->pulseCounter->resume();
|
||||
|
||||
const double wheelRevolutionsAbsolute = pulse / this->steps;
|
||||
const double wheelRevolutionsRelativ = wheelRevolutionsAbsolute / (elapsedTime / 1000.0);
|
||||
|
||||
double meterPerSecond = wheelRevolutionsRelativ * (diameter * PI);
|
||||
double radPerSecond = wheelRevolutionsRelativ * 2 * PI;
|
||||
|
||||
if (meterPerSecond < minimalSpeed)
|
||||
{
|
||||
meterPerSecond = 0;
|
||||
radPerSecond = 0;
|
||||
}
|
||||
|
||||
switch (this->currentDirection)
|
||||
{
|
||||
case Direction::Forward:
|
||||
this->speed = meterPerSecond;
|
||||
this->rad = radPerSecond;
|
||||
break;
|
||||
|
||||
case Direction::Backward:
|
||||
this->speed = -meterPerSecond;
|
||||
this->rad = -radPerSecond;
|
||||
break;
|
||||
|
||||
case Direction::None:
|
||||
this->speed = 0;
|
||||
this->rad = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
this->addValToBuf(static_cast<int16_t>(this->speed * Speedometer::conversionFactor));
|
||||
}
|
||||
|
||||
void Speedometer::setNumOfValForAvg(uint8_t val) {
|
||||
this->bufSize = val;
|
||||
updateAvgBufSize();
|
||||
void Speedometer::setDirection(Direction dir)
|
||||
{
|
||||
if (this->currentDirection == dir)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->currentDirection = dir;
|
||||
this->clearAvgBuf();
|
||||
}
|
||||
|
||||
void Speedometer::setEncFilter(uint16_t val) {
|
||||
if (val > 1023)
|
||||
val = 1023;
|
||||
this->pulseCounter->set_filter_value(val);
|
||||
void Speedometer::setEncFilter(uint16_t val)
|
||||
{
|
||||
if (val > Speedometer::maxFilterValue)
|
||||
{
|
||||
val = Speedometer::maxFilterValue;
|
||||
}
|
||||
this->pulseCounter->setFilterValue(val);
|
||||
}
|
||||
|
||||
void Speedometer::calibrationMeasurementStart() {
|
||||
double Speedometer::getAvgSpeed() const
|
||||
{
|
||||
const double avg = this->calcAverage();
|
||||
return avg / Speedometer::conversionFactor;
|
||||
}
|
||||
|
||||
void Speedometer::calibrationMeasurementStart()
|
||||
{
|
||||
std::cout << "Start" << std::endl;
|
||||
this->calibrationRunning = true;
|
||||
this->pulseCounter->clear();
|
||||
this->pulseCounter->resume();
|
||||
}
|
||||
|
||||
uint16_t Speedometer::calibrationMeasurementStop() {
|
||||
uint16_t Speedometer::calibrationMeasurementStop()
|
||||
{
|
||||
std::cout << "Ende" << std::endl;
|
||||
this->calibrationRunning = false;
|
||||
uint16_t res = abs(this->pulseCounter->get_value());
|
||||
const uint16_t res = abs(this->pulseCounter->getValue());
|
||||
this->pulseCounter->clear();
|
||||
this->pulseCounter->resume();
|
||||
std::cout << "Result: " << res << std::endl;
|
||||
return res;
|
||||
}
|
||||
|
||||
void Speedometer::init(uint8_t pin, double diameter, uint16_t steps) {
|
||||
this->diameter = diameter;
|
||||
this->steps = steps;
|
||||
|
||||
this->pulseCounter = new PulseCounter();
|
||||
this->pulseCounter->initialise(pin, PCNT_PIN_NOT_USED);
|
||||
this->pulseCounter->set_mode(PCNT_COUNT_INC, PCNT_COUNT_DIS, PCNT_MODE_KEEP, PCNT_MODE_KEEP);
|
||||
this->pulseCounter->set_filter_value(1000); // ignore pulses less than 1000 x 2.5ns
|
||||
|
||||
this->pulseCounter->clear();
|
||||
this->pulseCounter->resume();
|
||||
|
||||
initAvgBuf();
|
||||
}
|
||||
|
||||
void Speedometer::initAvgBuf() {
|
||||
this->buf = new int16_t[bufSize];
|
||||
void Speedometer::clearAvgBuf()
|
||||
{
|
||||
for (uint8_t i = 0; i < bufSize; i++)
|
||||
{
|
||||
this->buf[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Speedometer::addValToBuf(int16_t val) {
|
||||
void Speedometer::addValToBuf(int16_t val)
|
||||
{
|
||||
this->buf[this->bufPos] = val;
|
||||
this->bufPos++;
|
||||
|
||||
if (bufPos == bufSize)
|
||||
{
|
||||
bufPos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Speedometer::updateAvgBufSize() {
|
||||
delete[] this->buf;
|
||||
initAvgBuf();
|
||||
}
|
||||
|
||||
int16_t Speedometer::calcAverage() {
|
||||
int16_t Speedometer::calcAverage() const
|
||||
{
|
||||
int16_t sum = 0;
|
||||
for (int i = 0; i < this->bufSize; i++)
|
||||
for (int i = 0; i < Speedometer::bufSize; i++)
|
||||
{
|
||||
sum += this->buf[i];
|
||||
return sum / this->bufSize;
|
||||
}
|
||||
return sum / Speedometer::bufSize;
|
||||
}
|
||||
|
||||
+101
-129
@@ -15,20 +15,9 @@
|
||||
#include <Arduino.h>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <esp32_pcnt.h>
|
||||
|
||||
/**
|
||||
* @brief The default size of numbers to be taken in account for the average.
|
||||
*
|
||||
*/
|
||||
#define BUFSIZE 10
|
||||
|
||||
/**
|
||||
* @brief Default value for min Millisseconds between each loop
|
||||
* @see setDelay(uint8_t val)
|
||||
*/
|
||||
#define DELAY_SPEEDOMETER 30
|
||||
#define PI 3.1415926535897932384626433832795
|
||||
#include "counter.h"
|
||||
#include "component.h"
|
||||
|
||||
/**
|
||||
* @brief A class which use a encoder to calc the speed
|
||||
@@ -37,139 +26,122 @@
|
||||
* The calculated speed is the average of an amount of last measurements.
|
||||
*
|
||||
*/
|
||||
class Speedometer {
|
||||
public:
|
||||
/**
|
||||
* @brief Enum to control the direction.
|
||||
*
|
||||
* If the Direction is Forward, the internal counter counts up and a positiv speed will be returned.
|
||||
* If the Direction is Backward, the internal counter counts down and a negativ speed will be returned.
|
||||
* If the Dorection is None, no measurement will be taken.
|
||||
*/
|
||||
enum Direction {
|
||||
None,
|
||||
Forward,
|
||||
Backward
|
||||
};
|
||||
class Speedometer : public Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Enum to control the direction.
|
||||
*
|
||||
* If the Direction is Forward, the internal counter counts up and a positiv speed will be returned.
|
||||
* If the Direction is Backward, the internal counter counts down and a negativ speed will be returned.
|
||||
* If the Direction is None, no measurement will be taken.
|
||||
*/
|
||||
enum Direction
|
||||
{
|
||||
None,
|
||||
Forward,
|
||||
Backward
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Construct a new Speedometer object
|
||||
*
|
||||
* @param pin Pin on the Esp from the encoder.
|
||||
* @param diameter Diameter of the wheel in meters.
|
||||
* @param steps Encodersteps for a complete wheel rotation.
|
||||
* @param numOfValForAvg Number of last values to be taken into account for the average.
|
||||
*/
|
||||
Speedometer(uint8_t pin, double diameter, uint16_t steps, uint8_t numOfValForAvg);
|
||||
Speedometer(uint8_t pin, double diameter, uint16_t steps);
|
||||
/**
|
||||
* @brief Construct a new Speedometer object
|
||||
*
|
||||
* @param pin Pin on the Esp from the encoder.
|
||||
* @param diameter Diameter of the wheel in meters.
|
||||
* @param steps EncoderSteps for a complete wheel rotation.
|
||||
*/
|
||||
Speedometer(uint8_t pin, double diameter, uint16_t steps);
|
||||
|
||||
~Speedometer();
|
||||
~Speedometer();
|
||||
|
||||
/**
|
||||
* @brief Calls runSpeedometer() to update all Values.
|
||||
*
|
||||
* This function should be called every mainloop. If the delayLoop is not reached, than the
|
||||
* functions returns immediately.
|
||||
* @see runSpeedometer()
|
||||
* @see DELAY_SPEEDOMETER
|
||||
* @return time since the last call in Milliseconds
|
||||
*/
|
||||
uint16_t loop();
|
||||
/**
|
||||
* @brief Set the direction
|
||||
*
|
||||
* @param dir Direction
|
||||
*/
|
||||
void setDirection(Direction dir);
|
||||
|
||||
/**
|
||||
* @brief Normally called repeatedly by loop() to calculate new values.
|
||||
*
|
||||
* Add a new Value to the average and update the speed.
|
||||
*/
|
||||
void runSpeedometer();
|
||||
/**
|
||||
* @brief Set the Enc Filter to prevent bouncing
|
||||
*
|
||||
* ignore pulses less than val x 2.5ns
|
||||
*
|
||||
* @param val default = 1000, max = 1023
|
||||
*/
|
||||
void setEncFilter(uint16_t val);
|
||||
|
||||
/**
|
||||
* @brief Set the direction
|
||||
*
|
||||
* @param dir Direction
|
||||
*/
|
||||
void setDirection(Direction dir) { this->currentDirection = dir; }
|
||||
/**
|
||||
* @brief Get the Direction
|
||||
*
|
||||
* @return Direction
|
||||
*/
|
||||
Direction getDirection() const { return this->currentDirection; }
|
||||
|
||||
/**
|
||||
* @brief Set the number of last values to be taken into account for the average.
|
||||
*
|
||||
* @param val length of the array
|
||||
*/
|
||||
void setNumOfValForAvg(uint8_t val);
|
||||
/**
|
||||
* @brief Get the calculated speed of the wheel
|
||||
*
|
||||
* @return double speed in m/s
|
||||
*/
|
||||
double getSpeed() const { return this->speed; }
|
||||
|
||||
/**
|
||||
* @brief Set the Enc Filter to prevent bouncing
|
||||
*
|
||||
* ignore pulses less than val x 2.5ns
|
||||
*
|
||||
* @param val default = 1000, max = 1023
|
||||
*/
|
||||
void setEncFilter(uint16_t val);
|
||||
/**
|
||||
* @brief Get the calculated speed of the wheel
|
||||
*
|
||||
* @return double speed in rad/s
|
||||
*/
|
||||
double getSpeedRad() const { return this->rad; };
|
||||
|
||||
/**
|
||||
* @brief Set the min delayLoop between each loop
|
||||
*
|
||||
* @param delayLoop time in Milliseconds
|
||||
*/
|
||||
void setDelay(uint8_t delayLoop) { this->delayLoop = delayLoop; }
|
||||
/**
|
||||
* @brief Get the calculated average speed of the wheel
|
||||
*
|
||||
* @return double speed in m/s
|
||||
*/
|
||||
double getAvgSpeed() const;
|
||||
|
||||
/**
|
||||
* @brief Get the Direction
|
||||
*
|
||||
* @return Direction
|
||||
*/
|
||||
Direction getDirection() { return this->currentDirection; }
|
||||
/**
|
||||
* @brief Start calibration
|
||||
*
|
||||
* This functions stops the loop. So that steps of one manual wheel turn
|
||||
* can measured. Call calibrationMeasurementStop to start the loop and get
|
||||
* the result.
|
||||
*/
|
||||
void calibrationMeasurementStart();
|
||||
|
||||
/**
|
||||
* @brief Get the calculated speed of the Wheel
|
||||
*
|
||||
* @return double speed in m/s
|
||||
*/
|
||||
double getSpeed() { return this->speed; }
|
||||
/**
|
||||
* @brief Stop calibration
|
||||
*
|
||||
* Start the loop function and read the past steps.
|
||||
*
|
||||
* @return uint16_t steps since calibrationMeasurementStart was called
|
||||
*/
|
||||
uint16_t calibrationMeasurementStop();
|
||||
|
||||
/**
|
||||
* @brief Start calibration
|
||||
*
|
||||
* This functions stops the loop. So that steps of one manual wheel turn
|
||||
* can measured. Call calibrationMeasurementStop to start the loop and get
|
||||
* the result.
|
||||
*/
|
||||
void calibrationMeasurementStart();
|
||||
private:
|
||||
void run() override;
|
||||
void clearAvgBuf();
|
||||
void addValToBuf(int16_t val);
|
||||
int16_t calcAverage() const;
|
||||
|
||||
/**
|
||||
* @brief Stop calibration
|
||||
*
|
||||
* Start the loop function and read the past steps.
|
||||
*
|
||||
* @return uint16_t steps since calibrationMeasurementStart was called
|
||||
*/
|
||||
uint16_t calibrationMeasurementStop();
|
||||
static constexpr uint8_t loopDelay = 30;
|
||||
static constexpr uint8_t bufSize = 5;
|
||||
static constexpr uint8_t conversionFactor = 100;
|
||||
|
||||
Counter *pulseCounter;
|
||||
Direction currentDirection = Direction::None;
|
||||
|
||||
private:
|
||||
void init(uint8_t pin, double diameter, uint16_t steps);
|
||||
void initAvgBuf();
|
||||
void addValToBuf(int16_t val);
|
||||
void updateAvgBufSize();
|
||||
int16_t calcAverage();
|
||||
bool calibrationRunning = false;
|
||||
|
||||
PulseCounter* pulseCounter;
|
||||
Direction currentDirection = Direction::None;
|
||||
double speed = 0;
|
||||
double rad = 0;
|
||||
double diameter;
|
||||
|
||||
bool calibrationRunning = false;
|
||||
uint8_t printCounter = 0;
|
||||
uint8_t bufPos = 0;
|
||||
uint16_t steps;
|
||||
int16_t buf[Speedometer::bufSize];
|
||||
uint32_t lastMillisCalc = 0;
|
||||
|
||||
double speed = 0;
|
||||
double diameter;
|
||||
|
||||
uint8_t bufSize = BUFSIZE;
|
||||
uint8_t delayLoop = DELAY_SPEEDOMETER;
|
||||
uint8_t bufPos = 0;
|
||||
uint16_t steps;
|
||||
|
||||
int16_t *buf = nullptr;
|
||||
|
||||
uint32_t last_millis_loop = 0;
|
||||
uint32_t last_millis_calc = 0;
|
||||
static constexpr uint16_t maxFilterValue = 1023;
|
||||
};
|
||||
|
||||
#endif // SPEEDOMETER_H
|
||||
|
||||
+22
-11
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file debugTimes.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Implemention of the class debugTimes.h.
|
||||
* @brief Implementation of the class debugTimes.h.
|
||||
* @version 0.1
|
||||
* @date 2021-12-13
|
||||
*
|
||||
@@ -13,33 +13,44 @@
|
||||
bool DebugTimes::print = false;
|
||||
bool DebugTimes::printWarning = true;
|
||||
|
||||
DebugTimes::DebugTimes() {
|
||||
this->startTime = millis();
|
||||
|
||||
if (DebugTimes::printWarning) {
|
||||
std::cout << std::endl << "Warning: DebugTimes is muuted, no times are be shown." << std::endl << std::endl;
|
||||
DebugTimes::DebugTimes()
|
||||
: startTime{millis()}
|
||||
{
|
||||
if (DebugTimes::printWarning)
|
||||
{
|
||||
std::cout << std::endl
|
||||
<< "Warning: DebugTimes is muted, no times are be shown." << std::endl
|
||||
<< std::endl;
|
||||
DebugTimes::printWarning = false;
|
||||
}
|
||||
}
|
||||
|
||||
void DebugTimes::restart() {
|
||||
void DebugTimes::restart()
|
||||
{
|
||||
this->startTime = millis();
|
||||
}
|
||||
|
||||
uint16_t DebugTimes::stop() {
|
||||
const uint16_t DebugTimes::stop()
|
||||
{
|
||||
return millis() - this->startTime;
|
||||
}
|
||||
|
||||
uint16_t DebugTimes::stopConsol(const char* name, uint16_t minTime) {
|
||||
uint64_t time = millis() - this->startTime;
|
||||
const uint16_t DebugTimes::stopConsol(const char *name, uint16_t minTime)
|
||||
{
|
||||
const uint64_t time = millis() - this->startTime;
|
||||
if (time > minTime && DebugTimes::print)
|
||||
{
|
||||
std::cout << name << " needs " << time << " ms" << std::endl;
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
void DebugTimes::setConsolOutput(bool enable) {
|
||||
void DebugTimes::setConsolOutput(bool enable)
|
||||
{
|
||||
if (enable == DebugTimes::print)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DebugTimes::print = enable;
|
||||
DebugTimes::printWarning = !enable;
|
||||
|
||||
+38
-37
@@ -28,49 +28,50 @@
|
||||
* @warning This class is not very accurate
|
||||
* It only give you the time in milliseconds.
|
||||
*/
|
||||
class DebugTimes {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Debug Times object
|
||||
* Starts to count milliseconds
|
||||
*/
|
||||
class DebugTimes
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Debug Times object
|
||||
* Starts to count milliseconds
|
||||
*/
|
||||
|
||||
DebugTimes();
|
||||
/**
|
||||
* @brief Set the counter to 0
|
||||
*/
|
||||
DebugTimes();
|
||||
/**
|
||||
* @brief Set the counter to 0
|
||||
*/
|
||||
|
||||
void restart();
|
||||
void restart();
|
||||
|
||||
/**
|
||||
* @brief Give the elapsed time
|
||||
*
|
||||
* @return uint16_t elapsed milliseconds
|
||||
*/
|
||||
uint16_t stop();
|
||||
/**
|
||||
* @brief Give the elapsed time
|
||||
*
|
||||
* @return uint16_t elapsed milliseconds
|
||||
*/
|
||||
const uint16_t stop();
|
||||
|
||||
/**
|
||||
* @brief Print the elapsed time to consol
|
||||
*
|
||||
* @param name Functionname to print
|
||||
* @param minTime A minimum time before printing
|
||||
*
|
||||
* @return uint16_t elapsed milliseconds
|
||||
*/
|
||||
uint16_t stopConsol(const char* name, uint16_t minTime = 0);
|
||||
/**
|
||||
* @brief Print the elapsed time to consol
|
||||
*
|
||||
* @param name FunctionName to print
|
||||
* @param minTime A minimum time before printing
|
||||
*
|
||||
* @return uint16_t elapsed milliseconds
|
||||
*/
|
||||
const uint16_t stopConsol(const char *name, uint16_t minTime = 0);
|
||||
|
||||
/**
|
||||
* @brief Sets if the result should be printed.
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
static void setConsolOutput(bool enable);
|
||||
/**
|
||||
* @brief Sets if the result should be printed.
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
static void setConsolOutput(bool enable);
|
||||
|
||||
private:
|
||||
uint64_t startTime;
|
||||
private:
|
||||
uint64_t startTime;
|
||||
|
||||
static bool print;
|
||||
static bool printWarning;
|
||||
static bool print;
|
||||
static bool printWarning;
|
||||
};
|
||||
|
||||
#endif //DEBUG_TIMES_H
|
||||
#endif // DEBUG_TIMES_H
|
||||
|
||||
+26
-16
@@ -8,35 +8,45 @@
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[env]
|
||||
[env:embedded]
|
||||
platform = espressif32
|
||||
board = esp32doit-devkit-v1
|
||||
board_build.partitions = no_ota.csv
|
||||
framework = arduino
|
||||
monitor_speed = 115200
|
||||
upload_speed = 921600
|
||||
monitor_port = COM3
|
||||
; monitor_port = COM6
|
||||
lib_deps =
|
||||
jvpernis/PS3 Controller Host@^1.1.0
|
||||
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.7
|
||||
https://git.kleiax.de/PlatformIO-Libs/SparkFunGNSS.git
|
||||
https://git.kleiax.de/PlatformIO-Libs/Menu.git
|
||||
knolleary/PubSubClient@^2.8
|
||||
br3ttb/PID@^1.2.1
|
||||
marcoschwartz/LiquidCrystal_I2C@^1.1.4
|
||||
marian-craciunescu/ESP32Ping@^1.7
|
||||
bblanchon/ArduinoJson@^6.20.0
|
||||
mprograms/QMC5883LCompass@^1.1.1
|
||||
mike-gofton/ESP32PulseCounter@^0.2.0
|
||||
https://git.kleiax.de/PlatformIO-Libs/Menu.git#v1.0
|
||||
upload_port = COM3
|
||||
|
||||
[env:release]
|
||||
build_type = release
|
||||
lib_deps = mike-gofton/ESP32PulseCounter@^0.2.0
|
||||
|
||||
[env:debug]
|
||||
monitor_filters = esp32_exception_decoder
|
||||
mprograms/QMC5883LCompass@^1.2.0
|
||||
jrowberg/I2Cdevlib-MPU6050@^1.0.0
|
||||
; upload_port = COM6
|
||||
test_ignore = test_desktop
|
||||
build_type = debug
|
||||
monitor_filters = esp32_exception_decoder
|
||||
check_tool = clangtidy
|
||||
check_flags =
|
||||
clangtidy: --checks=-*,cert-*,cppcoreguidelines-*,clang-analyzer-*,google-*,hicpp-*,modernize-*,performance-*,portability-*,readability-*,bugprone-*,misc-*,openmp-*,objc-* --fix
|
||||
check_src_filters =
|
||||
+<src/*>
|
||||
+<lib/*>
|
||||
+<include/*>
|
||||
|
||||
[env:native]
|
||||
platform = native
|
||||
test_ignore = test_embedded
|
||||
|
||||
[platformio]
|
||||
description = A Rover who should be drive a route by gps.
|
||||
|
||||
|
||||
; Bei Möglichkeit folgendes aus clang tidy entfernen
|
||||
; cppcoreguidelines-owning-memory
|
||||
;
|
||||
;
|
||||
;
|
||||
|
||||
+38
-21
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file outputBufMqtt.cpp
|
||||
* @file outputBuf.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains the implementation of the class OutputBufMqtt
|
||||
* @version 0.1
|
||||
@@ -11,49 +11,66 @@
|
||||
|
||||
#include "OutputBuf/outputBuf.h"
|
||||
|
||||
OutputBuf::OutputBuf(DebugMqtt* debugMqtt, BluetoothSerial* serialBT)
|
||||
: std::streambuf() {
|
||||
this->debugMqtt = debugMqtt;
|
||||
this->serialBT = serialBT;
|
||||
|
||||
if (debugMqtt)
|
||||
OutputBuf::OutputBuf(DebugMqtt *debugMqtt, BluetoothSerial *serialBT)
|
||||
: debugMqtt{debugMqtt}, serialBT{serialBT}
|
||||
{
|
||||
if (static_cast<bool>(debugMqtt))
|
||||
{
|
||||
this->isMqttActive = true;
|
||||
}
|
||||
|
||||
if (serialBT)
|
||||
if (static_cast<bool>(serialBT))
|
||||
{
|
||||
this->isMqttActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
void OutputBuf::activateMqtt(bool status) {
|
||||
if (debugMqtt)
|
||||
void OutputBuf::activateMqtt(bool status)
|
||||
{
|
||||
if (static_cast<bool>(debugMqtt))
|
||||
{
|
||||
this->isMqttActive = status;
|
||||
}
|
||||
}
|
||||
|
||||
void OutputBuf::activateSerialBT(bool status) {
|
||||
if (serialBT)
|
||||
void OutputBuf::activateSerialBT(bool status)
|
||||
{
|
||||
if (static_cast<bool>(serialBT))
|
||||
{
|
||||
this->isSerialBTActive = status;
|
||||
}
|
||||
}
|
||||
|
||||
void OutputBuf::setDebugMqtt(DebugMqtt* debugMqtt) {
|
||||
void OutputBuf::setDebugMqtt(DebugMqtt *debugMqtt)
|
||||
{
|
||||
this->debugMqtt = debugMqtt;
|
||||
this->isMqttActive = true;
|
||||
}
|
||||
|
||||
void OutputBuf::setSerialBT(BluetoothSerial* serialBT) {
|
||||
void OutputBuf::setSerialBT(BluetoothSerial *serialBT)
|
||||
{
|
||||
this->serialBT = serialBT;
|
||||
this->isSerialBTActive = true;;
|
||||
this->isSerialBTActive = true;
|
||||
;
|
||||
}
|
||||
|
||||
std::streambuf::int_type OutputBuf::overflow(std::streambuf::int_type c) {
|
||||
if (c != EOF) {
|
||||
std::streambuf::int_type OutputBuf::overflow(std::streambuf::int_type character)
|
||||
{
|
||||
if (character != EOF)
|
||||
{
|
||||
// c = std::toupper(static_cast<char>(c), getloc());
|
||||
|
||||
if (this->debugMqtt && this->isMqttActive)
|
||||
this->debugMqtt->addCharacter((char) c);
|
||||
{
|
||||
this->debugMqtt->addCharacter(static_cast<char>(character));
|
||||
}
|
||||
|
||||
if (this->serialBT && this->isSerialBTActive && this->serialBT->connected())
|
||||
this->serialBT->print((char) c);
|
||||
{
|
||||
this->serialBT->print(static_cast<char>(character));
|
||||
}
|
||||
|
||||
Serial.print((char) c);
|
||||
Serial.print(static_cast<char>(character));
|
||||
}
|
||||
return c;
|
||||
return character;
|
||||
}
|
||||
|
||||
+45
-44
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file outputBufMqtt.h
|
||||
* @file outputBuf.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a small class that provide a streambuf
|
||||
*
|
||||
@@ -26,60 +26,61 @@
|
||||
#include <BluetoothSerial.h>
|
||||
|
||||
/**
|
||||
* @brief A alternativ streambuf for std::cout
|
||||
* @brief A alternative streambuf for std::cout
|
||||
*
|
||||
* The streambuf is used to double the std::cout to consol
|
||||
* and MQTT.
|
||||
*
|
||||
*/
|
||||
class OutputBuf : public std::streambuf {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Output Buf Mqtt object
|
||||
*
|
||||
* @param debugMqtt
|
||||
*/
|
||||
OutputBuf(DebugMqtt* debugMqtt = nullptr, BluetoothSerial* serialBT = nullptr);
|
||||
class OutputBuf : public std::streambuf
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Output Buf Mqtt object
|
||||
*
|
||||
* @param debugMqtt
|
||||
* @param serialBT
|
||||
*/
|
||||
OutputBuf(DebugMqtt *debugMqtt = nullptr, BluetoothSerial *serialBT = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Activate the mqtt output
|
||||
*
|
||||
* This only works if the DebugMqtt is set by
|
||||
* setDebugMqtt.
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
void activateMqtt(bool status);
|
||||
/**
|
||||
* @brief Activate the mqtt output
|
||||
*
|
||||
* This only works if the DebugMqtt is set by
|
||||
* setDebugMqtt().
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
void activateMqtt(bool status);
|
||||
|
||||
/**
|
||||
* @brief Active the output over the bluetooth serial consol
|
||||
*
|
||||
* This only works if BluetoothSerial is set by
|
||||
* setSerialBT.
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
void activateSerialBT(bool status);
|
||||
/**
|
||||
* @brief Active the output over the bluetooth serial consol
|
||||
*
|
||||
* This only works if BluetoothSerial is set by
|
||||
* setSerialBT().
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
void activateSerialBT(bool status);
|
||||
|
||||
void setDebugMqtt(DebugMqtt* debugMqtt);
|
||||
void setSerialBT(BluetoothSerial* serialBT);
|
||||
void setDebugMqtt(DebugMqtt *debugMqtt);
|
||||
void setSerialBT(BluetoothSerial *serialBT);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param c
|
||||
* @return std::streambuf::int_type
|
||||
*/
|
||||
virtual std::streambuf::int_type overflow(std::streambuf::int_type c);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param c
|
||||
* @return std::streambuf::int_type
|
||||
*/
|
||||
virtual std::streambuf::int_type overflow(std::streambuf::int_type c);
|
||||
private:
|
||||
bool isMqttActive = false;
|
||||
bool isSerialBTActive = false;
|
||||
|
||||
private:
|
||||
bool isMqttActive = false;
|
||||
bool isSerialBTActive = false;
|
||||
|
||||
DebugMqtt* debugMqtt;
|
||||
BluetoothSerial* serialBT;
|
||||
DebugMqtt *debugMqtt;
|
||||
BluetoothSerial *serialBT;
|
||||
};
|
||||
|
||||
#endif // OUTPUT_STREAM_MQTT_H
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* @file menuCalibrateBattery.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-26
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "menuCalibrateBattery.h"
|
||||
|
||||
MenuCalibrateBattery::MenuCalibrateBattery(Battery *battery)
|
||||
: battery{battery}
|
||||
{
|
||||
this->setUpdateDelay(MenuCalibrateBattery::updateDelay);
|
||||
}
|
||||
|
||||
void MenuCalibrateBattery::printMenu()
|
||||
{
|
||||
if (this->battery->getCalibrationState() == Battery::CalibrationState::None)
|
||||
{
|
||||
this->battery->startCalibration();
|
||||
}
|
||||
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
switch (this->battery->getCalibrationState())
|
||||
{
|
||||
case Battery::CalibrationState::Waiting:
|
||||
lineOne = "Target Voltage:";
|
||||
lineTwo = "7 + ";
|
||||
lineTwo.concat(this->battery->getCurrentCalibrationVoltage());
|
||||
lineTwo.concat(" / 10");
|
||||
break;
|
||||
|
||||
case Battery::CalibrationState::Reading:
|
||||
lineOne = "Reading...";
|
||||
break;
|
||||
|
||||
case Battery::CalibrationState::Finished:
|
||||
lineOne = "Finished!";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
|
||||
void MenuCalibrateBattery::left()
|
||||
{
|
||||
this->battery->finishCalibration();
|
||||
|
||||
if (static_cast<bool>(parentMenu))
|
||||
{
|
||||
this->parentMenu->printMenu();
|
||||
}
|
||||
}
|
||||
|
||||
void MenuCalibrateBattery::right()
|
||||
{
|
||||
if (this->battery->getCalibrationState() == Battery::CalibrationState::Waiting)
|
||||
{
|
||||
this->battery->nextVoltageIsReady();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @file menuCalibrateBattery.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a Menu class to calibrate the Battery class
|
||||
* @version 0.1
|
||||
* @date 2023-09-26
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MENU_CALIBRATE_BATTERY_H
|
||||
#define MENU_CALIBRATE_BATTERY_H
|
||||
|
||||
#include "menuControl.h"
|
||||
#include "battery.h"
|
||||
|
||||
/**
|
||||
* @brief A Menu class to calibrate the Battery class
|
||||
*/
|
||||
class MenuCalibrateBattery : public MenuControl
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new MenuCalibrateBattery object
|
||||
*
|
||||
* Prepare the calibration.
|
||||
*
|
||||
* @param battery
|
||||
*/
|
||||
MenuCalibrateBattery(Battery *battery);
|
||||
|
||||
/**
|
||||
* @brief Prints the instructions for the calibration
|
||||
*/
|
||||
void printMenu() override;
|
||||
|
||||
// User Inputs
|
||||
void left() override;
|
||||
void no() override { this->left(); }
|
||||
void right() override;
|
||||
void yes() override { this->right(); }
|
||||
|
||||
private:
|
||||
Battery *battery;
|
||||
|
||||
static constexpr uint16_t updateDelay = 400;
|
||||
};
|
||||
|
||||
#endif // MENU_CALIBRATE_BATTERY_H
|
||||
@@ -1,121 +0,0 @@
|
||||
/**
|
||||
* @file menuGPS.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains an implementation of the class MenuGPS
|
||||
* @version 0.1
|
||||
* @date 2022-01-29
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#include "menuGPS.h"
|
||||
|
||||
MenuGPS::MenuGPS(DriveManager* driveManager) :
|
||||
MenuInformationSites(10) {
|
||||
this->navigation = driveManager->getNavigation();
|
||||
this->ntripClient = this->navigation->getNTRIPClient();
|
||||
}
|
||||
|
||||
void MenuGPS::printPage() const {
|
||||
UBX_NAV_PVT_data_t* gpsData = this->navigation->getUbxData();
|
||||
uint8_t fixType = 0;
|
||||
if (gpsData)
|
||||
fixType = gpsData->fixType;
|
||||
|
||||
String lineOne = "Data isn't valid";
|
||||
String lineTwo = "or no GPS signal";
|
||||
|
||||
switch (this->getCurrentPage()) {
|
||||
case 0:
|
||||
if (fixType) {
|
||||
lineOne = "Sats: ";
|
||||
lineOne.concat(gpsData->numSV);
|
||||
lineTwo = "PDOP: ";
|
||||
lineTwo.concat(gpsData->pDOP);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (fixType) {
|
||||
lineOne = "Lat: ";
|
||||
lineOne.concat(gpsData->lat);
|
||||
lineTwo = "Lon: ";
|
||||
lineTwo.concat(gpsData->lon);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lineOne = "Time: ";
|
||||
lineTwo = "";
|
||||
if (fixType) {
|
||||
lineTwo.concat(gpsData->hour);
|
||||
lineTwo.concat(":");
|
||||
lineTwo.concat(gpsData->min);
|
||||
lineTwo.concat(":");
|
||||
lineTwo.concat(gpsData->sec);
|
||||
} else
|
||||
lineTwo = "00:00:00";
|
||||
|
||||
break;
|
||||
|
||||
case 3: {
|
||||
NTRIPClientStates status = this->ntripClient->getClientState();
|
||||
lineOne = "NTRIP Client is";
|
||||
|
||||
if (status == NTRIPClientStates::pushData)
|
||||
lineTwo = "enabled";
|
||||
else if (status == NTRIPClientStates::notAvailable)
|
||||
lineTwo = "not available";
|
||||
else
|
||||
lineTwo = "disabled";
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
lineOne = "Hrizntl Accuracy";
|
||||
if (fixType) {
|
||||
lineTwo = "";
|
||||
lineTwo.concat(gpsData->hAcc);
|
||||
} else
|
||||
lineTwo = "0";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
lineOne = "magDec: ";
|
||||
lineTwo = "magAcc: ";
|
||||
if (fixType) {
|
||||
lineOne.concat(gpsData->magDec);
|
||||
lineTwo.concat(gpsData->magAcc);
|
||||
} else {
|
||||
lineOne.concat("---");
|
||||
lineTwo.concat("---");
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
lineOne = "Azimuth: ";
|
||||
lineTwo = "";
|
||||
lineTwo.concat(this->navigation->getAzimuth());
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
|
||||
void MenuGPS::runCommand() const {
|
||||
switch (this->getCurrentPage()) {
|
||||
case 3: {
|
||||
// std::cout << "MenuGPS::runCommand " << this->ntripClient->getClientState() << std::endl;
|
||||
if (this->ntripClient->getClientState() == NTRIPClientStates::pushData)
|
||||
this->ntripClient->setActivated(false);
|
||||
else if (this->ntripClient->getClientState() != NTRIPClientStates::notAvailable)
|
||||
this->ntripClient->setActivated(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
/**
|
||||
* @file menuGPS.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a class to print informations about the GPS object
|
||||
* @version 0.1
|
||||
* @date 2022-01-29
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MENU_GPS_H
|
||||
#define MENU_GPS_H
|
||||
|
||||
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
|
||||
|
||||
#include "menuInformationSites.h"
|
||||
#include "driveModi/driveManager.h"
|
||||
#include "navigation.h"
|
||||
#include "ntripClient.h"
|
||||
|
||||
/**
|
||||
* @brief A class to print informations about the GPS object
|
||||
*
|
||||
*/
|
||||
class MenuGPS : public MenuInformationSites {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu GPS object
|
||||
*
|
||||
* @param gps
|
||||
*/
|
||||
MenuGPS(DriveManager* driveManager);
|
||||
|
||||
private:
|
||||
void printPage() const override;
|
||||
void runCommand() const override;
|
||||
|
||||
NTRIPClient* ntripClient;
|
||||
Navigation* navigation;
|
||||
};
|
||||
|
||||
#endif // MENU_GPS_H
|
||||
@@ -11,12 +11,13 @@
|
||||
|
||||
#include "menuPidSettings.h"
|
||||
|
||||
MenuPidSettings::MenuPidSettings(PID* pid) {
|
||||
this->pid = pid;
|
||||
}
|
||||
MenuPidSettings::MenuPidSettings(PID *pid) : pid{pid} {}
|
||||
|
||||
void MenuPidSettings::action(int16_t* values, uint8_t length) {
|
||||
void MenuPidSettings::action(int16_t *values, uint8_t length)
|
||||
{
|
||||
if (length != 3)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->pid->SetTunings(values[0], values[1], values[2]);
|
||||
}
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
* @brief A class to tune the PID settings
|
||||
*
|
||||
*/
|
||||
class MenuPidSettings : public MenuIntInputWrapper {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Pid Settings object
|
||||
*
|
||||
* @param pid
|
||||
*/
|
||||
MenuPidSettings(PID* pid);
|
||||
class MenuPidSettings : public MenuIntInputWrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Pid Settings object
|
||||
*
|
||||
* @param pid
|
||||
*/
|
||||
MenuPidSettings(PID *pid);
|
||||
|
||||
void action(int16_t* values, uint8_t length);
|
||||
|
||||
private:
|
||||
PID* pid;
|
||||
void action(int16_t *values, uint8_t length) override;
|
||||
|
||||
private:
|
||||
PID *pid;
|
||||
};
|
||||
|
||||
#endif // PID_SETTINGS_H
|
||||
|
||||
@@ -11,26 +11,33 @@
|
||||
|
||||
#include "menuRoute.h"
|
||||
|
||||
MenuActionRoute::MenuActionRoute(MenuRoute* menuRoute, DataFunction dataFunction) {
|
||||
this->menuRoute = menuRoute;
|
||||
this->dataFunction = dataFunction;
|
||||
MenuActionRoute::MenuActionRoute(MenuRoute *menuRoute, DataFunction dataFunction)
|
||||
: menuRoute{menuRoute}, dataFunction{dataFunction}
|
||||
{
|
||||
}
|
||||
|
||||
void MenuActionRoute::action() {
|
||||
void MenuActionRoute::action()
|
||||
{
|
||||
(this->menuRoute->*this->dataFunction)(0);
|
||||
}
|
||||
|
||||
MenuRoute::MenuRoute(Route* route) {
|
||||
this->route = route;
|
||||
MenuRoute::MenuRoute(Route *route)
|
||||
: route{route}
|
||||
{
|
||||
}
|
||||
|
||||
MenuRoute::~MenuRoute() {
|
||||
MenuRoute::~MenuRoute()
|
||||
{
|
||||
if (isInit)
|
||||
{
|
||||
delete this->mainMenu;
|
||||
}
|
||||
}
|
||||
|
||||
void MenuRoute::printMenu() {
|
||||
if (!this->isInit) {
|
||||
void MenuRoute::printMenu()
|
||||
{
|
||||
if (!this->isInit)
|
||||
{
|
||||
this->isInit = true;
|
||||
this->init();
|
||||
}
|
||||
@@ -38,93 +45,122 @@ void MenuRoute::printMenu() {
|
||||
this->mainMenu->printMenu();
|
||||
}
|
||||
|
||||
|
||||
void MenuRoute::down() {
|
||||
if (blockInput) return;
|
||||
void MenuRoute::down()
|
||||
{
|
||||
if (blockInput)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->mainMenu->down();
|
||||
}
|
||||
|
||||
void MenuRoute::up() {
|
||||
if (blockInput) return;
|
||||
void MenuRoute::up()
|
||||
{
|
||||
if (blockInput)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->mainMenu->up();
|
||||
}
|
||||
|
||||
void MenuRoute::right() {
|
||||
if (blockInput) return;
|
||||
void MenuRoute::right()
|
||||
{
|
||||
if (blockInput)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->mainMenu->right();
|
||||
}
|
||||
|
||||
void MenuRoute::left() {
|
||||
if (blockInput) return;
|
||||
void MenuRoute::left()
|
||||
{
|
||||
if (blockInput)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this->mainMenu->isInSubmenu())
|
||||
{
|
||||
this->mainMenu->left();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->parentMenu->printMenu();
|
||||
}
|
||||
}
|
||||
|
||||
void MenuRoute::yes() {
|
||||
if (blockInput) return;
|
||||
void MenuRoute::yes()
|
||||
{
|
||||
if (blockInput)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->mainMenu->yes();
|
||||
}
|
||||
|
||||
void MenuRoute::no() {
|
||||
if (blockInput) return;
|
||||
void MenuRoute::no()
|
||||
{
|
||||
if (blockInput)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this->mainMenu->isInSubmenu())
|
||||
{
|
||||
this->mainMenu->no();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->left();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MenuRoute::init() {
|
||||
void MenuRoute::init()
|
||||
{
|
||||
// auto dummy = []() {
|
||||
// std::cout << "Dummy in Action" <<std::endl;
|
||||
// };
|
||||
|
||||
this->mainMenu = new Menu;
|
||||
MenuRoutePoints* pointsMenu = new MenuRoutePoints(this->route);
|
||||
Menu* importMenu = new Menu;
|
||||
Menu* exportMenu = new Menu;
|
||||
Menu* clearMenu = new Menu;
|
||||
auto *pointsMenu = new MenuRoutePoints(this->route);
|
||||
|
||||
this->mainMenu->setLcd(this->lcd);
|
||||
pointsMenu->setLcd(this->lcd);
|
||||
importMenu->setLcd(this->lcd);
|
||||
exportMenu->setLcd(this->lcd);
|
||||
clearMenu->setLcd(this->lcd);
|
||||
|
||||
MenuIntInput* importWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::importRoute));
|
||||
MenuIntInput* exportWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::exportRoute));
|
||||
MenuActionRoute* clearWrapper = new MenuActionRoute(this, &MenuRoute::clearRoute);
|
||||
auto *importWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::importRoute));
|
||||
auto *exportWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::exportRoute));
|
||||
auto *deleteWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::deleteRoute));
|
||||
auto *clearWrapper = new MenuActionRoute(this, &MenuRoute::clearRoute);
|
||||
|
||||
importWrapper->setLcd(this->lcd);
|
||||
importWrapper->setMinMax(0, 100);
|
||||
importWrapper->setMinMax(0, MenuRoute::maxRouteNumber);
|
||||
importWrapper->setPrintParentMenu(false);
|
||||
importWrapper->setEntry(0, "Import Route");
|
||||
|
||||
exportWrapper->setLcd(this->lcd);
|
||||
exportWrapper->setMinMax(0, 100);
|
||||
exportWrapper->setMinMax(0, MenuRoute::maxRouteNumber);
|
||||
exportWrapper->setPrintParentMenu(false);
|
||||
exportWrapper->setEntry(0, "Export Route");
|
||||
|
||||
MenuAction* pointsAction = new MenuAction("Points", pointsMenu);
|
||||
MenuAction* importAction = new MenuAction("Import", importWrapper);
|
||||
MenuAction* exportAction = new MenuAction("Export", exportWrapper);
|
||||
MenuAction* clearAction = new MenuAction("Clear", clearWrapper);
|
||||
deleteWrapper->setLcd(this->lcd);
|
||||
deleteWrapper->setMinMax(0, MenuRoute::maxRouteNumber);
|
||||
deleteWrapper->setPrintParentMenu(false);
|
||||
deleteWrapper->setEntry(0, "Delete Route");
|
||||
|
||||
this->mainMenu->addEntry(pointsAction);
|
||||
this->mainMenu->addEntry(importAction);
|
||||
this->mainMenu->addEntry(exportAction);
|
||||
this->mainMenu->addEntry(clearAction);
|
||||
this->mainMenu->addEntry(new MenuAction("Points", pointsMenu));
|
||||
this->mainMenu->addEntry(new MenuAction("Clear", clearWrapper));
|
||||
this->mainMenu->addEntry(new MenuAction("Import", importWrapper));
|
||||
this->mainMenu->addEntry(new MenuAction("Export", exportWrapper));
|
||||
this->mainMenu->addEntry(new MenuAction("Delete", deleteWrapper));
|
||||
}
|
||||
|
||||
void MenuRoute::importRoute(uint8_t routeNumber) {
|
||||
void MenuRoute::importRoute(uint8_t routeNumber)
|
||||
{
|
||||
this->blockInput = true;
|
||||
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
if (WiFi.status() != WL_CONNECTED) {
|
||||
if (WiFi.status() != WL_CONNECTED)
|
||||
{
|
||||
lineOne = "Not connected to";
|
||||
lineTwo = "the WiFi.";
|
||||
this->print(lineOne, lineTwo);
|
||||
@@ -132,7 +168,8 @@ void MenuRoute::importRoute(uint8_t routeNumber) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ESP.getMaxAllocHeap() < JSON_DOCUMENT_SIZE_ROUTE) {
|
||||
if (ESP.getMaxAllocHeap() < JSON_DOCUMENT_SIZE_ROUTE)
|
||||
{
|
||||
lineOne = "Not enough mem";
|
||||
lineTwo = "for Json obj";
|
||||
this->print(lineOne, lineTwo);
|
||||
@@ -147,20 +184,25 @@ void MenuRoute::importRoute(uint8_t routeNumber) {
|
||||
String host = "http://rover.kleiax.de/api/";
|
||||
host.concat(routeNumber);
|
||||
http.begin(client, host);
|
||||
int httpResponseCode = http.GET();
|
||||
const int httpResponseCode = http.GET();
|
||||
|
||||
lineOne = "Import complete";
|
||||
lineTwo = "Code: ";
|
||||
|
||||
if (httpResponseCode == 202)
|
||||
if (httpResponseCode == MenuRoute::httpValidImport)
|
||||
{
|
||||
deserializeJson(doc, http.getStream());
|
||||
}
|
||||
else
|
||||
{
|
||||
lineOne = "HTTP Error";
|
||||
}
|
||||
|
||||
lineTwo.concat(httpResponseCode);
|
||||
this->print(lineOne, lineTwo);
|
||||
|
||||
if (httpResponseCode <= 0) {
|
||||
if (httpResponseCode <= 0)
|
||||
{
|
||||
this->blockInput = false;
|
||||
return;
|
||||
}
|
||||
@@ -168,7 +210,8 @@ void MenuRoute::importRoute(uint8_t routeNumber) {
|
||||
uint16_t totalPoints = doc["amountPoints"];
|
||||
|
||||
this->route->clear();
|
||||
for (uint16_t i = 0; i < totalPoints; i++) {
|
||||
for (uint16_t i = 0; i < totalPoints; i++)
|
||||
{
|
||||
Point::Coordinates coords;
|
||||
coords.lat = doc["points"][i][0].as<double>();
|
||||
coords.lon = doc["points"][i][1].as<double>();
|
||||
@@ -179,14 +222,16 @@ void MenuRoute::importRoute(uint8_t routeNumber) {
|
||||
http.end();
|
||||
}
|
||||
|
||||
void MenuRoute::exportRoute(uint8_t routeNumber) {
|
||||
void MenuRoute::exportRoute(uint8_t routeNumber)
|
||||
{
|
||||
this->blockInput = true;
|
||||
uint16_t totalPoints = this->route->getRouteInfo().totalPoints;
|
||||
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
if (WiFi.status() != WL_CONNECTED) {
|
||||
if (WiFiSTAClass::status() != WL_CONNECTED)
|
||||
{
|
||||
lineOne = "Not connected to";
|
||||
lineTwo = "the WiFi.";
|
||||
this->print(lineOne, lineTwo);
|
||||
@@ -194,7 +239,8 @@ void MenuRoute::exportRoute(uint8_t routeNumber) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ESP.getMaxAllocHeap() < JSON_DOCUMENT_SIZE_ROUTE) {
|
||||
if (ESP.getMaxAllocHeap() < JSON_DOCUMENT_SIZE_ROUTE)
|
||||
{
|
||||
lineOne = "Not enough mem";
|
||||
lineTwo = "for Json obj";
|
||||
this->print(lineOne, lineTwo);
|
||||
@@ -209,7 +255,8 @@ void MenuRoute::exportRoute(uint8_t routeNumber) {
|
||||
Point::Coordinates coords = this->route->startRoute().getCoordinates();
|
||||
doc["points"][0][0] = coords.lat;
|
||||
doc["points"][0][1] = coords.lon;
|
||||
for (uint16_t i = 1; i < totalPoints; i++) {
|
||||
for (uint16_t i = 1; i < totalPoints; i++)
|
||||
{
|
||||
coords = this->route->getNextPoint().getCoordinates();
|
||||
doc["points"][i][0] = coords.lat;
|
||||
doc["points"][i][1] = coords.lon;
|
||||
@@ -222,12 +269,16 @@ void MenuRoute::exportRoute(uint8_t routeNumber) {
|
||||
|
||||
http.begin(client, "http://rover.kleiax.de/api/");
|
||||
http.addHeader("Content-Type", "application/json");
|
||||
int httpResponseCode = http.POST(jsonData);
|
||||
const int httpResponseCode = http.POST(jsonData);
|
||||
|
||||
if (httpResponseCode == 201)
|
||||
if (httpResponseCode == MenuRoute::httpValidExport)
|
||||
{
|
||||
lineOne = "Export complete";
|
||||
}
|
||||
else
|
||||
{
|
||||
lineOne = "HTTP Error";
|
||||
}
|
||||
lineTwo = "Code: ";
|
||||
lineTwo.concat(httpResponseCode);
|
||||
this->print(lineOne, lineTwo);
|
||||
@@ -236,29 +287,89 @@ void MenuRoute::exportRoute(uint8_t routeNumber) {
|
||||
http.end();
|
||||
}
|
||||
|
||||
void MenuRoute::clearRoute(uint8_t none) {
|
||||
void MenuRoute::deleteRoute(uint8_t routeNumber)
|
||||
{
|
||||
this->blockInput = true;
|
||||
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
if (WiFiSTAClass::status() != WL_CONNECTED)
|
||||
{
|
||||
lineOne = "Not connected to";
|
||||
lineTwo = "the WiFi.";
|
||||
this->print(lineOne, lineTwo);
|
||||
this->blockInput = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ESP.getMaxAllocHeap() < JSON_DOCUMENT_SIZE_ROUTE)
|
||||
{
|
||||
lineOne = "Not enough mem";
|
||||
lineTwo = "for Json obj";
|
||||
this->print(lineOne, lineTwo);
|
||||
this->blockInput = false;
|
||||
return;
|
||||
}
|
||||
|
||||
WiFiClient client;
|
||||
HTTPClient http;
|
||||
DynamicJsonDocument doc(JSON_DOCUMENT_SIZE_ROUTE);
|
||||
|
||||
String host = "http://rover.kleiax.de/api/";
|
||||
host.concat(routeNumber);
|
||||
http.begin(client, host);
|
||||
const int httpResponseCode = http.sendRequest("DELETE");
|
||||
|
||||
lineOne = "Delete complete";
|
||||
lineTwo = "Code: ";
|
||||
|
||||
if (httpResponseCode == MenuRoute::httpValidDelete)
|
||||
{
|
||||
deserializeJson(doc, http.getStream());
|
||||
}
|
||||
else
|
||||
{
|
||||
lineOne = "HTTP Error";
|
||||
}
|
||||
|
||||
lineTwo.concat(httpResponseCode);
|
||||
this->print(lineOne, lineTwo);
|
||||
|
||||
this->blockInput = false;
|
||||
http.end();
|
||||
}
|
||||
|
||||
void MenuRoute::clearRoute(uint8_t none)
|
||||
{
|
||||
// The parameter exist only for compability
|
||||
none;
|
||||
this->route->clear();
|
||||
this->print("Currente route", "deleted...");
|
||||
}
|
||||
|
||||
MenuRouteWrapper::MenuRouteWrapper(MenuRoute* menuRoute, DataFunction dataFunction) {
|
||||
this->menuRoute = menuRoute;
|
||||
this->dataFunction = dataFunction;
|
||||
MenuRouteWrapper::MenuRouteWrapper(MenuRoute *menuRoute, DataFunction dataFunction)
|
||||
: menuRoute{menuRoute}, dataFunction{dataFunction}
|
||||
{
|
||||
}
|
||||
|
||||
void MenuRouteWrapper::action(int16_t* values, uint8_t length) {
|
||||
if (length < 1) {
|
||||
void MenuRouteWrapper::action(int16_t *values, uint8_t length)
|
||||
{
|
||||
if (length < 1)
|
||||
{
|
||||
std::cout << "Error in MenuRouteWrapper::action" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (values[0] < 0)
|
||||
{
|
||||
values[0] = 0;
|
||||
}
|
||||
|
||||
if (values[0] > UINT8_MAX)
|
||||
{
|
||||
values[0] = UINT8_MAX;
|
||||
}
|
||||
|
||||
(this->menuRoute->*this->dataFunction)(values[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,24 +34,25 @@ typedef void (MenuRoute::*DataFunction)(uint8_t);
|
||||
* This class should be used to call importRoute,
|
||||
* exportRoute and clearRoute over the Menu.
|
||||
*/
|
||||
class MenuActionRoute : public MenuActionWrapper {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Action Route object
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction like exportRoute
|
||||
*/
|
||||
MenuActionRoute(MenuRoute* menuRoute, DataFunction dataFunction);
|
||||
class MenuActionRoute : public MenuActionWrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Action Route object
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction like exportRoute
|
||||
*/
|
||||
MenuActionRoute(MenuRoute *menuRoute, DataFunction dataFunction);
|
||||
|
||||
/**
|
||||
* @brief Runs the given DataFunction
|
||||
*/
|
||||
void action() override;
|
||||
/**
|
||||
* @brief Runs the given DataFunction
|
||||
*/
|
||||
void action() override;
|
||||
|
||||
private:
|
||||
MenuRoute* menuRoute;
|
||||
DataFunction dataFunction;
|
||||
private:
|
||||
MenuRoute *menuRoute;
|
||||
DataFunction dataFunction;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -59,98 +60,114 @@ class MenuActionRoute : public MenuActionWrapper {
|
||||
*
|
||||
* With this menu the user can import, export and delete routes.
|
||||
*/
|
||||
class MenuRoute : public MenuControl {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route object
|
||||
*
|
||||
* @param route
|
||||
*/
|
||||
MenuRoute(Route* route);
|
||||
~MenuRoute();
|
||||
class MenuRoute : public MenuControl
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route object
|
||||
*
|
||||
* @param route
|
||||
*/
|
||||
MenuRoute(Route *route);
|
||||
~MenuRoute();
|
||||
|
||||
/**
|
||||
* @brief Prints the last informations
|
||||
*
|
||||
* On first call this function calls the init function.
|
||||
* On every call this functions call the printMenu function from
|
||||
* the mainMenu of this class.
|
||||
*/
|
||||
void printMenu() override;
|
||||
/**
|
||||
* @brief Prints the last informations
|
||||
*
|
||||
* On first call this function calls the init function.
|
||||
* On every call this functions call the printMenu function from
|
||||
* the mainMenu of this class.
|
||||
*/
|
||||
void printMenu() override;
|
||||
|
||||
/**
|
||||
* @name User Inputs
|
||||
* @brief Inputs given by the parentMenu
|
||||
*/
|
||||
///@{
|
||||
void down() override;
|
||||
void up() override;
|
||||
void right() override;
|
||||
void left() override;
|
||||
void yes() override;
|
||||
void no() override;
|
||||
///@}
|
||||
/**
|
||||
* @name User Inputs
|
||||
* @brief Inputs given by the parentMenu
|
||||
*/
|
||||
///@{
|
||||
void down() override;
|
||||
void up() override;
|
||||
void right() override;
|
||||
void left() override;
|
||||
void yes() override;
|
||||
void no() override;
|
||||
///@}
|
||||
|
||||
/**
|
||||
* @brief Import a Route.
|
||||
*
|
||||
* The functions tries to pull the given route id from the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void importRoute(uint8_t routeNumber);
|
||||
/**
|
||||
* @brief Import a Route.
|
||||
*
|
||||
* The functions tries to pull the given route id from the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void importRoute(uint8_t routeNumber);
|
||||
|
||||
/**
|
||||
* @brief Export a Route.
|
||||
*
|
||||
* The functions tries to push the current route to the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void exportRoute(uint8_t routeNumber);
|
||||
/**
|
||||
* @brief Export a Route.
|
||||
*
|
||||
* The functions tries to push the current route to the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void exportRoute(uint8_t routeNumber);
|
||||
|
||||
/**
|
||||
* @brief Delete the current Route.
|
||||
*
|
||||
* @param none this param is not be used.
|
||||
*/
|
||||
void clearRoute(uint8_t none);
|
||||
/**
|
||||
* @brief Delete a Route
|
||||
*
|
||||
* The functions tries to delete the current route from the RoverApi.
|
||||
*
|
||||
* @param routeNumber
|
||||
*/
|
||||
void deleteRoute(uint8_t routeNumber);
|
||||
|
||||
private:
|
||||
void init();
|
||||
/**
|
||||
* @brief Delete the current Route.
|
||||
*
|
||||
* @param none this param is not be used.
|
||||
*/
|
||||
void clearRoute(uint8_t none);
|
||||
|
||||
Route* route;
|
||||
Menu* mainMenu;
|
||||
private:
|
||||
void init();
|
||||
|
||||
bool isInit = false;
|
||||
bool blockInput = false;
|
||||
Route *route;
|
||||
Menu *mainMenu = nullptr;
|
||||
|
||||
bool isInit = false;
|
||||
bool blockInput = false;
|
||||
|
||||
static constexpr uint8_t maxRouteNumber = 100;
|
||||
static constexpr uint16_t httpValidExport = 201;
|
||||
static constexpr uint16_t httpValidImport = 202;
|
||||
static constexpr uint16_t httpValidDelete = 202;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief MenuRouteWrapper to call DataFunctions with numeric user input
|
||||
*
|
||||
*/
|
||||
class MenuRouteWrapper : public MenuIntInputWrapper {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Wrapper object.
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction
|
||||
*/
|
||||
MenuRouteWrapper(MenuRoute* menuRoute, DataFunction dataFunction);
|
||||
class MenuRouteWrapper : public MenuIntInputWrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Wrapper object.
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction
|
||||
*/
|
||||
MenuRouteWrapper(MenuRoute *menuRoute, DataFunction dataFunction);
|
||||
|
||||
/**
|
||||
* @brief Calls the given DataFunction.
|
||||
*
|
||||
* @param values The value to be given to the DataFunction.
|
||||
* @param length Number of values, should be 1.
|
||||
*/
|
||||
void action(int16_t* values, uint8_t length) override;
|
||||
/**
|
||||
* @brief Calls the given DataFunction.
|
||||
*
|
||||
* @param values The value to be given to the DataFunction.
|
||||
* @param length Number of values, should be 1.
|
||||
*/
|
||||
void action(int16_t *values, uint8_t length) override;
|
||||
|
||||
private:
|
||||
MenuRoute* menuRoute;
|
||||
DataFunction dataFunction = nullptr;
|
||||
private:
|
||||
MenuRoute *menuRoute;
|
||||
DataFunction dataFunction = nullptr;
|
||||
};
|
||||
|
||||
#endif // MENU_ROUTE_H
|
||||
|
||||
@@ -11,27 +11,41 @@
|
||||
|
||||
#include "menuRoutePoints.h"
|
||||
|
||||
MenuRoutePoints::MenuRoutePoints(Route *route) : MenuInformationSites() {
|
||||
this->route = route;
|
||||
MenuRoutePoints::MenuRoutePoints(Route *route)
|
||||
: route{route}
|
||||
{
|
||||
}
|
||||
|
||||
void MenuRoutePoints::init() {
|
||||
uint16_t amountPoints = this->route->getRouteInfo().totalPoints;
|
||||
void MenuRoutePoints::init()
|
||||
{
|
||||
const uint16_t amountPoints = this->route->getRouteInfo().totalPoints;
|
||||
if (amountPoints > UINT8_MAX)
|
||||
{
|
||||
this->error = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setCountPages(amountPoints);
|
||||
}
|
||||
}
|
||||
|
||||
void MenuRoutePoints::printPage() const {
|
||||
uint8_t currentPage = this->getCurrentPage();
|
||||
void MenuRoutePoints::printPage() const
|
||||
{
|
||||
static constexpr int8_t width = 9;
|
||||
static constexpr int8_t prec = 7;
|
||||
static constexpr int8_t bufSize = 20;
|
||||
|
||||
const uint8_t currentPage = this->getCurrentPage();
|
||||
if (this->lastPageNumber == currentPage)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String lineOne = "N ";
|
||||
String lineTwo = "E ";
|
||||
|
||||
if (this->error) {
|
||||
if (this->error)
|
||||
{
|
||||
lineOne = "Error: To much";
|
||||
lineTwo = "points are given";
|
||||
this->print(lineOne, lineTwo);
|
||||
@@ -39,35 +53,46 @@ void MenuRoutePoints::printPage() const {
|
||||
}
|
||||
|
||||
RouteInfo info = this->route->getRouteInfo();
|
||||
if (info.totalPoints == 0) {
|
||||
if (info.totalPoints == 0)
|
||||
{
|
||||
lineOne = "No Points are";
|
||||
lineTwo = "available";
|
||||
this->print(lineOne, lineTwo);
|
||||
return;
|
||||
}
|
||||
|
||||
Point p;
|
||||
Point point;
|
||||
if (currentPage == 0)
|
||||
p = this->route->startRoute();
|
||||
{
|
||||
point = this->route->startRoute();
|
||||
}
|
||||
else if (this->lastPageNumber - 1 == currentPage)
|
||||
p = this->route->getPreviousPoint();
|
||||
{
|
||||
point = this->route->getPreviousPoint();
|
||||
}
|
||||
else if (this->lastPageNumber + 1 == currentPage)
|
||||
p = this->route->getNextPoint();
|
||||
{
|
||||
point = this->route->getNextPoint();
|
||||
}
|
||||
else if (currentPage == this->getCountPages() - 1)
|
||||
p = this->route->endRoute();
|
||||
{
|
||||
point = this->route->endRoute();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Error in: MenuRoutePoints::printPage()" << std::endl;
|
||||
}
|
||||
|
||||
char buf[20];
|
||||
char* string;
|
||||
char buf[bufSize];
|
||||
char *string;
|
||||
|
||||
info = this->route->getRouteInfo();
|
||||
string = dtostrf(p.getLatitude(), 9, 7, buf);
|
||||
string = dtostrf(point.getLatitude(), width, prec, static_cast<char *>(buf));
|
||||
lineOne.concat(string);
|
||||
lineOne.concat(" ");
|
||||
lineOne.concat(info.currentPoint);
|
||||
// lineOne.concat(currentPage);
|
||||
string = dtostrf(p.getLongitude(), 9, 7, buf);
|
||||
string = dtostrf(point.getLongitude(), width, prec, static_cast<char *>(buf));
|
||||
lineTwo.concat(string);
|
||||
lineTwo.concat(" ");
|
||||
lineTwo.concat(info.totalPoints);
|
||||
|
||||
@@ -20,31 +20,31 @@
|
||||
* @brief Prints coordinates of Route side by side.
|
||||
*
|
||||
*/
|
||||
class MenuRoutePoints : public MenuInformationSites {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Points object
|
||||
*
|
||||
* @param route
|
||||
*/
|
||||
MenuRoutePoints(Route *route);
|
||||
class MenuRoutePoints : public MenuInformationSites
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Points object
|
||||
*
|
||||
* @param route
|
||||
*/
|
||||
MenuRoutePoints(Route *route);
|
||||
|
||||
/**
|
||||
* @brief Configure the base class MenuInformationSites
|
||||
*
|
||||
* Set the amount of pages.
|
||||
*/
|
||||
void init () override;
|
||||
/**
|
||||
* @brief Configure the base class MenuInformationSites
|
||||
*
|
||||
* Set the amount of pages.
|
||||
*/
|
||||
void init() override;
|
||||
|
||||
/**
|
||||
* @brief Prints the the coordinates of the current Point.
|
||||
*/
|
||||
void printPage() const override;
|
||||
|
||||
private:
|
||||
Route* route;
|
||||
bool error = false;
|
||||
/**
|
||||
* @brief Prints the the coordinates of the current Point.
|
||||
*/
|
||||
void printPage() const override;
|
||||
|
||||
private:
|
||||
Route *route;
|
||||
bool error = false;
|
||||
};
|
||||
|
||||
#endif // MENU_ROUTE_POINTS_H
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
/**
|
||||
* @file menuSensorData.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-04
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "menuSensorData.h"
|
||||
|
||||
MenuSensorData::MenuSensorData(SensorData *sensorData) : MenuInformationSites(7), sensorData{sensorData}
|
||||
{
|
||||
this->noEqualLeft = true;
|
||||
}
|
||||
|
||||
void MenuSensorData::printPage() const
|
||||
{
|
||||
const UBX_NAV_PVT_data_t *gpsData = this->sensorData->getGnssData();
|
||||
uint8_t fixType = 0;
|
||||
if (static_cast<bool>(gpsData))
|
||||
{
|
||||
fixType = gpsData->fixType;
|
||||
}
|
||||
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 0:
|
||||
lineOne = " Y P R :";
|
||||
lineTwo.concat(this->sensorData->getGyroData()[0]);
|
||||
lineTwo.concat(" ");
|
||||
lineTwo.concat(this->sensorData->getGyroData()[1]);
|
||||
lineTwo.concat(" ");
|
||||
lineTwo.concat(this->sensorData->getGyroData()[2]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lineOne = "Real Azimuth:";
|
||||
lineTwo.concat(this->sensorData->getRealAzimuth());
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lineOne = "Calc Azimuth:";
|
||||
lineTwo.concat(this->sensorData->getCalcAzimuth());
|
||||
lineTwo.concat(" ");
|
||||
lineTwo.concat(CalcAzimuth::stateToString(this->sensorData->getCalcAzimuthState()));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
{
|
||||
lineOne = "Lat:";
|
||||
lineTwo = "Lon:";
|
||||
const Point pos = this->sensorData->getCurrentPos();
|
||||
lineOne.concat(pos.getLatitude());
|
||||
lineTwo.concat(pos.getLongitude());
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
lineOne = "Time: ";
|
||||
lineTwo = "";
|
||||
if (static_cast<bool>(fixType))
|
||||
{
|
||||
if (gpsData->hour < 10)
|
||||
{
|
||||
lineTwo.concat("0");
|
||||
}
|
||||
lineTwo.concat(gpsData->hour);
|
||||
lineTwo.concat(":");
|
||||
if (gpsData->min < 10)
|
||||
{
|
||||
lineTwo.concat("0");
|
||||
}
|
||||
lineTwo.concat(gpsData->min);
|
||||
lineTwo.concat(":");
|
||||
if (gpsData->sec < 10)
|
||||
{
|
||||
lineTwo.concat("0");
|
||||
}
|
||||
lineTwo.concat(gpsData->sec);
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo = "00:00:00";
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 5:
|
||||
{
|
||||
lineOne = "CarSol: ";
|
||||
lineTwo = "Ntrip: ";
|
||||
const uint8_t carrSoln = gpsData->flags.bits.carrSoln;
|
||||
if (carrSoln == 0)
|
||||
{
|
||||
lineOne.concat("None");
|
||||
}
|
||||
else if (carrSoln == 1)
|
||||
{
|
||||
lineOne.concat("Floating");
|
||||
}
|
||||
else if (carrSoln == 2)
|
||||
{
|
||||
lineOne.concat("Fixed");
|
||||
}
|
||||
else
|
||||
{
|
||||
lineOne = "UNKNOWN";
|
||||
}
|
||||
const NTRIPClientStates status = this->sensorData->getNtripState();
|
||||
if (status == NTRIPClientStates::pushingData)
|
||||
{
|
||||
lineTwo.concat("enabled");
|
||||
}
|
||||
else if (status == NTRIPClientStates::notAvailable)
|
||||
{
|
||||
lineTwo.concat(" N/A");
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo.concat("disabled");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
lineOne = "HAcc: ";
|
||||
lineTwo = "Sats: ";
|
||||
if (static_cast<bool>(fixType))
|
||||
{
|
||||
lineOne.concat(gpsData->hAcc);
|
||||
lineTwo.concat(gpsData->numSV);
|
||||
}
|
||||
else
|
||||
{
|
||||
lineOne.concat("-/-");
|
||||
lineTwo.concat("-/-");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @file menuSensorData.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a MenuInformationClass to print the SensorData
|
||||
* @version 0.1
|
||||
* @date 2023-09-04
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MENU_SENSOR_DATA_H
|
||||
#define MENU_SENSOR_DATA_H
|
||||
|
||||
#include "menuInformationSites.h"
|
||||
#include "sensorData.h"
|
||||
|
||||
/**
|
||||
* @brief A MenuInformationClass to print the SensorData
|
||||
*/
|
||||
class MenuSensorData : public MenuInformationSites
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new MenuSensorData object
|
||||
*
|
||||
* @param SensorData
|
||||
*/
|
||||
MenuSensorData(SensorData *SensorData);
|
||||
|
||||
private:
|
||||
void printPage() const override;
|
||||
|
||||
SensorData *sensorData;
|
||||
};
|
||||
|
||||
#endif // MENU_SENSOR_DATA_H
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @file menuSpeed.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-26
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "menuSpeed.h"
|
||||
|
||||
void MenuSpeed::action(int16_t *values, uint8_t length)
|
||||
{
|
||||
if (length != 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->speeds.x = values[0] / 10.0;
|
||||
this->speeds.rot = values[1] / 10.0;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @file menuSpeed.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a MenuIntInputWrapper to change speeds
|
||||
* @version 0.1
|
||||
* @date 2023-09-26
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MENU_SPEED_H
|
||||
#define MENU_SPEED_H
|
||||
|
||||
#include <menuIntInput.h>
|
||||
#include "moveControl.h"
|
||||
|
||||
/**
|
||||
* @brief A MenuIntInputWrapper class to change speeds
|
||||
*/
|
||||
class MenuSpeed : public MenuIntInputWrapper
|
||||
{
|
||||
public:
|
||||
MenuSpeed(DrivingSpeeds &speeds) : speeds(speeds){};
|
||||
|
||||
/**
|
||||
* @brief Changes the speeds
|
||||
*
|
||||
* @param values
|
||||
* @param length
|
||||
*/
|
||||
void action(int16_t *values, uint8_t length) override;
|
||||
|
||||
private:
|
||||
DrivingSpeeds &speeds;
|
||||
};
|
||||
|
||||
#endif // MENU_SPEED_H
|
||||
@@ -11,59 +11,66 @@
|
||||
|
||||
#include "menuSysteminformation.h"
|
||||
|
||||
MenuSysteminformation::MenuSysteminformation(Battery* mainBattery, Ps3Controller* gamepad)
|
||||
: MenuInformationSites(5) {
|
||||
this->mainBattery = mainBattery;
|
||||
this->gamepad = gamepad;
|
||||
MenuSysteminformation::MenuSysteminformation(Battery *mainBattery)
|
||||
: MenuInformationSites(8), mainBattery{mainBattery}
|
||||
{
|
||||
this->noEqualLeft = true;
|
||||
}
|
||||
|
||||
void MenuSysteminformation::printPage() const {
|
||||
void MenuSysteminformation::printPage() const
|
||||
{
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
switch (this->getCurrentPage()) {
|
||||
case 0:
|
||||
lineOne = "Free Heap:";
|
||||
lineTwo.concat(ESP.getFreeHeap());
|
||||
break;
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 0:
|
||||
lineOne = "Free Heap:";
|
||||
lineTwo.concat(ESP.getFreeHeap());
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lineOne = "Max alloc heap:";
|
||||
lineTwo.concat(ESP.getMaxAllocHeap());
|
||||
break;
|
||||
case 1:
|
||||
lineOne = "Max alloc Heap:";
|
||||
lineTwo.concat(ESP.getMaxAllocHeap());
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lineOne = "Uptime in secs:";
|
||||
lineTwo.concat((millis() / 1000));
|
||||
break;
|
||||
case 2:
|
||||
lineOne = "Uptime in secs:";
|
||||
lineTwo.concat((millis() / 1000));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
lineOne = "Main battery:";
|
||||
lineTwo = "";
|
||||
lineTwo.concat(this->mainBattery->getBatteryPercent());
|
||||
lineTwo.concat("% - V=");
|
||||
lineTwo.concat(this->mainBattery->getBatteryVoltage());
|
||||
break;
|
||||
case 3:
|
||||
lineOne = "Main battery:";
|
||||
lineTwo = "";
|
||||
lineTwo.concat(this->mainBattery->getBatteryPercent());
|
||||
lineTwo.concat("% - V=");
|
||||
lineTwo.concat(this->mainBattery->getBatteryVoltage());
|
||||
break;
|
||||
|
||||
case 4:
|
||||
lineOne = "PS3 battery";
|
||||
lineTwo = "is ";
|
||||
lineTwo.concat(MenuSysteminformation::ps3ToString(this->gamepad->data.status.battery));
|
||||
break;
|
||||
case 4:
|
||||
lineOne = "Current WiFi";
|
||||
lineTwo = "channel: ";
|
||||
lineTwo.concat(Network::getCurrentChannel());
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
case 5:
|
||||
lineOne = "Software verion:";
|
||||
lineTwo = VERSION;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
lineOne = "Build timestamp:";
|
||||
lineTwo = String(BUILD_TIMESTAMP).substring(0, 16);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
lineOne = "Kleiax Rover by";
|
||||
lineTwo = "Alexander Klein";
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
|
||||
String MenuSysteminformation::ps3ToString(uint8_t battery) {
|
||||
if( battery == ps3_status_battery_charging ) return "LOAD";
|
||||
else if( battery == ps3_status_battery_full ) return "FULL";
|
||||
else if( battery == ps3_status_battery_high ) return "HIGH";
|
||||
else if( battery == ps3_status_battery_low) return "LOW";
|
||||
else if( battery == ps3_status_battery_dying ) return "BAD";
|
||||
else if( battery == ps3_status_battery_shutdown ) return "OFF";
|
||||
else return "UNDEF";
|
||||
}
|
||||
|
||||
@@ -13,32 +13,33 @@
|
||||
#define MENU_SYSTEMINFORMATION_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <Ps3Controller.h>
|
||||
|
||||
#include "Version.h"
|
||||
|
||||
#include "controlPadInput.h"
|
||||
#include "menuInformationSites.h"
|
||||
#include "battery.h"
|
||||
#include "network.h"
|
||||
|
||||
/**
|
||||
* @brief Prints information about the current system status.
|
||||
*
|
||||
* The informations are about the batteries, memory and uptime.
|
||||
*/
|
||||
class MenuSysteminformation : public MenuInformationSites {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Systeminformation object
|
||||
*
|
||||
* @param mainBattery
|
||||
* @param gamepad
|
||||
*/
|
||||
MenuSysteminformation(Battery* mainBattery, Ps3Controller* gamepad);
|
||||
class MenuSysteminformation : public MenuInformationSites
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Systeminformation object
|
||||
*
|
||||
* @param mainBattery
|
||||
*/
|
||||
MenuSysteminformation(Battery *mainBattery);
|
||||
|
||||
private:
|
||||
void printPage() const override;
|
||||
static String ps3ToString(uint8_t battery);
|
||||
private:
|
||||
void printPage() const override;
|
||||
|
||||
Battery* mainBattery;
|
||||
Ps3Controller* gamepad;
|
||||
Battery *mainBattery;
|
||||
};
|
||||
|
||||
#endif // MENU_SYSTEMINFORMATION_H
|
||||
|
||||
@@ -11,73 +11,298 @@
|
||||
|
||||
#include "menuAutopilot.h"
|
||||
|
||||
void MenuAutopilot::printMenu() {
|
||||
if (this->firstPrint)
|
||||
this->init();
|
||||
void MenuAutopilot::printPage() const
|
||||
{
|
||||
const CourseCorrection correction = this->autopilot->getCourseCorrection();
|
||||
const UBX_NAV_PVT_data_t *gpsData = this->autopilot->getSensorData()->getGnssData();
|
||||
const bool navigationStarted = this->autopilot->getState() >= Autopilot::State::NavigationStarted;
|
||||
|
||||
char buf1[17];
|
||||
char buf2[17];
|
||||
char unit[3];
|
||||
|
||||
bool navigationStarted = this->autopilot->getNavigationStarted();
|
||||
bool navigationEnded = this->autopilot->getNavigationEnded();
|
||||
bool selfDriving = this->autopilot->getSelfDriving();
|
||||
bool selfDrivingAvailable = this->autopilot->getSelfDrivingAvailable();
|
||||
|
||||
// 999m -360°
|
||||
CourseCorrection correction = this->autopilot->getCourseCorrection();
|
||||
uint16_t distance = 0;
|
||||
|
||||
if (correction.distance < 1) {
|
||||
distance = (uint16_t) (correction.distance * 100);
|
||||
sprintf(unit, "cm");
|
||||
} else if (correction.distance < 1000) {
|
||||
distance = (uint16_t) correction.distance;
|
||||
sprintf(unit, "m");
|
||||
} else {
|
||||
distance = (uint16_t) (correction.distance / 1000);
|
||||
sprintf(unit, "km");
|
||||
String distanceString = "";
|
||||
if (navigationStarted)
|
||||
{
|
||||
uint16_t distance = 0;
|
||||
if (correction.distance < 1)
|
||||
{
|
||||
distance = static_cast<uint16_t>(correction.distance * 100);
|
||||
distanceString.concat(distance);
|
||||
distanceString.concat("cm");
|
||||
}
|
||||
else if (correction.distance < 1000)
|
||||
{
|
||||
distance = static_cast<uint16_t>(correction.distance);
|
||||
distanceString.concat(distance);
|
||||
distanceString.concat("m");
|
||||
}
|
||||
else
|
||||
{
|
||||
distance = static_cast<uint16_t>(correction.distance / 1000);
|
||||
distanceString.concat(distance);
|
||||
distanceString.concat("km");
|
||||
}
|
||||
}
|
||||
|
||||
if (navigationStarted) {
|
||||
sprintf(buf1 ,"Points %u/%u",this->routeInfo.currentPoint ,this->routeInfo.totalPoints);
|
||||
if (selfDriving) {
|
||||
sprintf(buf2, "Auto: %u%s %d", distance, unit, correction.correction);
|
||||
} else {
|
||||
if (selfDrivingAvailable) {
|
||||
sprintf(buf2, "Self -> Auto");
|
||||
} else {
|
||||
sprintf(buf2, "Self: %u%s %d", distance, unit, correction.correction);
|
||||
String lineOne = "No information";
|
||||
String lineTwo = "available";
|
||||
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
lineOne = "Status: ";
|
||||
lineTwo = "";
|
||||
switch (this->autopilot->getState())
|
||||
{
|
||||
case Autopilot::State::InsufficientAccuracy:
|
||||
lineTwo = "Err: LowAccuracy";
|
||||
break;
|
||||
|
||||
case Autopilot::State::NoRoute:
|
||||
lineTwo = "Err: No route";
|
||||
break;
|
||||
|
||||
case Autopilot::State::NavigationStarted:
|
||||
lineTwo = "Nav started";
|
||||
break;
|
||||
|
||||
case Autopilot::State::GetToStartPoint:
|
||||
lineTwo = "Drive to start";
|
||||
break;
|
||||
|
||||
case Autopilot::State::SelfDrivingAvailable:
|
||||
lineTwo = "Autopilot ready";
|
||||
break;
|
||||
|
||||
case Autopilot::State::SelfDriving:
|
||||
lineTwo = "Autopilot active";
|
||||
break;
|
||||
|
||||
case Autopilot::State::SelfDrivingRotate:
|
||||
lineTwo = "Rotating";
|
||||
break;
|
||||
|
||||
case Autopilot::State::TargetReached:
|
||||
lineTwo = "Target reached";
|
||||
break;
|
||||
|
||||
default:
|
||||
lineTwo = "UNKOWN - ";
|
||||
lineTwo.concat(static_cast<int>(this->autopilot->getState()));
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
if (!navigationStarted)
|
||||
{
|
||||
lineOne = "Navigation is";
|
||||
lineTwo = "not started";
|
||||
break;
|
||||
}
|
||||
lineOne = "Distance: ";
|
||||
lineOne.concat(distanceString);
|
||||
lineTwo = "Turn: ";
|
||||
lineTwo.concat(correction.correction);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lineOne = "Target waypoint";
|
||||
lineTwo = "";
|
||||
lineTwo.concat(this->autopilot->getRouteInfo().currentPoint);
|
||||
lineTwo.concat(" from ");
|
||||
lineTwo.concat(this->autopilot->getRouteInfo().totalPoints);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
{
|
||||
NTRIPClientStates status = this->autopilot->getSensorData()->getNtripClient()->getClientState();
|
||||
const uint8_t carrSoln = gpsData->flags.bits.carrSoln;
|
||||
lineOne = "GNSS: ";
|
||||
|
||||
if (status == NTRIPClientStates::pushingData)
|
||||
{
|
||||
if (carrSoln == 0)
|
||||
{
|
||||
lineOne.concat("None");
|
||||
}
|
||||
else if (carrSoln == 1)
|
||||
{
|
||||
lineOne.concat("Floating");
|
||||
}
|
||||
else if (carrSoln == 2)
|
||||
{
|
||||
lineOne.concat("Fixed");
|
||||
}
|
||||
else
|
||||
{
|
||||
lineOne.concat("UNKNOWN");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (navigationEnded) {
|
||||
sprintf(buf1, "Am Ziel");
|
||||
sprintf(buf2, "angekommen.");
|
||||
} else {
|
||||
sprintf(buf1, "Keine Route");
|
||||
sprintf(buf2, "vorhanden.");
|
||||
else if (status == NTRIPClientStates::notAvailable)
|
||||
lineOne.concat("No WiFi");
|
||||
else
|
||||
{
|
||||
lineOne.concat("Offline");
|
||||
}
|
||||
|
||||
lineTwo = "hAcc: ";
|
||||
if (static_cast<bool>(gpsData->fixType))
|
||||
{
|
||||
lineTwo.concat(gpsData->hAcc);
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo.concat("0");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
this->print(buf1, buf2);
|
||||
case 4:
|
||||
|
||||
if (this->autopilot->getSensorData()->getCalcAzimuth() == CalcAzimuth::State::Good || this->autopilot->getSensorData()->getCalcAzimuth() == CalcAzimuth::State::Super)
|
||||
{
|
||||
lineOne = "Calc Azi: ";
|
||||
lineTwo = "State: ";
|
||||
lineOne.concat(this->autopilot->getSensorData()->getCalcAzimuth());
|
||||
switch (this->autopilot->getSensorData()->getCalcAzimuthState())
|
||||
{
|
||||
case CalcAzimuth::State::Bad:
|
||||
lineTwo.concat("Bad");
|
||||
break;
|
||||
|
||||
case CalcAzimuth::State::Good:
|
||||
lineTwo.concat("Good");
|
||||
break;
|
||||
|
||||
case CalcAzimuth::State::Invalid:
|
||||
lineTwo.concat("Invalid");
|
||||
break;
|
||||
|
||||
case CalcAzimuth::State::Ok:
|
||||
lineTwo.concat("Ok");
|
||||
break;
|
||||
|
||||
case CalcAzimuth::State::Super:
|
||||
lineTwo.concat("Super");
|
||||
break;
|
||||
|
||||
default:
|
||||
lineTwo.concat("Unkown");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lineOne = "Real Azi: ";
|
||||
lineTwo = "";
|
||||
lineOne.concat(this->autopilot->getSensorData()->getRealAzimuth());
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
lineOne = "Loop mode is";
|
||||
if (this->autopilot->getLoopMode())
|
||||
{
|
||||
lineTwo = "enabled";
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo = "disabled";
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
lineOne = "Freeze target is";
|
||||
if (this->targetFreezed)
|
||||
{
|
||||
lineTwo = "activated";
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo = "deactivated";
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
lineOne = "MinDisToPoint:";
|
||||
lineTwo = "<- ";
|
||||
lineTwo.concat(this->minDistance);
|
||||
lineTwo.concat(" ->");
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
|
||||
void MenuAutopilot::update() {
|
||||
if (millis() - this->lastMillis < this->minDelay)
|
||||
return;
|
||||
this->lastMillis = millis();
|
||||
void MenuAutopilot::runCommand()
|
||||
{
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 5:
|
||||
this->autopilot->switchLoopMode();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
if (this->targetFreezed)
|
||||
{
|
||||
this->targetFreezed = false;
|
||||
this->autopilot->getNavigation()->freezeTargetPoint(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->targetFreezed = true;
|
||||
this->autopilot->getNavigation()->freezeTargetPoint();
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
this->minDistance = this->autopilot->getNavigation()->increaseMinDistanceToReachPoint();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MenuAutopilot::runCommandNo()
|
||||
{
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 7:
|
||||
this->minDistance = this->autopilot->getNavigation()->decreaseMinDistanceToReachPoint();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MenuAutopilot::update()
|
||||
{
|
||||
if (!this->autopilot->shouldUpdate())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->routeInfo = this->autopilot->getRouteInfo();
|
||||
this->printMenu();
|
||||
}
|
||||
|
||||
void MenuAutopilot::init() {
|
||||
this->firstPrint = false;
|
||||
this->driveManager->changeModus(Modi::Autopilot);
|
||||
this->autopilot = (Autopilot*) this->driveManager->getDriveModiPtr();
|
||||
void MenuAutopilot::init()
|
||||
{
|
||||
this->setCountPages(8);
|
||||
this->autopilot = new Autopilot();
|
||||
this->driveManager->changeModus(this->autopilot);
|
||||
this->routeInfo = this->autopilot->getRouteInfo();
|
||||
|
||||
// dirty hack to get the val, can be better!!! TODO
|
||||
this->autopilot->getNavigation()->increaseMinDistanceToReachPoint();
|
||||
this->minDistance = this->autopilot->getNavigation()->decreaseMinDistanceToReachPoint();
|
||||
|
||||
MenuDriveMode::init();
|
||||
}
|
||||
|
||||
@@ -13,44 +13,48 @@
|
||||
#define MENU_AUTOPILOT_DRIVE_H
|
||||
|
||||
#include "SpecialMenus/driveModi/menuDriveMode.h"
|
||||
#include "driveModi/Modi/Autopilot/autopilot.h"
|
||||
|
||||
/**
|
||||
* @brief A class to print informations about the Autopilot
|
||||
*
|
||||
*/
|
||||
class MenuAutopilot : public MenuDriveMode {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Autopilot object
|
||||
*
|
||||
* @param driveManager for MenuDriveMode
|
||||
*/
|
||||
MenuAutopilot(DriveManager* driveManager) : MenuDriveMode(driveManager) {}
|
||||
class MenuAutopilot : public MenuDriveMode
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Autopilot object
|
||||
*
|
||||
* @param driveManager for MenuDriveMode
|
||||
*/
|
||||
MenuAutopilot(DriveManager *driveManager) : MenuDriveMode(driveManager) {}
|
||||
|
||||
/**
|
||||
* @brief Prints the Information to display and console
|
||||
*
|
||||
* The informations are only printed to the display if it
|
||||
* set.
|
||||
*
|
||||
* Changes the DriveModi to Autopilot if it is the first time called
|
||||
* and save the Autopilot object.
|
||||
*/
|
||||
void printMenu();
|
||||
/**
|
||||
* @brief Prints the Information to display and console
|
||||
*
|
||||
* The informations are only printed to the display if it
|
||||
* set.
|
||||
*
|
||||
* Changes the DriveModi to Autopilot if it is the first time called
|
||||
* and save the Autopilot object.
|
||||
*/
|
||||
void printPage() const override;
|
||||
|
||||
/**
|
||||
* @brief can be called to update shown data
|
||||
*/
|
||||
void update();
|
||||
/**
|
||||
* @brief can be called to update shown data
|
||||
*/
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
private:
|
||||
void init() override;
|
||||
void runCommand() override;
|
||||
void runCommandNo() override;
|
||||
|
||||
Autopilot* autopilot;
|
||||
RouteInfo routeInfo;
|
||||
bool mutable targetFreezed = false;
|
||||
double mutable minDistance;
|
||||
|
||||
uint32_t lastMillis = 0;
|
||||
uint16_t minDelay = 1500;
|
||||
Autopilot *autopilot;
|
||||
RouteInfo routeInfo;
|
||||
};
|
||||
|
||||
#endif // MENU_AUTOPILOT_DRIVE_H
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
/**
|
||||
* @file menuCalibrateCompass.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains an implementation of the class MenuManualDrive
|
||||
* @version 0.1
|
||||
* @date 2022-01-20
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
#include "menuCalibrateCompass.h"
|
||||
|
||||
MenuCalibrateCompass::MenuCalibrateCompass(DriveManager *driveManager) : MenuDriveMode(driveManager) {}
|
||||
|
||||
MenuCalibrateCompass::~MenuCalibrateCompass()
|
||||
{
|
||||
delete this->caliCompass;
|
||||
this->caliCompassMode->setCalibrateCompass();
|
||||
}
|
||||
|
||||
void MenuCalibrateCompass::printPage() const
|
||||
{
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 0:
|
||||
lineOne = "-Ready to drive-";
|
||||
lineTwo = "Compass Mode";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lineOne = "Azimuth:";
|
||||
lineTwo.concat(this->caliCompassMode->getSensorData()->getRealAzimuth());
|
||||
break;
|
||||
|
||||
case 2:
|
||||
switch (this->caliCompass->getState())
|
||||
{
|
||||
case CalibrateCompass::State::Ready:
|
||||
lineOne = "Start compass";
|
||||
lineTwo = "calibration";
|
||||
break;
|
||||
|
||||
case CalibrateCompass::State::Calibrating:
|
||||
lineOne = "Calibrating...";
|
||||
lineTwo = "Move around";
|
||||
break;
|
||||
|
||||
case CalibrateCompass::State::Finished:
|
||||
lineOne = "Calibration";
|
||||
lineTwo = "finished";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
lineOne = "Save compass";
|
||||
lineTwo = "data in flash";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
lineOne = "Load data";
|
||||
lineTwo = "from flash";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
lineOne = "Remove";
|
||||
lineTwo = "calibration data";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
lineOne = "Use current";
|
||||
lineTwo = "calibration data";
|
||||
break;
|
||||
|
||||
case 7:
|
||||
lineOne = "Reset for new";
|
||||
lineTwo = "calibration run";
|
||||
break;
|
||||
|
||||
case 8:
|
||||
lineOne = "X min: ";
|
||||
lineOne.concat(this->caliCompass->getCalibrationData().data[0][0]);
|
||||
lineTwo = "X max: ";
|
||||
lineTwo.concat(this->caliCompass->getCalibrationData().data[0][1]);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
lineOne = "Y min: ";
|
||||
lineOne.concat(this->caliCompass->getCalibrationData().data[1][0]);
|
||||
lineTwo = "Y max: ";
|
||||
lineTwo.concat(this->caliCompass->getCalibrationData().data[1][1]);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
lineOne = "Z min: ";
|
||||
lineOne.concat(this->caliCompass->getCalibrationData().data[2][0]);
|
||||
lineTwo = "Z max: ";
|
||||
lineTwo.concat(this->caliCompass->getCalibrationData().data[2][1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
|
||||
void MenuCalibrateCompass::init()
|
||||
{
|
||||
this->firstPrint = false;
|
||||
this->caliCompassMode = new CalibrateCompassM();
|
||||
this->driveManager->changeModus(this->caliCompassMode);
|
||||
this->caliCompass = new CalibrateCompass(this->caliCompassMode->getSensorData()->getRealCompass());
|
||||
this->setCountPages(11);
|
||||
MenuDriveMode::updateDelay = MenuCalibrateCompass::updateDelay;
|
||||
}
|
||||
|
||||
void MenuCalibrateCompass::runCommand()
|
||||
{
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 2:
|
||||
switch (this->caliCompass->getState())
|
||||
{
|
||||
case CalibrateCompass::State::Ready:
|
||||
this->caliCompassMode->setCalibrateCompass(this->caliCompass);
|
||||
this->caliCompass->start();
|
||||
break;
|
||||
|
||||
case CalibrateCompass::State::Finished:
|
||||
this->caliCompassMode->setCalibrateCompass();
|
||||
this->caliCompass->useData();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
this->caliCompass->saveData();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
this->caliCompass->loadData();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
this->caliCompass->removeCalibration();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
this->caliCompass->useData();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
this->caliCompass->reset();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* @file menuCalibrateCompass.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a class to print information about the class ManualControl
|
||||
* @version 0.1
|
||||
* @date 2022-01-20
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MENU_CALIBRATE_COMPASS_H
|
||||
#define MENU_CALIBRATE_COMPASS_H
|
||||
|
||||
#include "SpecialMenus/driveModi/menuDriveMode.h"
|
||||
#include "driveModi/Modi/CalibrateCompass/calibrateCompassM.h"
|
||||
#include "calibrateCompass.h"
|
||||
|
||||
/**
|
||||
* @brief A class to print informations about the class ManualControl
|
||||
*
|
||||
*/
|
||||
class MenuCalibrateCompass : public MenuDriveMode
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Manual Control object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuCalibrateCompass(DriveManager *driveManager);
|
||||
~MenuCalibrateCompass();
|
||||
|
||||
/**
|
||||
* @brief Prints the Information to display and console
|
||||
*
|
||||
* The informations are only printed to the display if it
|
||||
* set.
|
||||
*
|
||||
* Changes the DriveModi to Autopilot if it is the first time called.
|
||||
*/
|
||||
void printPage() const override;
|
||||
|
||||
private:
|
||||
void init() override;
|
||||
void runCommand() override;
|
||||
|
||||
CalibrateCompassM *caliCompassMode = nullptr;
|
||||
CalibrateCompass *caliCompass = nullptr;
|
||||
|
||||
static constexpr uint16_t updateDelay = 500;
|
||||
};
|
||||
|
||||
#endif // MENU_CALIBRATE_COMPASS_H
|
||||
@@ -10,29 +10,165 @@
|
||||
*/
|
||||
#include "menuCaptureRoute.h"
|
||||
|
||||
void MenuCaptureRoute::printMenu() {
|
||||
if (this->firstPrint)
|
||||
this->init();
|
||||
void MenuCaptureRoute::printPage() const
|
||||
{
|
||||
const RouteInfo routeInfo = this->captureRoute->getRouteInfo();
|
||||
const UBX_NAV_PVT_data_t *gpsData = this->captureRoute->getSensorData()->getGnssData();
|
||||
|
||||
this->routeInfo = this->captureRoute->getRouteInfo();
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
String lineOne = "Points: ";
|
||||
String lineTwo = "You can drive.";
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 0:
|
||||
lineOne = "Capture Route";
|
||||
lineTwo = "You can drive";
|
||||
break;
|
||||
|
||||
lineOne.concat(this->routeInfo.totalPoints);
|
||||
case 1:
|
||||
lineOne = "Saved waypoints";
|
||||
lineTwo.concat(routeInfo.totalPoints);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lineOne = "Last status:";
|
||||
switch (this->captureRoute->getLastStatus())
|
||||
{
|
||||
case Navigation::Status::InsufficientAccuracy:
|
||||
lineTwo = "Poor Accuracy";
|
||||
break;
|
||||
|
||||
case Navigation::Status::Updated:
|
||||
lineTwo = "Point added";
|
||||
break;
|
||||
|
||||
case Navigation::Status::Unchanged:
|
||||
lineTwo = "Point too close";
|
||||
break;
|
||||
|
||||
default:
|
||||
lineTwo = "---";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
lineOne = "Distance to last";
|
||||
lineTwo = "point: ";
|
||||
lineTwo.concat(this->captureRoute->getDistanceToLastPoint());
|
||||
break;
|
||||
|
||||
case 4:
|
||||
{
|
||||
NTRIPClientStates status = this->captureRoute->getSensorData()->getNtripClient()->getClientState();
|
||||
lineOne = "NTRIP Client is";
|
||||
|
||||
if (status == NTRIPClientStates::pushingData)
|
||||
{
|
||||
lineTwo = "enabled";
|
||||
}
|
||||
else if (status == NTRIPClientStates::notAvailable)
|
||||
{
|
||||
lineTwo = "not available";
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo = "disabled";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 5:
|
||||
{
|
||||
lineOne = "Carrier Solution";
|
||||
uint8_t carrSoln = gpsData->flags.bits.carrSoln;
|
||||
if (carrSoln == 0)
|
||||
{
|
||||
lineTwo = "None";
|
||||
}
|
||||
else if (carrSoln == 1)
|
||||
{
|
||||
lineTwo = "Floating";
|
||||
}
|
||||
else if (carrSoln == 2)
|
||||
{
|
||||
lineTwo = "Fixed";
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo = "UNKNOWN";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 6:
|
||||
lineOne = "hAccuracy: ";
|
||||
lineTwo = "Azimuth: ";
|
||||
lineTwo.concat(this->captureRoute->getSensorData()->getRealAzimuth());
|
||||
if (gpsData->fixType)
|
||||
{
|
||||
lineOne.concat(gpsData->hAcc);
|
||||
}
|
||||
else
|
||||
{
|
||||
lineOne.concat("0");
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
lineOne = "Current minimal";
|
||||
if (this->captureRoute->getNavigation()->getMinAccuracy() >= Point::Accuracy::twoDigOfCM)
|
||||
{
|
||||
lineTwo = "accuracy is high";
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo = "accuracy is low";
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
|
||||
void MenuCaptureRoute::update() {
|
||||
void MenuCaptureRoute::update()
|
||||
{
|
||||
if (!this->captureRoute->shouldUpdate())
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->printMenu();
|
||||
}
|
||||
|
||||
void MenuCaptureRoute::init() {
|
||||
this->firstPrint = false;
|
||||
this->driveManager->changeModus(Modi::CaptureRoute);
|
||||
this->captureRoute = (CaptureRoute*) this->driveManager->getDriveModiPtr();
|
||||
void MenuCaptureRoute::runCommand()
|
||||
{
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 7:
|
||||
if (this->captureRoute->getNavigation()->getMinAccuracy() >= Point::Accuracy::twoDigOfCM)
|
||||
{
|
||||
this->captureRoute->getNavigation()->setMinAccuracy(Point::Accuracy::none);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->captureRoute->getNavigation()->setMinAccuracy(Point::Accuracy::twoDigOfCM);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MenuCaptureRoute::init()
|
||||
{
|
||||
this->setCountPages(8);
|
||||
MenuDriveMode::updateDelay = MenuCaptureRoute::updateDelay;
|
||||
this->captureRoute = new CaptureRoute();
|
||||
this->driveManager->changeModus(this->captureRoute);
|
||||
MenuDriveMode::init();
|
||||
}
|
||||
|
||||
@@ -12,41 +12,45 @@
|
||||
#define MENU_MANUAL_DRIVE_H
|
||||
|
||||
#include "SpecialMenus/driveModi/menuDriveMode.h"
|
||||
#include "driveModi/Modi/CaptureRoute/captureRoute.h"
|
||||
|
||||
/**
|
||||
* @brief A class to print informations about the Autopilot
|
||||
*
|
||||
*/
|
||||
class MenuCaptureRoute : public MenuDriveMode {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Capture Route object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuCaptureRoute(DriveManager* driveManager) : MenuDriveMode(driveManager) {}
|
||||
class MenuCaptureRoute : public MenuDriveMode
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Capture Route object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuCaptureRoute(DriveManager *driveManager) : MenuDriveMode(driveManager) {}
|
||||
|
||||
/**
|
||||
* @brief Prints the Information to display and console
|
||||
*
|
||||
* The informations are only printed to the display if it
|
||||
* set.
|
||||
*
|
||||
* Changes the DriveModi to CaptureRoute if it is the first time called
|
||||
* and save the CaptureRoute object.
|
||||
*/
|
||||
void printMenu();
|
||||
/**
|
||||
* @brief Prints the Information to display and console
|
||||
*
|
||||
* The informations are only printed to the display if it
|
||||
* set.
|
||||
*
|
||||
* Changes the DriveModi to CaptureRoute if it is the first time called
|
||||
* and save the CaptureRoute object.
|
||||
*/
|
||||
void printPage() const override;
|
||||
|
||||
/**
|
||||
* @brief can be called to update shown data
|
||||
*/
|
||||
void update();
|
||||
/**
|
||||
* @brief can be called to update shown data
|
||||
*/
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
private:
|
||||
void runCommand() override;
|
||||
void init() override;
|
||||
|
||||
CaptureRoute* captureRoute;
|
||||
RouteInfo routeInfo;
|
||||
CaptureRoute *captureRoute = nullptr;
|
||||
|
||||
static constexpr uint16_t updateDelay = 500;
|
||||
};
|
||||
|
||||
#endif // MENU_MANUAL_DRIVE_H
|
||||
|
||||
@@ -10,14 +10,78 @@
|
||||
*/
|
||||
#include "menuManualDrive.h"
|
||||
|
||||
void MenuManualControl::printMenu() {
|
||||
if (this->firstPrint)
|
||||
this->init();
|
||||
|
||||
this->print("Now you can", "drive. :)");
|
||||
MenuManualControl::MenuManualControl(DriveManager *driveManager) : MenuDriveMode(driveManager)
|
||||
{
|
||||
this->noEqualLeft = true;
|
||||
}
|
||||
|
||||
void MenuManualControl::init() {
|
||||
void MenuManualControl::printPage() const
|
||||
{
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 0:
|
||||
lineOne = "-Ready to drive-";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lineOne = "Input mode:";
|
||||
if (this->manualControl->getInputMode() == ManualControl::InputMode::Analog)
|
||||
{
|
||||
lineTwo = "Analog";
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo = "Digital";
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lineOne = "Speed Menu";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
lineOne = "Sensor Menu";
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
|
||||
void MenuManualControl::init()
|
||||
{
|
||||
this->firstPrint = false;
|
||||
this->driveManager->changeModus(Modi::ManualControl);
|
||||
this->manualControl = new ManualControl();
|
||||
this->driveManager->changeModus(this->manualControl);
|
||||
this->setCountPages(4);
|
||||
MenuDriveMode::updateDelay = MenuManualControl::updateDelay;
|
||||
this->activateSpeedMenu();
|
||||
MenuDriveMode::init();
|
||||
}
|
||||
|
||||
void MenuManualControl::runCommand()
|
||||
{
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 1:
|
||||
this->manualControl->switchInputMode();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this->enterSpeedMenu();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
this->enterSensorMenu();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,32 +13,40 @@
|
||||
#define MENU_MANUAL_DRIVE_H
|
||||
|
||||
#include "SpecialMenus/driveModi/menuDriveMode.h"
|
||||
#include "driveModi/Modi/ManualControl/manualControl.h"
|
||||
|
||||
/**
|
||||
* @brief A class to print informations about the class ManualControl
|
||||
*
|
||||
*/
|
||||
class MenuManualControl : public MenuDriveMode {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Manual Control object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuManualControl(DriveManager* driveManager) : MenuDriveMode(driveManager) {}
|
||||
class MenuManualControl : public MenuDriveMode
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Manual Control object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuManualControl(DriveManager *driveManager);
|
||||
|
||||
/**
|
||||
* @brief Prints the Information to display and console
|
||||
*
|
||||
* The informations are only printed to the display if it
|
||||
* set.
|
||||
*
|
||||
* Changes the DriveModi to Autopilot if it is the first time called.
|
||||
*/
|
||||
void printMenu();
|
||||
/**
|
||||
* @brief Prints the Information to display and console
|
||||
*
|
||||
* The informations are only printed to the display if it
|
||||
* set.
|
||||
*
|
||||
* Changes the DriveModi to Autopilot if it is the first time called.
|
||||
*/
|
||||
void printPage() const override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
private:
|
||||
void init() override;
|
||||
void runCommand() override;
|
||||
|
||||
ManualControl *manualControl = nullptr;
|
||||
CalibrateCompass *caliCompass = nullptr;
|
||||
|
||||
static constexpr uint16_t updateDelay = 500;
|
||||
};
|
||||
|
||||
#endif // MENU_MANUAL_DRIVE_H
|
||||
|
||||
@@ -10,19 +10,23 @@
|
||||
*/
|
||||
#include "menuTestMode.h"
|
||||
|
||||
MenuTestMode::MenuTestMode(DriveManager* driveManager)
|
||||
: MenuDriveMode(driveManager) {
|
||||
MenuTestMode::MenuTestMode(DriveManager *driveManager)
|
||||
: driveManager{driveManager}
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MenuTestMode::~MenuTestMode() {
|
||||
if (isInit) {
|
||||
MenuTestMode::~MenuTestMode()
|
||||
{
|
||||
if (isInit)
|
||||
{
|
||||
delete this->mainMenu;
|
||||
}
|
||||
}
|
||||
|
||||
void MenuTestMode::printMenu() {
|
||||
if (!this->isInit) {
|
||||
void MenuTestMode::printMenu()
|
||||
{
|
||||
if (!this->isInit)
|
||||
{
|
||||
this->isInit = true;
|
||||
this->init();
|
||||
}
|
||||
@@ -30,78 +34,98 @@ void MenuTestMode::printMenu() {
|
||||
this->mainMenu->printMenu();
|
||||
}
|
||||
|
||||
void MenuTestMode::down() {
|
||||
void MenuTestMode::down()
|
||||
{
|
||||
if (this->checkInput())
|
||||
{
|
||||
this->mainMenu->down();
|
||||
}
|
||||
}
|
||||
|
||||
void MenuTestMode::up() {
|
||||
void MenuTestMode::up()
|
||||
{
|
||||
if (this->checkInput())
|
||||
{
|
||||
this->mainMenu->up();
|
||||
}
|
||||
}
|
||||
|
||||
void MenuTestMode::right() {
|
||||
void MenuTestMode::right()
|
||||
{
|
||||
if (this->checkInput())
|
||||
{
|
||||
this->mainMenu->right();
|
||||
}
|
||||
}
|
||||
|
||||
void MenuTestMode::left() {
|
||||
void MenuTestMode::left()
|
||||
{
|
||||
if (this->mainMenu->isInSubmenu())
|
||||
if (this->checkInput())
|
||||
{
|
||||
this->mainMenu->left();
|
||||
else {
|
||||
}
|
||||
else
|
||||
{
|
||||
this->testMode->abortManeuver();
|
||||
this->mainMenu->left();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->parentMenu->printMenu();
|
||||
}
|
||||
}
|
||||
|
||||
void MenuTestMode::yes() {
|
||||
void MenuTestMode::yes()
|
||||
{
|
||||
if (this->checkInput())
|
||||
{
|
||||
this->mainMenu->yes();
|
||||
}
|
||||
}
|
||||
|
||||
void MenuTestMode::no() {
|
||||
void MenuTestMode::no()
|
||||
{
|
||||
if (this->mainMenu->isInSubmenu())
|
||||
{
|
||||
if (this->checkInput())
|
||||
this->mainMenu->no();
|
||||
else {
|
||||
else
|
||||
{
|
||||
this->testMode->abortManeuver();
|
||||
this->mainMenu->no();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->left();
|
||||
}
|
||||
}
|
||||
|
||||
void MenuTestMode::init() {
|
||||
this->driveManager->changeModus(Modi::TestMode);
|
||||
this->testMode = (TestMode*) this->driveManager->getDriveModiPtr();
|
||||
void MenuTestMode::init()
|
||||
{
|
||||
this->testMode = new TestMode();
|
||||
this->driveManager->changeModus(this->testMode);
|
||||
|
||||
testMode->setSpeed(15);
|
||||
testMode->setRotationSpeed(100);
|
||||
|
||||
|
||||
auto dummy = []() {
|
||||
std::cout << "Dummy in Action" <<std::endl;
|
||||
auto dummy = []()
|
||||
{
|
||||
std::cout << "Dummy in Action" << std::endl;
|
||||
};
|
||||
|
||||
// Create menu
|
||||
this->mainMenu = new Menu;
|
||||
Menu* engineMenu = new Menu;
|
||||
Menu* lightMenu = new Menu;
|
||||
Menu* encoderMenu = new Menu;
|
||||
auto *engineMenu = new Menu;
|
||||
auto *lightMenu = new Menu;
|
||||
auto *encoderMenu = new Menu;
|
||||
// Sound
|
||||
// Ping google
|
||||
// WheelEncoder
|
||||
|
||||
MenuIntInput* drivingMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::drive));
|
||||
MenuIntInput* engineLeftMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::leftEngine));
|
||||
MenuIntInput* engineRightMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::rightEngine));
|
||||
MenuIntInput* engineBothMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::bothEngine));
|
||||
SpeedometerTest* encoderLeftMenu = new SpeedometerTest(this->testMode->getSpeedometerLeft());
|
||||
SpeedometerTest* encoderRightMenu = new SpeedometerTest(this->testMode->getSpeedometerRight());
|
||||
|
||||
auto *drivingMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::drive));
|
||||
auto *engineLeftMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::leftEngine));
|
||||
auto *engineRightMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::rightEngine));
|
||||
auto *engineBothMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::bothEngine));
|
||||
auto *encoderLeftMenu = new SpeedometerTest(this->testMode->getSpeedometerLeft());
|
||||
auto *encoderRightMenu = new SpeedometerTest(this->testMode->getSpeedometerRight());
|
||||
|
||||
// Set menus on LCD
|
||||
this->mainMenu->setLcd(this->lcd);
|
||||
@@ -116,49 +140,53 @@ void MenuTestMode::init() {
|
||||
encoderRightMenu->setLcd(this->lcd);
|
||||
|
||||
// Other menu config
|
||||
static constexpr uint8_t percentMax = 100;
|
||||
static constexpr uint16_t degreeMax = 360;
|
||||
static constexpr uint8_t secondsMax = 120;
|
||||
static constexpr uint8_t steps = 5;
|
||||
|
||||
drivingMenu->setEntry(0, "Centimeter", 100);
|
||||
drivingMenu->setMinMaxSteps(0, -1000, 1000, 25);
|
||||
drivingMenu->setMinMaxSteps(0, -1000, 1000, steps * 5);
|
||||
drivingMenu->setEntry(1, "Degree");
|
||||
drivingMenu->setMinMaxSteps(1, -360, 360, 15);
|
||||
drivingMenu->setMinMaxSteps(1, -degreeMax, degreeMax, steps * 3);
|
||||
drivingMenu->setPrintParentMenu(false);
|
||||
engineLeftMenu->setEntry(0, "Percentage");
|
||||
engineLeftMenu->setMinMaxSteps(0, -100, 100, 5);
|
||||
engineLeftMenu->setEntry(1, "Seconds", 5);
|
||||
engineLeftMenu->setMinMaxSteps(1, 0, 120, 1);
|
||||
engineLeftMenu->setMinMaxSteps(0, -percentMax, percentMax, steps);
|
||||
engineLeftMenu->setEntry(1, "Seconds", steps);
|
||||
engineLeftMenu->setMinMaxSteps(1, 0, secondsMax, 1);
|
||||
engineLeftMenu->setPrintParentMenu(false);
|
||||
engineRightMenu->setEntry(0, "Percentage");
|
||||
engineRightMenu->setMinMaxSteps(0, -100, 100, 5);
|
||||
engineRightMenu->setEntry(1, "Seconds", 5);
|
||||
engineRightMenu->setMinMaxSteps(1, 0, 120, 1);
|
||||
engineRightMenu->setMinMaxSteps(0, -percentMax, percentMax, steps);
|
||||
engineRightMenu->setEntry(1, "Seconds", steps);
|
||||
engineRightMenu->setMinMaxSteps(1, 0, secondsMax, 1);
|
||||
engineRightMenu->setPrintParentMenu(false);
|
||||
engineBothMenu->setEntry(0, "Percentage");
|
||||
engineBothMenu->setMinMaxSteps(0, -100, 100, 5);
|
||||
engineBothMenu->setEntry(1, "Seconds", 5);
|
||||
engineBothMenu->setMinMaxSteps(1, 0, 120, 1);
|
||||
engineBothMenu->setMinMaxSteps(0, -percentMax, percentMax, steps);
|
||||
engineBothMenu->setEntry(1, "Seconds", steps);
|
||||
engineBothMenu->setMinMaxSteps(1, 0, secondsMax, 1);
|
||||
engineBothMenu->setPrintParentMenu(false);
|
||||
|
||||
|
||||
// Entrys for the menus
|
||||
MenuAction* engineAction = new MenuAction("Engine", engineMenu);
|
||||
MenuAction* engineLeftAction = new MenuAction("Left", engineLeftMenu);
|
||||
MenuAction* engineRightAction = new MenuAction("Right", engineRightMenu);
|
||||
MenuAction* engineBothAction = new MenuAction("Both", engineBothMenu);
|
||||
auto *engineAction = new MenuAction("Engine", engineMenu);
|
||||
auto *engineLeftAction = new MenuAction("Left", engineLeftMenu);
|
||||
auto *engineRightAction = new MenuAction("Right", engineRightMenu);
|
||||
auto *engineBothAction = new MenuAction("Both", engineBothMenu);
|
||||
|
||||
MenuAction* drivingAction = new MenuAction("Driving", drivingMenu);
|
||||
auto *drivingAction = new MenuAction("Driving", drivingMenu);
|
||||
|
||||
MenuAction* encoderAction = new MenuAction("Encoder", encoderMenu);
|
||||
MenuAction* encoderLeftAction = new MenuAction("Left", encoderLeftMenu);
|
||||
MenuAction* encoderRightAction = new MenuAction("Right", encoderRightMenu);
|
||||
auto *encoderAction = new MenuAction("Encoder", encoderMenu);
|
||||
auto *encoderLeftAction = new MenuAction("Left", encoderLeftMenu);
|
||||
auto *encoderRightAction = new MenuAction("Right", encoderRightMenu);
|
||||
|
||||
MenuAction* lightAction = new MenuAction("Light", lightMenu);
|
||||
MenuAction* lightFlashAction = new MenuAction("Flash", dummy);
|
||||
MenuAction* lightFadeAction = new MenuAction("Fade", dummy);
|
||||
MenuAction* lightRedAction = new MenuAction("Red", dummy);
|
||||
MenuAction* lightGreenAction = new MenuAction("Green", dummy);
|
||||
MenuAction* lightBlueAction = new MenuAction("Blue", dummy);
|
||||
MenuAction* lightOffAction = new MenuAction("Off", dummy);
|
||||
auto *lightAction = new MenuAction("Light", lightMenu);
|
||||
auto *lightFlashAction = new MenuAction("Flash", dummy);
|
||||
auto *lightFadeAction = new MenuAction("Fade", dummy);
|
||||
auto *lightRedAction = new MenuAction("Red", dummy);
|
||||
auto *lightGreenAction = new MenuAction("Green", dummy);
|
||||
auto *lightBlueAction = new MenuAction("Blue", dummy);
|
||||
auto *lightOffAction = new MenuAction("Off", dummy);
|
||||
|
||||
// Add entrys to the menus
|
||||
// Add entries to the menus
|
||||
this->mainMenu->addEntry(engineAction);
|
||||
this->mainMenu->addEntry(drivingAction);
|
||||
this->mainMenu->addEntry(encoderAction);
|
||||
@@ -179,65 +207,85 @@ void MenuTestMode::init() {
|
||||
lightMenu->addEntry(lightOffAction);
|
||||
}
|
||||
|
||||
void MenuTestMode::update() {
|
||||
void MenuTestMode::update()
|
||||
{
|
||||
if (this->maneuverInAction)
|
||||
if (millis() - this->lastUpdateTime > updateDelay) {
|
||||
{
|
||||
if (millis() - this->lastUpdateTime > updateDelay)
|
||||
{
|
||||
this->printManeuverTime();
|
||||
this->lastUpdateTime = millis();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool MenuTestMode::checkInput() {
|
||||
if (this->testMode->getBusy()) {
|
||||
bool MenuTestMode::checkInput()
|
||||
{
|
||||
if (this->testMode->getBusy())
|
||||
{
|
||||
this->printManeuverTime();
|
||||
this->maneuverInAction = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this->maneuverInAction)
|
||||
{
|
||||
this->maneuverInAction = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MenuTestMode::printManeuverTime() {
|
||||
void MenuTestMode::printManeuverTime()
|
||||
{
|
||||
uint8_t maneuverTime = this->testMode->getRemainingManeuverTime();
|
||||
if (maneuverTime) {
|
||||
if (maneuverTime)
|
||||
{
|
||||
String lineTwo = "";
|
||||
lineTwo.concat(maneuverTime);
|
||||
lineTwo.concat(" secs");
|
||||
this->print("Maneuver time:", lineTwo);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
this->maneuverInAction = false;
|
||||
this->printMenu();
|
||||
}
|
||||
}
|
||||
|
||||
MenuTestModeWrapper::MenuTestModeWrapper(MenuTestMode* menu, TestModeFunctionSingle testModeFunction) {
|
||||
this->menu = menu;
|
||||
this->testMode = this->menu->getTestMode();
|
||||
this->testModeFunctionSingle = testModeFunction;
|
||||
MenuTestModeWrapper::MenuTestModeWrapper(MenuTestMode *menu, TestModeFunctionSingle testModeFunction)
|
||||
: menu{menu},
|
||||
testModeFunctionSingle{testModeFunction},
|
||||
testMode{menu->getTestMode()}
|
||||
{
|
||||
}
|
||||
|
||||
MenuTestModeWrapper::MenuTestModeWrapper(MenuTestMode* menu, TestModeFunctionDouble testModeFunction) {
|
||||
this->menu = menu;
|
||||
this->testMode = this->menu->getTestMode();
|
||||
this->testModeFunctionDouble = testModeFunction;
|
||||
MenuTestModeWrapper::MenuTestModeWrapper(MenuTestMode *menu, TestModeFunctionDouble testModeFunction)
|
||||
: menu{menu},
|
||||
testModeFunctionDouble{testModeFunction},
|
||||
testMode{menu->getTestMode()}
|
||||
{
|
||||
}
|
||||
|
||||
void MenuTestModeWrapper::action(int16_t* values, uint8_t length) {
|
||||
void MenuTestModeWrapper::action(int16_t *values, uint8_t length)
|
||||
{
|
||||
// This function calls a member function with a pointer
|
||||
// Very helpful site:
|
||||
// https://isocpp.org/wiki/faq/pointers-to-members#fnptr-vs-memfnptr-types
|
||||
|
||||
bool res = false;
|
||||
|
||||
if (length == 2 && this->testModeFunctionDouble)
|
||||
if (length == 2 && static_cast<bool>(this->testModeFunctionDouble))
|
||||
{
|
||||
res = (this->testMode->*this->testModeFunctionDouble)(values[0], values[1]);
|
||||
else if (length == 1 && this->testModeFunctionSingle)
|
||||
}
|
||||
else if (length == 1 && static_cast<bool>(this->testModeFunctionSingle))
|
||||
{
|
||||
res = (this->testMode->*this->testModeFunctionSingle)(values[0]);
|
||||
}
|
||||
|
||||
if (res) {
|
||||
if (res)
|
||||
{
|
||||
this->menu->printManeuverTime();
|
||||
this->menu->maneuverStarted();
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
#ifndef MENU_TEST_MODE
|
||||
#define MENU_TEST_MODE
|
||||
#ifndef MENU_TEST_MODE_H
|
||||
#define MENU_TEST_MODE_H
|
||||
|
||||
#include "SpecialMenus/driveModi/menuDriveMode.h"
|
||||
#include "driveModi/Modi/TestMode/testMode.h"
|
||||
@@ -22,77 +22,80 @@
|
||||
* @brief Interact with the TestMode
|
||||
*
|
||||
*/
|
||||
class MenuTestMode : public MenuDriveMode {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Test Mode object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuTestMode(DriveManager *driveManager);
|
||||
~MenuTestMode();
|
||||
class MenuTestMode : public MenuControl
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Test Mode object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuTestMode(DriveManager *driveManager);
|
||||
~MenuTestMode();
|
||||
|
||||
/**
|
||||
* @brief Prints the last informations
|
||||
*
|
||||
* On first call this function calls the init function.
|
||||
* On every call this functions call the printMenu function from
|
||||
* the mainMenu of this class.
|
||||
*/
|
||||
void printMenu() override;
|
||||
/**
|
||||
* @brief Prints the last informations
|
||||
*
|
||||
* On first call this function calls the init function.
|
||||
* On every call this functions call the printMenu function from
|
||||
* the mainMenu of this class.
|
||||
*/
|
||||
void printMenu() override;
|
||||
|
||||
/**
|
||||
* @brief Prints maneuver Timer
|
||||
*
|
||||
* Aside from that the function looks if the maneuver is done and
|
||||
* give the user input free.
|
||||
*/
|
||||
void printManeuverTime();
|
||||
/**
|
||||
* @brief Prints maneuver Timer
|
||||
*
|
||||
* Aside from that the function looks if the maneuver is done and
|
||||
* give the user input free.
|
||||
*/
|
||||
void printManeuverTime();
|
||||
|
||||
void down() override;
|
||||
void up() override;
|
||||
void right() override;
|
||||
void left() override;
|
||||
void yes() override;
|
||||
void no() override;
|
||||
void down() override;
|
||||
void up() override;
|
||||
void right() override;
|
||||
void left() override;
|
||||
void yes() override;
|
||||
void no() override;
|
||||
|
||||
/**
|
||||
* @brief Calls the printManeuverTime function if a maneuver is in process.
|
||||
*
|
||||
*/
|
||||
void update() override;
|
||||
/**
|
||||
* @brief Calls the printManeuverTime function if a maneuver is in process.
|
||||
*
|
||||
*/
|
||||
void update() override;
|
||||
|
||||
TestMode* getTestMode() const { return this->testMode; }
|
||||
void maneuverStarted() { this->maneuverInAction = true; }
|
||||
TestMode *getTestMode() const { return this->testMode; }
|
||||
void maneuverStarted() { this->maneuverInAction = true; }
|
||||
|
||||
private:
|
||||
void init();
|
||||
bool checkInput();
|
||||
private:
|
||||
void init();
|
||||
bool checkInput();
|
||||
|
||||
TestMode* testMode;
|
||||
Menu* mainMenu;
|
||||
DriveManager *driveManager;
|
||||
TestMode *testMode = nullptr;
|
||||
Menu *mainMenu = nullptr;
|
||||
|
||||
bool isInit = false;
|
||||
bool maneuverInAction = false;
|
||||
bool isInit = false;
|
||||
bool maneuverInAction = false;
|
||||
|
||||
uint32_t lastUpdateTime = 0;
|
||||
uint16_t updateDelay = 1000;
|
||||
uint32_t lastUpdateTime = 0;
|
||||
uint16_t updateDelay = 1000;
|
||||
};
|
||||
|
||||
typedef bool (TestMode::*TestModeFunctionSingle)(int16_t);
|
||||
typedef bool (TestMode::*TestModeFunctionDouble)(int16_t, int16_t);
|
||||
class MenuTestModeWrapper : public MenuIntInputWrapper {
|
||||
public:
|
||||
MenuTestModeWrapper(MenuTestMode* menu, TestModeFunctionSingle testModeFunction);
|
||||
MenuTestModeWrapper(MenuTestMode* menu, TestModeFunctionDouble testModeFunction);
|
||||
typedef bool (TestMode::*TestModeFunctionSingle)(int16_t);
|
||||
typedef bool (TestMode::*TestModeFunctionDouble)(int16_t, int16_t);
|
||||
class MenuTestModeWrapper : public MenuIntInputWrapper
|
||||
{
|
||||
public:
|
||||
MenuTestModeWrapper(MenuTestMode *menu, TestModeFunctionSingle testModeFunction);
|
||||
MenuTestModeWrapper(MenuTestMode *menu, TestModeFunctionDouble testModeFunction);
|
||||
|
||||
void action(int16_t* values, uint8_t length) override;
|
||||
void action(int16_t *values, uint8_t length) override;
|
||||
|
||||
private:
|
||||
MenuTestMode* menu;
|
||||
TestMode* testMode;
|
||||
TestModeFunctionSingle testModeFunctionSingle = nullptr;
|
||||
TestModeFunctionDouble testModeFunctionDouble = nullptr;
|
||||
private:
|
||||
MenuTestMode *menu;
|
||||
TestMode *testMode;
|
||||
TestModeFunctionSingle testModeFunctionSingle = nullptr;
|
||||
TestModeFunctionDouble testModeFunctionDouble = nullptr;
|
||||
};
|
||||
|
||||
#endif // MENU_TEST_MODE
|
||||
#endif // MENU_TEST_MODE_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file menuTest.cpp
|
||||
* @file speedometerTest.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains the implementation of the class SpeedometerTest.
|
||||
* @version 0.1
|
||||
@@ -11,68 +11,77 @@
|
||||
|
||||
#include "speedometerTest.h"
|
||||
|
||||
SpeedometerTest::SpeedometerTest(Speedometer* speedometer) {
|
||||
this->speedometer = speedometer;
|
||||
SpeedometerTest::SpeedometerTest(Speedometer *speedometer)
|
||||
: speedometer{speedometer}
|
||||
{
|
||||
this->speedometer->setDirection(Speedometer::Forward);
|
||||
}
|
||||
|
||||
void SpeedometerTest::printMenu()
|
||||
{
|
||||
switch (this->state)
|
||||
{
|
||||
case State::Off:
|
||||
this->print("Press Yes (O)", "to start");
|
||||
break;
|
||||
|
||||
void SpeedometerTest::printMenu() {
|
||||
switch (this->state) {
|
||||
case State::Off :
|
||||
this->print("Press Yes (O)", "to start");
|
||||
break;
|
||||
case State::Running:
|
||||
this->print("Running, Yes (O)", "to stop");
|
||||
break;
|
||||
|
||||
case State::Running :
|
||||
this->print("Running, Yes (O)", "to stop");
|
||||
break;
|
||||
case State::Finished:
|
||||
{
|
||||
String res = "";
|
||||
res.concat(this->result);
|
||||
this->print("Result: ", res);
|
||||
}
|
||||
break;
|
||||
|
||||
case State::Finished : {
|
||||
String res = "";
|
||||
res.concat(this->result);
|
||||
this->print("Result: ", res);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
this->print("Error in", "MenuTest.cpp");
|
||||
break;
|
||||
default:
|
||||
this->print("Error in", "MenuTest.cpp");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SpeedometerTest::left() {
|
||||
void SpeedometerTest::left()
|
||||
{
|
||||
this->no();
|
||||
}
|
||||
|
||||
void SpeedometerTest::no() {
|
||||
void SpeedometerTest::no()
|
||||
{
|
||||
if (this->state == State::Running)
|
||||
{
|
||||
speedometer->calibrationMeasurementStop();
|
||||
}
|
||||
|
||||
this->state = State::Off;
|
||||
this->parentMenu->printMenu();
|
||||
}
|
||||
|
||||
void SpeedometerTest::yes() {
|
||||
switch (this->state) {
|
||||
case State::Off :
|
||||
this->state = State::Running;
|
||||
this->speedometer->calibrationMeasurementStart();
|
||||
this->printMenu();
|
||||
break;
|
||||
void SpeedometerTest::yes()
|
||||
{
|
||||
switch (this->state)
|
||||
{
|
||||
case State::Off:
|
||||
this->state = State::Running;
|
||||
this->speedometer->calibrationMeasurementStart();
|
||||
this->printMenu();
|
||||
break;
|
||||
|
||||
case State::Running :
|
||||
this->state = State::Finished;
|
||||
this->result = this->speedometer->calibrationMeasurementStop();
|
||||
this->printMenu();
|
||||
break;
|
||||
case State::Running:
|
||||
this->state = State::Finished;
|
||||
this->result = this->speedometer->calibrationMeasurementStop();
|
||||
this->printMenu();
|
||||
break;
|
||||
|
||||
case State::Finished :
|
||||
this->state = State::Running;
|
||||
this->speedometer->calibrationMeasurementStart();
|
||||
this->printMenu();
|
||||
break;
|
||||
case State::Finished:
|
||||
this->state = State::Running;
|
||||
this->speedometer->calibrationMeasurementStart();
|
||||
this->printMenu();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file menuTest.h
|
||||
* @file speedometerTest.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a class to test the wheel encoder.
|
||||
* @version 0.1
|
||||
@@ -18,47 +18,49 @@
|
||||
* @brief Tests the wheel encoder.
|
||||
*
|
||||
*/
|
||||
class SpeedometerTest : public MenuControl {
|
||||
public:
|
||||
/**
|
||||
* @brief The states of the test.
|
||||
*/
|
||||
enum State {
|
||||
Off,
|
||||
Running,
|
||||
Finished
|
||||
};
|
||||
class SpeedometerTest : public MenuControl
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief The states of the test.
|
||||
*/
|
||||
enum State
|
||||
{
|
||||
Off,
|
||||
Running,
|
||||
Finished
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Construct a new Speedometer Test object
|
||||
*
|
||||
* @param speedometer
|
||||
*/
|
||||
SpeedometerTest(Speedometer* speedometer);
|
||||
/**
|
||||
* @brief Construct a new Speedometer Test object
|
||||
*
|
||||
* @param speedometer
|
||||
*/
|
||||
SpeedometerTest(Speedometer *speedometer);
|
||||
|
||||
/**
|
||||
* @brief Prints the actual state of the test.
|
||||
*/
|
||||
void printMenu() override;
|
||||
/**
|
||||
* @brief Prints the actual state of the test.
|
||||
*/
|
||||
void printMenu() override;
|
||||
|
||||
/**
|
||||
* @brief Calls no.
|
||||
*/
|
||||
void left() override;
|
||||
/**
|
||||
* @brief Calls no.
|
||||
*/
|
||||
void left() override;
|
||||
|
||||
/**
|
||||
* @brief Exit the menu or end the test.
|
||||
*/
|
||||
void no() override;
|
||||
/**
|
||||
* @brief Exit the menu or end the test.
|
||||
*/
|
||||
void no() override;
|
||||
|
||||
/**
|
||||
* @brief Starts or restarts the test.
|
||||
*/
|
||||
void yes() override;
|
||||
/**
|
||||
* @brief Starts or restarts the test.
|
||||
*/
|
||||
void yes() override;
|
||||
|
||||
private:
|
||||
Speedometer* speedometer;
|
||||
State state = State::Off;
|
||||
private:
|
||||
Speedometer *speedometer;
|
||||
State state = State::Off;
|
||||
|
||||
uint16_t result = 0;
|
||||
uint16_t result = 0;
|
||||
};
|
||||
|
||||
@@ -11,17 +11,161 @@
|
||||
|
||||
#include "menuDriveMode.h"
|
||||
|
||||
MenuDriveMode::MenuDriveMode(DriveManager* driveManager) {
|
||||
this->driveManager = driveManager;
|
||||
MenuDriveMode::MenuDriveMode(DriveManager *driveManager)
|
||||
: driveManager{driveManager}
|
||||
{
|
||||
}
|
||||
|
||||
void MenuDriveMode::left() {
|
||||
MenuDriveMode::~MenuDriveMode()
|
||||
{
|
||||
if (this->selfCreatedMenuSpeed)
|
||||
{
|
||||
delete this->menuSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
void MenuDriveMode::addSpeedMenu(MenuIntInput *menuSpeed)
|
||||
{
|
||||
if (this->selfCreatedMenuSpeed)
|
||||
{
|
||||
delete this->menuSpeed;
|
||||
this->selfCreatedMenuSpeed = false;
|
||||
}
|
||||
|
||||
this->menuSpeed = menuSpeed;
|
||||
}
|
||||
|
||||
void MenuDriveMode::left()
|
||||
{
|
||||
if (static_cast<bool>(this->activeMenu))
|
||||
{
|
||||
if (static_cast<bool>(this->activeMenu))
|
||||
{
|
||||
this->activeMenu->left();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this->firstPrint = true;
|
||||
this->driveManager->changeModus(Modi::Off);
|
||||
if (parentMenu)
|
||||
this->parentMenu->printMenu();
|
||||
this->configureOnLeave();
|
||||
delete this->menuSpeed;
|
||||
this->driveManager->changeModus();
|
||||
MenuInformationSites::left();
|
||||
}
|
||||
|
||||
void MenuDriveMode::no() {
|
||||
this->left();
|
||||
void MenuDriveMode::right()
|
||||
{
|
||||
if (static_cast<bool>(this->activeMenu))
|
||||
{
|
||||
this->activeMenu->right();
|
||||
return;
|
||||
}
|
||||
MenuInformationSites::right();
|
||||
}
|
||||
|
||||
void MenuDriveMode::up()
|
||||
{
|
||||
if (static_cast<bool>(this->activeMenu))
|
||||
{
|
||||
this->activeMenu->up();
|
||||
return;
|
||||
}
|
||||
MenuInformationSites::up();
|
||||
}
|
||||
|
||||
void MenuDriveMode::down()
|
||||
{
|
||||
if (static_cast<bool>(this->activeMenu))
|
||||
{
|
||||
this->activeMenu->down();
|
||||
return;
|
||||
}
|
||||
MenuInformationSites::down();
|
||||
}
|
||||
|
||||
void MenuDriveMode::yes()
|
||||
{
|
||||
if (static_cast<bool>(this->activeMenu))
|
||||
{
|
||||
this->activeMenu->yes();
|
||||
return;
|
||||
}
|
||||
MenuInformationSites::yes();
|
||||
}
|
||||
|
||||
void MenuDriveMode::no()
|
||||
{
|
||||
if (static_cast<bool>(this->activeMenu))
|
||||
{
|
||||
this->activeMenu->no();
|
||||
return;
|
||||
}
|
||||
MenuInformationSites::no();
|
||||
}
|
||||
|
||||
void MenuDriveMode::prepareReenterMenu()
|
||||
{
|
||||
this->activeMenu = nullptr;
|
||||
}
|
||||
|
||||
void MenuDriveMode::printMenu()
|
||||
{
|
||||
if (static_cast<bool>(this->activeMenu))
|
||||
{
|
||||
this->activeMenu->printMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
MenuInformationSites::printMenu();
|
||||
}
|
||||
|
||||
void MenuDriveMode::init()
|
||||
{
|
||||
this->activeMenu = nullptr;
|
||||
}
|
||||
|
||||
void MenuDriveMode::activateSpeedMenu()
|
||||
{
|
||||
if (!this->driveManager->isActive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->selfCreatedMenuSpeed)
|
||||
{
|
||||
delete this->menuSpeed;
|
||||
}
|
||||
|
||||
DrivingSpeeds &speeds = this->driveManager->getDriveModiPtr()->getSpeedsRef();
|
||||
auto *menu = new MenuIntInput(2, new MenuSpeed(speeds));
|
||||
|
||||
menu->setMinMax(5, UINT8_MAX);
|
||||
menu->setEntry(0, "x m/s e-1", driveManager->getDrivingSpeedsRef().x * 10);
|
||||
menu->setEntry(1, "z rad/s e-1", driveManager->getDrivingSpeedsRef().rot * 10);
|
||||
|
||||
this->selfCreatedMenuSpeed = true;
|
||||
this->addSpeedMenu(menu);
|
||||
}
|
||||
|
||||
void MenuDriveMode::enterSpeedMenu()
|
||||
{
|
||||
this->activeMenu = this->menuSpeed;
|
||||
this->enterMenu();
|
||||
}
|
||||
|
||||
void MenuDriveMode::enterSensorMenu()
|
||||
{
|
||||
this->activeMenu = this->menuSensor;
|
||||
this->enterMenu();
|
||||
}
|
||||
|
||||
void MenuDriveMode::enterMenu()
|
||||
{
|
||||
if (!static_cast<bool>(this->activeMenu))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->activeMenu->printMenu();
|
||||
this->activeMenu->setParentMenu(this);
|
||||
}
|
||||
|
||||
@@ -11,43 +11,87 @@
|
||||
#ifndef MENU_DRIVE_MODI_H
|
||||
#define MENU_DRIVE_MODI_H
|
||||
|
||||
#include "menuControl.h"
|
||||
#include "menuInformationSites.h"
|
||||
#include "driveModi/driveManager.h"
|
||||
#include "SpecialMenus/SensorData/menuSensorData.h"
|
||||
#include "SpecialMenus/Speed/menuSpeed.h"
|
||||
|
||||
/**
|
||||
* @brief A base class for Menus about DriveModi
|
||||
*
|
||||
*/
|
||||
class MenuDriveMode : public MenuControl {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Drive Mode object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuDriveMode(DriveManager* driveManager);
|
||||
class MenuDriveMode : public MenuInformationSites
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Drive Mode object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuDriveMode(DriveManager *driveManager);
|
||||
|
||||
void down() override {}
|
||||
void up() override {}
|
||||
void right() override {}
|
||||
~MenuDriveMode();
|
||||
|
||||
/**
|
||||
* @brief Goes back to the parentMenu.
|
||||
*/
|
||||
void left() override;
|
||||
void addSensorMenu(MenuSensorData *menuSensor) { this->menuSensor = menuSensor; }
|
||||
void addSpeedMenu(MenuIntInput *menuSpeed);
|
||||
|
||||
/**
|
||||
* @brief Calls left.
|
||||
*/
|
||||
void no() override;
|
||||
/**
|
||||
* @brief Goes back to the parentMenu.
|
||||
*/
|
||||
void left() override;
|
||||
void right() override;
|
||||
void up() override;
|
||||
void down() override;
|
||||
void yes() override;
|
||||
void no() override;
|
||||
|
||||
void yes() override {}
|
||||
void prepareReenterMenu() override;
|
||||
void printMenu() override;
|
||||
|
||||
virtual void printMenu() = 0;
|
||||
protected:
|
||||
void init() override;
|
||||
|
||||
protected:
|
||||
DriveManager* driveManager;
|
||||
bool firstPrint = true;
|
||||
/**
|
||||
* @brief Prepare leaving the menu
|
||||
*
|
||||
* Can be overwritten to add extra functionality to safely
|
||||
* exit the menu. This function is called before the parentMenu
|
||||
* is printed.
|
||||
*/
|
||||
virtual void configureOnLeave() {}
|
||||
|
||||
/**
|
||||
* @brief Creates an own SpeedMenu
|
||||
*
|
||||
* This function uses addSpeedMenu() at the end to that the new menu
|
||||
*/
|
||||
void activateSpeedMenu();
|
||||
|
||||
/**
|
||||
* @brief Enter a Menu to edit the speeds
|
||||
*
|
||||
* To enter this menu it has to be set by addSpeedMenu() or activateSpeedMenu()
|
||||
*/
|
||||
void enterSpeedMenu();
|
||||
|
||||
/**
|
||||
* @brief Enter a Menu with the SensorData
|
||||
*
|
||||
* To enter this menu it has to be set by addSensorMenu()
|
||||
*/
|
||||
void enterSensorMenu();
|
||||
|
||||
DriveManager *driveManager;
|
||||
|
||||
bool firstPrint = true;
|
||||
|
||||
private:
|
||||
void enterMenu();
|
||||
|
||||
MenuControl *activeMenu = nullptr;
|
||||
MenuSensorData *menuSensor = nullptr;
|
||||
MenuIntInput *menuSpeed = nullptr;
|
||||
|
||||
bool selfCreatedMenuSpeed = false;
|
||||
};
|
||||
|
||||
#endif // MENU_DRIVE_MODI_H
|
||||
|
||||
@@ -10,94 +10,295 @@
|
||||
*/
|
||||
|
||||
#include "driveModi/Modi/Autopilot/autopilot.h"
|
||||
#include "autopilot.h"
|
||||
|
||||
Autopilot::Autopilot(MoveControl* moveControl, Ps3Controller *gamepad, Navigation* navigation)
|
||||
: ManualControl(moveControl, gamepad) {
|
||||
this->navigation = navigation;
|
||||
this->navigationStarted = this->navigation->startNavigation();
|
||||
this->routeInfo = this->navigation->getRouteInfo();
|
||||
this->courseCorrection.correction = 0;
|
||||
this->courseCorrection.distance = 0;
|
||||
this->updateDisplay = true;
|
||||
DirectionChangeSignal::DirectionChangeSignal(Autopilot *pilot)
|
||||
: pilot {pilot}
|
||||
{
|
||||
this->action();
|
||||
}
|
||||
|
||||
void Autopilot::loop() {
|
||||
if (!this->selfDriving && this->navigationStarted)
|
||||
ManualControl::loop();
|
||||
|
||||
if (millis() - this->lastMillis < delay)
|
||||
return;
|
||||
|
||||
this->runAutopilot();
|
||||
this->lastMillis = millis();
|
||||
DirectionChangeSignal::~DirectionChangeSignal()
|
||||
{
|
||||
CalcAzimuth *calcAzimuth = pilot->getSensorData()->getCalcCompass();
|
||||
if (static_cast<bool>(calcAzimuth))
|
||||
{
|
||||
calcAzimuth->disableCalcAzimuth();
|
||||
}
|
||||
}
|
||||
|
||||
void Autopilot::runAutopilot() {
|
||||
if (!this->navigationStarted || this->navigationEnded)
|
||||
return;
|
||||
void DirectionChangeSignal::action()
|
||||
{
|
||||
CalcAzimuth *calcAzimuth = pilot->getSensorData()->getCalcCompass();
|
||||
if (static_cast<bool>(calcAzimuth))
|
||||
{
|
||||
calcAzimuth->drivingDirectionChange(pilot->getSensorData()->getCurrentPos());
|
||||
}
|
||||
}
|
||||
|
||||
this->courseCorrection = this->navigation->getCourseCorrection();
|
||||
Autopilot::~Autopilot()
|
||||
{
|
||||
delete this->directionChangeSignal;
|
||||
// this->navigation->getNTRIPClient()->setActivated(false);
|
||||
}
|
||||
|
||||
void Autopilot::run()
|
||||
{
|
||||
this->routeInfo = this->navigation->getRouteInfo();
|
||||
this->updateDisplay = true;
|
||||
|
||||
// Check if start Point is near to current Location
|
||||
if (this->routeInfo.currentPoint >= 2)
|
||||
this->selfDrivingAvailable = true;
|
||||
switch (this->state)
|
||||
{
|
||||
case State::InsufficientAccuracy:
|
||||
this->askNavigationForOrder();
|
||||
return;
|
||||
|
||||
if (!this->selfDriving && this->selfDrivingAvailable)
|
||||
this->setSelfDriving(this->gamepad->data.button.triangle);
|
||||
case State::NoRoute:
|
||||
return;
|
||||
|
||||
if (this->routeInfo.currentPoint == this->routeInfo.totalPoints) {
|
||||
this->navigationEnded = true;
|
||||
this->navigationStarted = false;
|
||||
this->selfDrivingAvailable = false;
|
||||
this->setSelfDriving(false);
|
||||
}
|
||||
case State::None:
|
||||
return;
|
||||
|
||||
if (selfDriving) {
|
||||
this->setSpeedInRelToDistance(this->courseCorrection.distance);
|
||||
this->setRotInRelToDistance(this->courseCorrection.correction);
|
||||
case State::NavigationStarted:
|
||||
this->askNavigationForOrder();
|
||||
this->checkButtonInput();
|
||||
break;
|
||||
|
||||
case State::GetToStartPoint:
|
||||
ManualControl::run();
|
||||
this->askNavigationForOrder();
|
||||
if (this->routeInfo.currentPoint >= 2){
|
||||
this->state = State::SelfDrivingAvailable;
|
||||
}
|
||||
break;
|
||||
|
||||
case State::SelfDrivingAvailable:
|
||||
ManualControl::run();
|
||||
this->askNavigationForOrder();
|
||||
this->checkButtonInput();
|
||||
break;
|
||||
|
||||
case State::SelfDriving:
|
||||
this->askNavigationForOrder();
|
||||
this->checkButtonInput();
|
||||
this->selfDriving();
|
||||
break;
|
||||
|
||||
case State::SelfDrivingRotate:
|
||||
this->checkButtonInput();
|
||||
this->rotate();
|
||||
break;
|
||||
|
||||
case State::TargetReached:
|
||||
if (this->loopMode){
|
||||
this->restartLoop();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool Autopilot::shouldUpdate() {
|
||||
if (this->updateDisplay) {
|
||||
void Autopilot::restart()
|
||||
{
|
||||
this->init();
|
||||
}
|
||||
|
||||
bool Autopilot::shouldUpdate()
|
||||
{
|
||||
if (this->updateDisplay)
|
||||
{
|
||||
this->updateDisplay = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Autopilot::setSelfDriving(bool val) {
|
||||
if (!this->navigationStarted)
|
||||
void Autopilot::testRotate(int16_t degree)
|
||||
{
|
||||
if (!static_cast<bool>(degree))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->updateDisplay = true;
|
||||
|
||||
this->selfDriving = val;
|
||||
this->moveControl->setSpeed(0);
|
||||
this->moveControl->setRotationSpeed(0);
|
||||
this->courseCorrection.correction = degree;
|
||||
this->beginRotate();
|
||||
}
|
||||
|
||||
void Autopilot::setSpeedInRelToDistance(double distance) {
|
||||
if (distance >= MIN_DISTANCE_TO_NEXT_POINT)
|
||||
this->moveControl->setSpeed(AUTOPILOT_MAX_SPEED);
|
||||
else if (distance < MIN_DISTANCE_TO_NEXT_POINT)
|
||||
this->moveControl->setSpeed(AUTOPILOT_SPEED_2);
|
||||
else {
|
||||
this->moveControl->setSpeed(0);
|
||||
std::cout << "Error in Autopilot::setSpeedInRelToDistance" << std::endl;
|
||||
void Autopilot::init()
|
||||
{
|
||||
if (this->navigation->startNavigation())
|
||||
{
|
||||
this->state = State::NavigationStarted;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->state = State::NoRoute;
|
||||
}
|
||||
this->routeInfo = this->navigation->getRouteInfo();
|
||||
this->sensorData->getNtripClient()->setAutoReconnect(true);
|
||||
|
||||
this->lastOrderStatus = this->navigation->getCourseCorrection(this->courseCorrection, true);
|
||||
|
||||
this->courseCorrection.correction = 0;
|
||||
this->courseCorrection.distance = 0;
|
||||
this->updateDisplay = true;
|
||||
}
|
||||
|
||||
void Autopilot::drive()
|
||||
{
|
||||
DrivingSpeeds speeds = {0, 0};
|
||||
if (this->courseCorrection.distance >= this->minRemainingDistance)
|
||||
{
|
||||
speeds.x = this->maxSpeeds.x;
|
||||
}
|
||||
this->moveControl->setSpeeds(speeds);
|
||||
}
|
||||
|
||||
void Autopilot::beginRotate()
|
||||
{
|
||||
if (this->state != State::SelfDrivingRotate)
|
||||
{
|
||||
this->lastState = this->state;
|
||||
this->state = State::SelfDrivingRotate;
|
||||
this->rotationAimAzimuth = this->getSensorData()->getRealAzimuth() + this->courseCorrection.correction;
|
||||
this->rotationAimAzimuth = Navigation::fixDegree(this->rotationAimAzimuth);
|
||||
|
||||
DrivingSpeeds speeds = {0, 0};
|
||||
if (this->courseCorrection.correction > 0)
|
||||
{
|
||||
speeds.rot = -this->maxSpeeds.rot;
|
||||
}
|
||||
else
|
||||
{
|
||||
speeds.rot = this->maxSpeeds.rot;
|
||||
}
|
||||
|
||||
this->moveControl->setSpeeds(speeds);
|
||||
}
|
||||
}
|
||||
|
||||
void Autopilot::setRotInRelToDistance(int16_t course) {
|
||||
int8_t steps = course / COURSE_CORRECTION_FACTOR;
|
||||
void Autopilot::rotate()
|
||||
{
|
||||
if (abs(this->getSensorData()->getRealAzimuth() - this->rotationAimAzimuth) < this->maxCourseDeviationBeforeAct)
|
||||
{
|
||||
this->endRotate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (steps == 0 && abs(course) >= MIN_COURSE_CORRECTION_TO_ACT)
|
||||
steps = 1;
|
||||
|
||||
if (course == 0)
|
||||
this->moveControl->setRotationSpeed(0);
|
||||
else
|
||||
this->moveControl->setRotationSpeed(steps);
|
||||
if ((abs(this->getSensorData()->getRealAzimuth() - this->rotationAimAzimuth) < this->maxCourseDeviationBeforeAct * 3) &&
|
||||
((this->courseCorrection.correction > 0 && this->rotationAimAzimuth < this->getSensorData()->getRealAzimuth()) || (this->courseCorrection.correction < 0 && this->rotationAimAzimuth > this->getSensorData()->getRealAzimuth())))
|
||||
{
|
||||
this->endRotate();
|
||||
std::cout << "Autopilot::rotate: Rover rotated too far" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void Autopilot::endRotate()
|
||||
{
|
||||
if (this->state != State::SelfDrivingRotate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->state = this->lastState;
|
||||
this->sensorData->getCalcCompass()->drivingDirectionChange(this->sensorData->getCurrentPos());
|
||||
this->moveControl->setRotationSpeed(0);
|
||||
this->moveControl->emergencyStop();
|
||||
this->moveControl->setDrivingStatus(MoveControl::Status::Drive);
|
||||
}
|
||||
|
||||
void Autopilot::checkButtonInput()
|
||||
{
|
||||
if (ControlPadButton::isControlPadButtonPressed(this->input, ControlPadButton::PadButton::Action) && millis() - this->lastAutopilotChangeMillis > this->autopilotChangeDelayMillis)
|
||||
{
|
||||
|
||||
if (this->state == State::SelfDrivingAvailable)
|
||||
{
|
||||
this->state = State::SelfDriving;
|
||||
}
|
||||
else if (this->state == State::SelfDriving || this->state == State::SelfDrivingRotate)
|
||||
{
|
||||
this->state = State::SelfDrivingAvailable;
|
||||
}
|
||||
else if (this->state == State::NavigationStarted)
|
||||
{
|
||||
this->state = State::GetToStartPoint;
|
||||
}
|
||||
this->updateDisplay = true;
|
||||
this->lastAutopilotChangeMillis = millis();
|
||||
}
|
||||
}
|
||||
|
||||
void Autopilot::askNavigationForOrder()
|
||||
{
|
||||
this->lastOrderStatus = this->navigation->getCourseCorrection(this->courseCorrection);
|
||||
switch (this->lastOrderStatus)
|
||||
{
|
||||
case Navigation::Status::Complete:
|
||||
this->state = State::TargetReached;
|
||||
this->moveControl->setSpeed(0);
|
||||
this->moveControl->setRotationSpeed(0);
|
||||
break;
|
||||
|
||||
case Navigation::Status::InsufficientAccuracy:
|
||||
if (this->state == State::InsufficientAccuracy){
|
||||
break;
|
||||
}
|
||||
this->lastState = this->state;
|
||||
this->state = State::InsufficientAccuracy;
|
||||
this->moveControl->setSpeed(0);
|
||||
this->moveControl->setRotationSpeed(0);
|
||||
break;
|
||||
|
||||
case Navigation::Status::Unchanged:
|
||||
if (this->state == State::InsufficientAccuracy){
|
||||
this->state = this->lastState;
|
||||
}
|
||||
break;
|
||||
|
||||
case Navigation::Status::Updated:
|
||||
if (this->state == State::InsufficientAccuracy){
|
||||
this->state = this->lastState;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Autopilot::selfDriving()
|
||||
{
|
||||
if (this->state != State::SelfDriving)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (abs(this->courseCorrection.correction) >= this->maxCourseDeviationBeforeAct)
|
||||
{
|
||||
this->beginRotate();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->drive();
|
||||
}
|
||||
}
|
||||
|
||||
void Autopilot::restartLoop()
|
||||
{
|
||||
this->navigation->startNavigation();
|
||||
this->state = State::SelfDriving;
|
||||
this->routeInfo = this->navigation->getRouteInfo();
|
||||
this->lastOrderStatus = this->navigation->getCourseCorrection(this->courseCorrection, true);
|
||||
this->updateDisplay = true;
|
||||
}
|
||||
|
||||
void Autopilot::afterActivate()
|
||||
{
|
||||
this->setInputMode(ManualControl::InputMode::Digital);
|
||||
this->directionChangeSignal = new DirectionChangeSignal(this);
|
||||
this->setDirectionChangeCallback(this->directionChangeSignal);
|
||||
this->navigation = new Navigation(this->sensorData);
|
||||
this->init();
|
||||
}
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
#ifndef AUTOPILOT_H
|
||||
#define AUTOPILOT_H
|
||||
|
||||
|
||||
#include "navigation.h"
|
||||
#include "moveControl.h"
|
||||
#include "driveModi/Modi/Autopilot/autopilotConfig.h"
|
||||
#include "driveModi/Modi/ManualControl/manualControl.h"
|
||||
|
||||
class DirectionChangeSignal;
|
||||
|
||||
/**
|
||||
* @brief This class use the navigate class to drive automaticaly
|
||||
*
|
||||
@@ -27,108 +26,106 @@
|
||||
* switch to automatic drive.
|
||||
*
|
||||
*/
|
||||
class Autopilot : public ManualControl {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Autopilot object
|
||||
*
|
||||
* @param moveControl for ManualControl
|
||||
* @param navigation for route instructions
|
||||
*/
|
||||
Autopilot(MoveControl* moveControl, Ps3Controller *gamepad, Navigation* navigation);
|
||||
class Autopilot : public ManualControl
|
||||
{
|
||||
public:
|
||||
enum State
|
||||
{
|
||||
InsufficientAccuracy = -2,
|
||||
NoRoute = -1,
|
||||
None = 0,
|
||||
NavigationStarted,
|
||||
GetToStartPoint,
|
||||
SelfDrivingAvailable,
|
||||
SelfDriving,
|
||||
SelfDrivingRotate,
|
||||
TargetReached
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Calls runAutopilot or ManualControl loop
|
||||
*
|
||||
* This function should be called every main loop. If self
|
||||
* driving is activated the function call run Autopilot. If
|
||||
* the delay is not reached the function returns immediately.
|
||||
*
|
||||
* If self driving is not activated this functions calls the
|
||||
* ManualControl loop additionally.
|
||||
*/
|
||||
void loop();
|
||||
/**
|
||||
* @brief Destroy the Autopilot object
|
||||
*
|
||||
* Disconnect the NTRIP-Client
|
||||
*/
|
||||
~Autopilot();
|
||||
|
||||
/**
|
||||
* @brief Manges the autoipilot
|
||||
*
|
||||
* If the first Point is near to current location you can turn
|
||||
* the autopilot on.
|
||||
* Gets the course correction and decide what to do.
|
||||
*/
|
||||
void runAutopilot();
|
||||
void restart();
|
||||
|
||||
/**
|
||||
* @brief Get the Route Info object
|
||||
*
|
||||
* @return RouteInfo
|
||||
*/
|
||||
RouteInfo getRouteInfo() const { return this->routeInfo; }
|
||||
/**
|
||||
* @brief Get the Route Info object
|
||||
*
|
||||
* @return RouteInfo
|
||||
*/
|
||||
RouteInfo getRouteInfo() const { return this->routeInfo; }
|
||||
|
||||
/**
|
||||
* @brief Get the Course Correction object
|
||||
*
|
||||
* @return CourseCorrection
|
||||
*/
|
||||
CourseCorrection getCourseCorrection() const { return this->courseCorrection; }
|
||||
/**
|
||||
* @brief Get the Course Correction object
|
||||
*
|
||||
* @return CourseCorrection
|
||||
*/
|
||||
CourseCorrection getCourseCorrection() const { return this->courseCorrection; }
|
||||
|
||||
/**
|
||||
* @brief Get the Navigation Started status
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool getNavigationStarted() const { return this->navigationStarted; }
|
||||
/**
|
||||
* @brief Get the State object
|
||||
*
|
||||
* @return State
|
||||
*/
|
||||
State getState() const { return this->state; }
|
||||
Navigation *getNavigation() const { return this->navigation; }
|
||||
|
||||
/**
|
||||
* @brief Get the Navigation Ended status
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool getNavigationEnded() const { return this->navigationEnded; }
|
||||
/**
|
||||
* @brief Tells if there are new informations to display
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool shouldUpdate();
|
||||
void testRotate(int16_t degree);
|
||||
void endRotate();
|
||||
void switchLoopMode() { this->loopMode = !this->loopMode; }
|
||||
bool getLoopMode() const { return this->loopMode; }
|
||||
|
||||
/**
|
||||
* @brief Get the Self Driving status
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool getSelfDriving() const { return this->selfDriving; }
|
||||
private:
|
||||
void init();
|
||||
void drive();
|
||||
void beginRotate();
|
||||
void rotate();
|
||||
void run() override;
|
||||
void checkButtonInput();
|
||||
void askNavigationForOrder();
|
||||
void selfDriving();
|
||||
void restartLoop();
|
||||
void afterActivate() override;
|
||||
|
||||
/**
|
||||
* @brief Get the Self Driving Available status
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool getSelfDrivingAvailable() const { return this->selfDrivingAvailable; }
|
||||
Navigation *navigation = nullptr;
|
||||
CourseCorrection courseCorrection{0, 0};
|
||||
RouteInfo routeInfo{0, 0};
|
||||
State state = State::None;
|
||||
State lastState = State::None;
|
||||
Navigation::Status lastOrderStatus;
|
||||
DirectionChangeSignal *directionChangeSignal = nullptr;
|
||||
|
||||
/**
|
||||
* @brief Tells if there are new informations to display
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool shouldUpdate();
|
||||
bool updateDisplay = false;
|
||||
bool loopMode = false;
|
||||
|
||||
private:
|
||||
void setSelfDriving(bool val);
|
||||
void setSpeedInRelToDistance(double distance);
|
||||
void setRotInRelToDistance(int16_t course);
|
||||
uint8_t maxCourseDeviationBeforeAct = 5;
|
||||
uint16_t autopilotChangeDelayMillis = 500;
|
||||
uint32_t lastAutopilotChangeMillis = 0;
|
||||
|
||||
Navigation* navigation;
|
||||
CourseCorrection courseCorrection;
|
||||
RouteInfo routeInfo;
|
||||
int16_t rotationAimAzimuth = 0;
|
||||
|
||||
bool navigationStarted = false;
|
||||
bool navigationEnded = false;
|
||||
bool selfDriving = false;
|
||||
bool selfDrivingAvailable = false;
|
||||
bool updateDisplay = false;
|
||||
double minRemainingDistance = 0.25;
|
||||
};
|
||||
|
||||
uint16_t lastMillis = 0;
|
||||
uint8_t delay = 40;
|
||||
class DirectionChangeSignal : public DirectionChangeWrapper
|
||||
{
|
||||
public:
|
||||
DirectionChangeSignal(Autopilot *pilot);
|
||||
~DirectionChangeSignal();
|
||||
void action() override;
|
||||
|
||||
private:
|
||||
Autopilot *pilot;
|
||||
};
|
||||
|
||||
#endif // AUTOPILOT_H
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
/**
|
||||
* @file autopilotConfig.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Some defines to configure the behaviour of the autopilot
|
||||
* @version 0.1
|
||||
* @date 2022-03-02
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AUTOPILOT_CONFIG_H
|
||||
#define AUTOPILOT_CONFIG_H
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
#define AUTOPILOT_MAX_SPEED 0.5
|
||||
|
||||
/**
|
||||
* @brief Max speed in the near of target point
|
||||
*/
|
||||
#define AUTOPILOT_SPEED_2 0.25
|
||||
|
||||
/**
|
||||
* @brief Distance in meters
|
||||
*
|
||||
* If this distance to the next point is reached the autopilot will drive
|
||||
* now with the speed set by AUTOPILOT_SPEED_2
|
||||
*/
|
||||
#define MIN_DISTANCE_FOR_SPEED_2 4
|
||||
|
||||
/**
|
||||
* @brief Needed distance to the next point to choose the next point as target.
|
||||
*/
|
||||
#define MIN_DISTANCE_TO_NEXT_POINT 2
|
||||
|
||||
|
||||
/**
|
||||
* @brief Minimal course correction
|
||||
* If the needed correction in degree is lower than this value the rover will
|
||||
* be drive straight on.
|
||||
*/
|
||||
#define MIN_COURSE_CORRECTION_TO_ACT 5
|
||||
|
||||
/**
|
||||
* @brief Course correction factor
|
||||
* This value is used by the setRotInRelToDistance function and is used to calculate
|
||||
* the value for setRotationSpeed.
|
||||
*/
|
||||
#define COURSE_CORRECTION_FACTOR 30
|
||||
|
||||
#endif // AUTOPILOT_CONFIG_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user