Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
479a3d171e | ||
|
|
a5bfbc3df9 | ||
|
|
4251eda946 | ||
|
|
27a0a2ca7b | ||
|
|
73fde34e48 | ||
|
|
87743c8e67 | ||
|
|
c866bc0d60 | ||
|
|
dbb646b5a5 | ||
|
|
dd304cf787 | ||
|
|
717daef21e | ||
|
|
16e04afebd | ||
|
|
f227a2f569 | ||
|
|
9b6889b68c | ||
|
|
155975df33 | ||
|
|
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 | ||
|
|
6a76470f45 | ||
|
|
5f650982a7 | ||
|
|
faaa3603a7 | ||
|
|
b6764e54da | ||
|
|
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
|
||||
|
@@ -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 |
|
||||
+----------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"files.insertFinalNewline": true,
|
||||
"editor.wordWrap": "on",
|
||||
"cSpell.ignoreWords": [
|
||||
"ledc",
|
||||
"write"
|
||||
@@ -77,31 +78,92 @@
|
||||
"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",
|
||||
"GNSS",
|
||||
"GPGGA",
|
||||
"HSPI",
|
||||
"Huus",
|
||||
"Keine",
|
||||
"kleiax",
|
||||
"Lebennig",
|
||||
"microcontroller",
|
||||
"Mqtt",
|
||||
"MQTT",
|
||||
"NMEA",
|
||||
"NMEAGPGGA",
|
||||
"ntrip",
|
||||
"Ntrip",
|
||||
"NTRIP",
|
||||
"pcnt",
|
||||
"pidl",
|
||||
"pidr",
|
||||
"Punica",
|
||||
"RHEDE",
|
||||
"Rtcm",
|
||||
"sapos",
|
||||
"SAPOS",
|
||||
"Schalke",
|
||||
"Soln",
|
||||
"Systeminformation",
|
||||
"TPMOBIL",
|
||||
"UBLOX",
|
||||
"wheelspeed",
|
||||
"ZLPJ"
|
||||
]
|
||||
],
|
||||
"cmake.configureOnOpen": false
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# Autonomer Rover
|
||||
Testfahrt auf Youtube: https://youtu.be/GigIyo-vghE?si=jhProl1DQFUrcz7w
|
||||
|
||||
# Beschreibung
|
||||
Vollständige Softwarelösung und Hardwareerweiterungen für einen Rover mit Skid-Antrieb. Das System wurde in C++ geschrieben und es wurden erweiterte Konzepte der Objektorientierung wie Polymorphie eingesetzt. Die Datenhaltung wurde erfolgreich von der Logik getrennt, hierfür wurde unter anderem eine API mit Express.js implementiert. Hardwareseitig wurde PWM für die Motorsteuerung, IC2 für verschiedene Sensoren und SPI für das GNSS-Modul eingesetzt. Zusätzlich wurden Encoder an den Motoren verbaut, um diese präzise zu steuern. Überdies wurde eine RTK-Referenzstation geplant und umgesetzt, dafür wurde die Antenne, ein weiteres GNSS-Modul und ein Embedded-Server installiert und konfiguriert. Durch das Zusammenspiel dieser Systeme kann der Rover Routen im niedrigen einstelligen Zentimeterbereich aufzeichnen und abfahren.
|
||||
@@ -44,14 +44,14 @@ PROJECT_NUMBER =
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
# quick idea about the purpose of the project. Keep the description short.
|
||||
|
||||
PROJECT_BRIEF = "A small verhicle which should be drive a route with GPS"
|
||||
PROJECT_BRIEF = "A small verhicle which should be drive a route with GNNS and RTK"
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
# 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
|
||||
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 4.1 MiB |
|
After Width: | Height: | Size: 7.0 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 419 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 7.6 MiB |
|
After Width: | Height: | Size: 648 KiB |
|
After Width: | Height: | Size: 445 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 2.4 MiB |
|
After Width: | Height: | Size: 772 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 84 KiB |
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,13 +40,33 @@ enum DrivingStatus {stop,
|
||||
* given target speed to calculate a new duty cycle for the motors.
|
||||
*
|
||||
*/
|
||||
class MoveControl {
|
||||
public:
|
||||
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 Construct a new Move Control object
|
||||
*
|
||||
* Initialize the motors, encoders and PIDs with given
|
||||
* values in moveControlConfig.h
|
||||
* values in config.h
|
||||
*/
|
||||
MoveControl();
|
||||
|
||||
@@ -57,28 +78,21 @@ class MoveControl {
|
||||
~MoveControl();
|
||||
|
||||
/**
|
||||
* @brief Calls runMoveControl() to update all Values.
|
||||
* @brief Set the Status
|
||||
*
|
||||
* 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 Normally called repeatedly by loop() to calculate new values.
|
||||
*/
|
||||
void runMoveControl();
|
||||
|
||||
/**
|
||||
* @brief Set the DrivingStatus
|
||||
* Control if this component should work normally or with
|
||||
* raw values for the motors.
|
||||
*
|
||||
* @see DrivingStatus
|
||||
* @see Status
|
||||
* @param status
|
||||
*/
|
||||
void setDrivingStatus(DrivingStatus status);
|
||||
void setDrivingStatus(Status status);
|
||||
|
||||
/**
|
||||
* @brief Stops the engine immediately
|
||||
*
|
||||
*/
|
||||
void emergencyStop();
|
||||
|
||||
/**
|
||||
* @brief Set the target speed
|
||||
@@ -90,27 +104,40 @@ class MoveControl {
|
||||
void setSpeed(double speed);
|
||||
|
||||
/**
|
||||
* @brief Set the rotationspeed
|
||||
* @brief Set the rotationSpeed
|
||||
*
|
||||
* If the given rotationspeed is close to zero, then the
|
||||
* target rotationspeed is set to zero.
|
||||
* 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
|
||||
* @brief Set the speeds
|
||||
*
|
||||
* This value has only an effect if DrivingStatus is raw.
|
||||
* 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 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 Raw Power Right
|
||||
* @brief Set the raw power right
|
||||
*
|
||||
* This value has only an effect if DrivingStatus is raw.
|
||||
* This value has only an effect if status is raw.
|
||||
*
|
||||
* @param power between -100 and 100
|
||||
*/
|
||||
@@ -120,11 +147,11 @@ class MoveControl {
|
||||
* @brief Set the pid tunings
|
||||
*
|
||||
* @param side 0 -> left, 1 -> right
|
||||
* @param p
|
||||
* @param i
|
||||
* @param d
|
||||
* @param pPart
|
||||
* @param iPart
|
||||
* @param dPart
|
||||
*/
|
||||
void setPidTunings(uint8_t side, double p, double i, double d);
|
||||
void setPidTunings(uint8_t side, double pPart, double iPart, double dPart);
|
||||
|
||||
/**
|
||||
* @brief Returns the PID object of the choosen side.
|
||||
@@ -132,76 +159,45 @@ class MoveControl {
|
||||
* @param side 0 -> left, 1 -> right
|
||||
* @return PID*
|
||||
*/
|
||||
PID* getPID(uint8_t side);
|
||||
PID *getPID(uint8_t side) const;
|
||||
|
||||
/**
|
||||
* @brief Get the Speedometer Left object
|
||||
*
|
||||
* @return Speedometer*
|
||||
*/
|
||||
Speedometer* getSpeedometerLeft() const { return this->left_speedometer; }
|
||||
Speedometer *getSpeedometerLeft() const { return this->leftSpeedometer; }
|
||||
Speedometer *getSpeedometerRight() const { return this->rightSpeedometer; }
|
||||
|
||||
/**
|
||||
* @brief Get the Speedometer Right object
|
||||
*
|
||||
* @return Speedometer*
|
||||
*/
|
||||
Speedometer* getSpeedometerRight() const { return this->right_speedometer; }
|
||||
uint16_t getDutycycleLeft() const { return this->leftMotor->getDutycycle(); }
|
||||
uint16_t getDutycycleRight() const { return this->rightMotor->getDutycycle(); }
|
||||
|
||||
/**
|
||||
* @brief Set the min delay between each loop
|
||||
*
|
||||
* @param delay_ time in Milliseconds
|
||||
*/
|
||||
void setDelay(uint8_t delay) { this->delay = delay; }
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Converts values into wheel speeds
|
||||
*
|
||||
* Converts target speed and target rotationspeed into
|
||||
* wheel speeds
|
||||
*/
|
||||
private:
|
||||
void run() override;
|
||||
static void setSpeedometerDirection(Speedometer *speedometer, double value);
|
||||
void calcTargetWheelSpeed();
|
||||
|
||||
/**
|
||||
* @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();
|
||||
|
||||
/**
|
||||
* @brief Updates the wheel speeds with speedometer
|
||||
*/
|
||||
void updateCurrentWheelSpeed();
|
||||
|
||||
MotorControl *left_motor;
|
||||
MotorControl *right_motor;
|
||||
Speedometer *left_speedometer;
|
||||
Speedometer *right_speedometer;
|
||||
PID *left_pid;
|
||||
PID *right_pid;
|
||||
MotorControl *leftMotor;
|
||||
MotorControl *rightMotor;
|
||||
Speedometer *leftSpeedometer;
|
||||
Speedometer *rightSpeedometer;
|
||||
PID *leftPid;
|
||||
PID *rightPid;
|
||||
|
||||
DrivingStatus driving_status = DrivingStatus::stop;
|
||||
Status driving_status = Status::Stop;
|
||||
DrivingSpeeds drivingSpeeds = {0, 0};
|
||||
|
||||
double x_speed = 0;
|
||||
double rotation_speed = 0;
|
||||
double wheelspeedLeftTarget = 0;
|
||||
double wheelspeedRightTarget = 0;
|
||||
double wheelspeedLeft = 0;
|
||||
double wheelspeedRight = 0;
|
||||
double leftPidOut = 0;
|
||||
double rightPidOut = 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
|
||||
@@ -12,139 +12,95 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// 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 ZUHAUSE
|
||||
#define SAPOS_NI
|
||||
// #define RTK2GO
|
||||
|
||||
/**
|
||||
* @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.13";
|
||||
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#";
|
||||
}
|
||||
|
||||
#ifdef RTK2GO
|
||||
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";
|
||||
const bool sendOwnPosition = false;
|
||||
}
|
||||
#endif // RTK2GO
|
||||
|
||||
#ifdef SAPOS_NI
|
||||
namespace NtripConfig
|
||||
{
|
||||
const char host[] = "sapos-ni-ntrip.de";
|
||||
const uint16_t port = 2101;
|
||||
const char mountPoint[] = "VRS_3_4G_NI";
|
||||
const char user[] = "ni_FHDo01";
|
||||
const char password[] = "ALdx-1-3e49";
|
||||
const bool sendOwnPosition = true;
|
||||
}
|
||||
#endif // RTK2GO
|
||||
|
||||
@@ -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)
|
||||
return;
|
||||
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->readAdcToBuf();
|
||||
this->loopCounter++;
|
||||
|
||||
if (this->loopCounter >= this->calculateDelayMultiplier)
|
||||
{
|
||||
this->calculateBatteryVoltage();
|
||||
this->calculateBatteryPercent();
|
||||
|
||||
this->lastMillis = millis();
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
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 Construct a new Battery object
|
||||
*
|
||||
* The voltage devider have to be calculated, so that the input
|
||||
* 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 r1 First resistor of the voltage devider.
|
||||
* @param r2 Second resistor of the voltage devider.
|
||||
* @param firstResistor First resistor of the voltage divider.
|
||||
* @param secondResistor Second resistor of the voltage divider.
|
||||
*/
|
||||
Battery(uint8_t pin, uint32_t r1, uint32_t r2);
|
||||
Battery(uint8_t pin, uint32_t firstResistor, uint32_t secondResistor);
|
||||
|
||||
/**
|
||||
* @brief Read new values if the delay is reached.
|
||||
*/
|
||||
void loop();
|
||||
|
||||
/**
|
||||
* @brief Set the delay to wait befor new values are read
|
||||
* @brief Construct a new Battery object
|
||||
*
|
||||
* @param delay in milliseconds
|
||||
*/
|
||||
void setDelay(uint16_t delay) {this->delay = delay; }
|
||||
|
||||
/**
|
||||
* @brief Get the delay to wait befor new values are read
|
||||
* 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
|
||||
*
|
||||
* @return uint16_t delay in milliseconds
|
||||
* @param pin
|
||||
*/
|
||||
uint16_t getDelay() {return this->delay; }
|
||||
Battery(uint8_t pin);
|
||||
|
||||
/**
|
||||
* @brief Get the battery voltage
|
||||
*
|
||||
* @return double in Volt
|
||||
*/
|
||||
double getBatteryVoltage();
|
||||
double getBatteryVoltage() const;
|
||||
|
||||
/**
|
||||
* @brief Get the charge level of the battery
|
||||
*
|
||||
* @return uint8_t charge level in percent
|
||||
*/
|
||||
uint8_t getBatteryPercent() {return this->batteryPercent;}
|
||||
uint8_t getBatteryPercent() const { return this->batteryPercent; }
|
||||
|
||||
private:
|
||||
double readInputVoltage();
|
||||
/**
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* @brief Check if a new voltage was been calculated
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool isNewValue();
|
||||
|
||||
// Calibration
|
||||
CalibrationState getCalibrationState() const { return this->calibrationState; }
|
||||
|
||||
/**
|
||||
* @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;
|
||||
uint16_t delay = 20000;
|
||||
uint32_t r1;
|
||||
uint32_t r2;
|
||||
uint64_t lastMillis = 0;
|
||||
double batteryVoltage;
|
||||
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 };
|
||||
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();
|
||||
this->changed = false;
|
||||
LcdWrapper::LcdWrapper(LiquidCrystal_I2C *lcd)
|
||||
: lcd{lcd}, changed{false}
|
||||
{
|
||||
// this->clear();
|
||||
}
|
||||
|
||||
void LcdWrapper::loop() {
|
||||
if (this->changed) {
|
||||
void LcdWrapper::run()
|
||||
{
|
||||
if (!this->changed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->lcd->clear();
|
||||
for (uint8_t i = 0; i < DISPLAY_WRAPPER_LINES; i++) {
|
||||
for (uint8_t i = 0; i < LcdWrapper::totalLines; i++)
|
||||
{
|
||||
this->lcd->setCursor(0, i);
|
||||
this->lcd->print(this->data[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::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];
|
||||
|
||||
inputStringPosition++;
|
||||
}
|
||||
this->changed = true;
|
||||
|
||||
@@ -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,24 +25,18 @@
|
||||
* 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:
|
||||
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();
|
||||
LcdWrapper(LiquidCrystal_I2C *lcd);
|
||||
|
||||
/**
|
||||
* @brief Empty the buffer
|
||||
*
|
||||
*/
|
||||
void clear() override;
|
||||
|
||||
@@ -54,6 +47,7 @@ class LcdWrapper : public DisplayWrapper {
|
||||
* @param line
|
||||
*/
|
||||
void setCursor(uint8_t row, uint8_t line) override;
|
||||
void setCallback(LcdWrapperCallback callback) { this->callback = callback; }
|
||||
|
||||
/**
|
||||
* @brief Save the data to be printed
|
||||
@@ -62,10 +56,15 @@ class LcdWrapper : public DisplayWrapper {
|
||||
*/
|
||||
void print(const char *str) override;
|
||||
|
||||
static constexpr uint8_t totalRows = 16;
|
||||
static constexpr uint8_t totalLines = 2;
|
||||
|
||||
private:
|
||||
LiquidCrystal_I2C* lcd;
|
||||
char data[DISPLAY_WRAPPER_LINES][DISPLAY_WRAPPER_ROWS];
|
||||
private:
|
||||
void run() override;
|
||||
|
||||
LiquidCrystal_I2C *lcd;
|
||||
LcdWrapperCallback callback = nullptr;
|
||||
char data[LcdWrapper::totalLines][LcdWrapper::totalRows];
|
||||
|
||||
uint8_t cursorRow = 0;
|
||||
uint8_t cursorLine = 0;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
enum Loglevel
|
||||
{
|
||||
none,
|
||||
error,
|
||||
warn,
|
||||
info,
|
||||
debug,
|
||||
influx};
|
||||
influx
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A class to send debug messages over MQTT
|
||||
@@ -64,15 +66,16 @@ enum Loglevel { none,
|
||||
*
|
||||
* @see Loglevel
|
||||
*/
|
||||
class DebugMqtt {
|
||||
public:
|
||||
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(const char *name, uint8_t bufSize = 0);
|
||||
|
||||
~DebugMqtt();
|
||||
|
||||
@@ -108,8 +111,8 @@ class DebugMqtt {
|
||||
* @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);
|
||||
static void sendData(Loglevel loglevel, String topic, String data);
|
||||
static void sendData(Loglevel loglevel, String data);
|
||||
|
||||
/**
|
||||
* @brief Send a Message via MQTT for InfluxDB
|
||||
@@ -132,9 +135,9 @@ class DebugMqtt {
|
||||
* 1. when the buffer is full
|
||||
* 2. when the character is '\n'
|
||||
*
|
||||
* @param c
|
||||
* @param character
|
||||
*/
|
||||
void addCharacter(char c);
|
||||
void addCharacter(char character);
|
||||
|
||||
/**
|
||||
* @brief Initialize debugMQTT for all instances
|
||||
@@ -149,7 +152,7 @@ class DebugMqtt {
|
||||
* @param client PubSubClient
|
||||
* @param max_loglevel Max loglevel to send.
|
||||
*/
|
||||
static void init(PubSubClient* client, Loglevel max_loglevel);
|
||||
static void init(PubSubClient *client, Loglevel max_loglevel);
|
||||
|
||||
/**
|
||||
* @brief Change loglevel
|
||||
@@ -160,15 +163,15 @@ class DebugMqtt {
|
||||
*/
|
||||
static void changeLoglevel(Loglevel loglevel);
|
||||
|
||||
private:
|
||||
const char* name;
|
||||
char* buf;
|
||||
private:
|
||||
const char *name;
|
||||
char *buf;
|
||||
uint8_t bufPos = 0;
|
||||
uint8_t bufSize = 100;
|
||||
|
||||
static String enum_to_string(Loglevel loglevel);
|
||||
|
||||
static PubSubClient* client;
|
||||
static PubSubClient *client;
|
||||
static Loglevel loglevel;
|
||||
static bool isInit;
|
||||
static char msg[MQTT_BUFFER_SIZE];
|
||||
|
||||
@@ -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,180 @@ 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);
|
||||
}
|
||||
|
||||
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) {
|
||||
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(powersteps);
|
||||
}
|
||||
|
||||
} else {
|
||||
// Positive or negative speed
|
||||
if (this->power >= 0) {
|
||||
this->increasePower(-powersteps);
|
||||
} else {
|
||||
if (difference > 0) {
|
||||
this->increasePower(powersteps);
|
||||
} else {
|
||||
this->increasePower(-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) {
|
||||
if (power <= 100 && power >= -100)
|
||||
this->target_power = power;
|
||||
else
|
||||
{
|
||||
this->increasePower(-MotorControl::powerSteps);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->increasePower(MotorControl::powerSteps);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Positive or negative speed
|
||||
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 > MotorControl::maxPwmMin)
|
||||
{
|
||||
min = MotorControl::maxPwmMin;
|
||||
}
|
||||
// transform percentage to real pwm value
|
||||
min = static_cast<uint8_t>(((static_cast<uint8_t>(1) << pwmRes) - 1) * (min / 100.0));
|
||||
this->dutycycleMin = min;
|
||||
}
|
||||
|
||||
void MotorControl::setMaxPwm(uint8_t max)
|
||||
{
|
||||
if (max > 100)
|
||||
{
|
||||
max = 100;
|
||||
}
|
||||
// transform percentage to real pwm value
|
||||
max = static_cast<uint8_t>(((static_cast<uint8_t>(1) << pwmRes) - 1) * (max / 100.0));
|
||||
this->dutycycleMax = max;
|
||||
}
|
||||
|
||||
void MotorControl::setTargetPower(int8_t power)
|
||||
{
|
||||
if (power <= 100 && power >= -100)
|
||||
{
|
||||
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)
|
||||
{
|
||||
// TODO: Exceptionhandling
|
||||
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;
|
||||
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, this->dutycycleMin, this->dutycycleMax);
|
||||
|
||||
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);
|
||||
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)
|
||||
{
|
||||
// TODO: Exceptionhandling
|
||||
// TODO: make a stop befor a direction change
|
||||
if (abs(power) > 2 * MotorControl::powerSteps)
|
||||
{
|
||||
Serial.println("Invalid Argument in MotorControl::increasePower");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,51 +16,27 @@
|
||||
#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:
|
||||
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 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 pwm_pin, uint8_t pwm_channel, 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 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();
|
||||
void init(uint8_t pwmPin, uint8_t pwmChannel, uint8_t dir_1, uint8_t dir_2);
|
||||
|
||||
/**
|
||||
* @brief Set the minimum duty cycle
|
||||
@@ -76,24 +52,6 @@ class MotorControl {
|
||||
*/
|
||||
void setMaxPwm(uint8_t max);
|
||||
|
||||
/**
|
||||
* @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 Set the Target Power
|
||||
*
|
||||
@@ -104,19 +62,6 @@ class MotorControl {
|
||||
*/
|
||||
void setTargetPower(int8_t power);
|
||||
|
||||
/**
|
||||
* @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);
|
||||
|
||||
/**
|
||||
* @brief Stops the motor like setTargetPower() to 0
|
||||
*
|
||||
@@ -134,38 +79,42 @@ class MotorControl {
|
||||
*
|
||||
* @return int8_t percent of power (-100 to 100)
|
||||
*/
|
||||
int8_t getPower();
|
||||
int8_t getPower() const { return this->power; };
|
||||
|
||||
/**
|
||||
* @brief Get the target power
|
||||
*
|
||||
* @return int8_t percent of power (-100 to 100)
|
||||
*/
|
||||
int8_t getTargetPower();
|
||||
bool isTargetPowerReached();
|
||||
bool isAccelerationPositive();
|
||||
bool isAccelerationNegative();
|
||||
int8_t getTargetPower() const { return this->targetPower; };
|
||||
|
||||
private:
|
||||
uint16_t getDutycycle() const { return this->dutycycle; }
|
||||
bool isTargetPowerReached() const;
|
||||
bool isAccelerationPositive() const;
|
||||
bool isAccelerationNegative() const;
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
void setRealPower(int8_t power);
|
||||
void increasePower(int8_t power);
|
||||
|
||||
int8_t target_power = 0;
|
||||
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;
|
||||
|
||||
int8_t targetPower = 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;
|
||||
|
||||
uint8_t pwmPin = 0;
|
||||
uint8_t pwmChannel = 0;
|
||||
uint16_t dutycycle = 0;
|
||||
uint8_t dutycycleMin = 55;
|
||||
uint8_t dutycycleMax = 98; // Max 98% of 2^PWM_RES
|
||||
uint8_t dir_1 = 0;
|
||||
uint8_t dir_2 = 0;
|
||||
};
|
||||
|
||||
#endif // MOTOR_CONTROL_H
|
||||
|
||||
@@ -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)
|
||||
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};
|
||||
Navigation::Status Navigation::getCourseCorrection(CourseCorrection &correction, bool forceUpdate)
|
||||
{
|
||||
if (this->navigationFinished)
|
||||
{
|
||||
return Status::Complete;
|
||||
}
|
||||
|
||||
if (this->currentPosition.getAccuracy() <= this->minAccuracy)
|
||||
{
|
||||
return Status::InsufficientAccuracy;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
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) {
|
||||
if (distance < this->minDistanceToReachPoint && this->preventNextPoint == false)
|
||||
{
|
||||
if (!this->nextPoint())
|
||||
{
|
||||
this->navigationFinished = true;
|
||||
this->navigationStarted = false;
|
||||
return courseCorrection; // End of navigation
|
||||
return Status::Complete; // End of navigation
|
||||
}
|
||||
distance = this->currentPosition.distanceTo(this->targetPoint);
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
||||
courseCorrection.correction = correction;
|
||||
courseCorrection.distance = distance;
|
||||
return courseCorrection;
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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,26 +35,29 @@ 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
|
||||
* @brief Construct a new Navigation object
|
||||
*
|
||||
* @param route with which to navigate
|
||||
* @param sensorData
|
||||
* @param route
|
||||
*/
|
||||
Navigation(SPIClass* spiPort, uint8_t csPin, Route* route = nullptr);
|
||||
Navigation(const SensorData *sensorData, Route *route = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Destroy the Navigation object
|
||||
@@ -74,24 +65,6 @@ class Navigation {
|
||||
*/
|
||||
~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 Decodes new GPS information
|
||||
*
|
||||
* Should be called ever main loop.
|
||||
*/
|
||||
void loop();
|
||||
|
||||
/**
|
||||
* @brief creates a new empty route
|
||||
*
|
||||
@@ -108,16 +81,22 @@ class Navigation {
|
||||
* @return false route can not be started
|
||||
*/
|
||||
bool startNavigation();
|
||||
void freezeTargetPoint(bool val = true) { this->preventNextPoint = val; };
|
||||
|
||||
double increaseMinDistanceToReachPoint() { return this->minDistanceToReachPoint += 0.1; }
|
||||
double decreaseMinDistanceToReachPoint() { return this->minDistanceToReachPoint -= 0.1; }
|
||||
|
||||
// TODO: Dokumentation korrigieren.
|
||||
/**
|
||||
* @brief Get the Course Correction object
|
||||
*
|
||||
* This should be called by the driver to get new instructions.
|
||||
*
|
||||
* @return CourseCorrection
|
||||
* @param correction
|
||||
* @param forceUpdate
|
||||
* @return Status
|
||||
*/
|
||||
CourseCorrection getCourseCorrection();
|
||||
Status getCourseCorrection(CourseCorrection &correction, bool forceUpdate = false);
|
||||
|
||||
// TODO: Dokumentation korrigieren.
|
||||
/**
|
||||
* @brief Tries to add the current Position to the route
|
||||
*
|
||||
@@ -126,26 +105,7 @@ class Navigation {
|
||||
* @return true successful added point
|
||||
* @return false no point added to route
|
||||
*/
|
||||
bool addCurrentPosToRoute();
|
||||
|
||||
// TODO: can be deleted?
|
||||
// bool setPointBeforeTurn();
|
||||
|
||||
/**
|
||||
* @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; }
|
||||
|
||||
/**
|
||||
* @brief Returns the NTRIPClient object
|
||||
*
|
||||
* @return NTRIPClient*
|
||||
*/
|
||||
NTRIPClient* getNTRIPClient() { return this->ntripClient; }
|
||||
Status addCurrentPosToRoute();
|
||||
|
||||
/**
|
||||
* @brief Get the Route Info object
|
||||
@@ -156,86 +116,48 @@ class Navigation {
|
||||
* @return RouteInfo
|
||||
*/
|
||||
RouteInfo getRouteInfo() const { return this->route->getRouteInfo(); }
|
||||
Route* getRoute() const { return this->route; }
|
||||
Route *getRoute() const { return this->route; }
|
||||
Point getCurrentPosition() const { return this->currentPosition; }
|
||||
|
||||
/**
|
||||
* @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; }
|
||||
Point::Accuracy getMinAccuracy() const { return this->minAccuracy; }
|
||||
void setMinAccuracy(Point::Accuracy accuracy) { this->minAccuracy = accuracy; }
|
||||
|
||||
/**
|
||||
* @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);
|
||||
// map input in range from -180 to 180 degree
|
||||
static int16_t fixDegree(int16_t degree);
|
||||
|
||||
private:
|
||||
void updateCurrentLocation();
|
||||
|
||||
/**
|
||||
* @brief Set the next point as target
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
private:
|
||||
void run() override;
|
||||
void init(Route *route);
|
||||
bool nextPoint();
|
||||
|
||||
/**
|
||||
* @brief Set the target point
|
||||
*
|
||||
* @param target
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool setTargetPoint(Point target);
|
||||
int16_t calculateCourseCorrection(Point &point);
|
||||
|
||||
void init(Route* route);
|
||||
static constexpr uint8_t loopDelay = 20;
|
||||
static constexpr uint8_t maxDisBetweenPoints = 10;
|
||||
static constexpr float minDisBetweenPoints = 0.3;
|
||||
|
||||
SFE_UBLOX_GNSS* gps;
|
||||
UBX_NAV_PVT_data_t* ubxData = nullptr;
|
||||
Route* route = nullptr;
|
||||
NTRIPClient* ntripClient = nullptr;
|
||||
QMC5883LCompass* compass;
|
||||
const SensorData *sensorData;
|
||||
Route *route = nullptr;
|
||||
|
||||
Point lastPoint;
|
||||
Point lastPointRouteInsert;
|
||||
Point lastPointCalcCorrection;
|
||||
Point lastPointDrivingDirectionChange;
|
||||
Point targetPoint;
|
||||
Point currentPosition;
|
||||
Point beforeTurnPoint;
|
||||
|
||||
Point::Accuracy minAccuracy = Point::Accuracy::twoDigOfCM;
|
||||
|
||||
bool navigationStarted = false;
|
||||
bool navigationFinished = false;
|
||||
bool isNtripInit = false;
|
||||
|
||||
char* host;
|
||||
char* mountPoint;
|
||||
char* user;
|
||||
char* password;
|
||||
bool preventNextPoint = false;
|
||||
bool directionChangeMode = false;
|
||||
bool lastUsedCalcAzimuth = false;
|
||||
|
||||
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
|
||||
@@ -11,78 +11,68 @@
|
||||
|
||||
#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;
|
||||
void NTRIPClient::run()
|
||||
{
|
||||
switch (this->state)
|
||||
{
|
||||
case NTRIPClientStates::openingConnection:
|
||||
if (!this->activated)
|
||||
{
|
||||
this->state = NTRIPClientStates::closingConnection;
|
||||
break;
|
||||
}
|
||||
|
||||
std::cout << "Connecting to the NTRIP caster..." << std::endl;
|
||||
if (this->beginClient()) {
|
||||
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();
|
||||
this->state = NTRIPClientStates::pushingData;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Failed!" << std::endl;
|
||||
this->state = NTRIPClientStates::waiting;
|
||||
this->lastReconnectTime = millis();
|
||||
this->activated = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case NTRIPClientStates::pushData:
|
||||
case NTRIPClientStates::pushingData:
|
||||
if (!processConnection() || !this->activated)
|
||||
this->state = NTRIPClientStates::closeConnection;
|
||||
{
|
||||
this->state = NTRIPClientStates::closingConnection;
|
||||
}
|
||||
break;
|
||||
|
||||
case NTRIPClientStates::closeConnection:
|
||||
case NTRIPClientStates::closingConnection:
|
||||
std::cout << "Closing the connection to the NTRIP caster..." << std::endl;
|
||||
this->closeConnection();
|
||||
state = NTRIPClientStates::wait;
|
||||
state = NTRIPClientStates::waiting;
|
||||
break;
|
||||
|
||||
case NTRIPClientStates::wait:
|
||||
case NTRIPClientStates::waiting:
|
||||
if (this->activated)
|
||||
this->state = NTRIPClientStates::openConnection;
|
||||
if (this->activated) {
|
||||
// std::cout << "state is openConnection" << std::endl;
|
||||
{
|
||||
this->state = NTRIPClientStates::openingConnection;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->checkAutoReconnect();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -91,87 +81,159 @@ void NTRIPClient::loop() {
|
||||
|
||||
default:
|
||||
std::cout << "Wrong state in NTRIPClient.cpp..." << std::endl;
|
||||
this->state = NTRIPClientStates::closeConnection;
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// Generate the server request (GET)
|
||||
snprintf(serverRequest,
|
||||
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);
|
||||
static_cast<const char *>("GET /%s HTTP/1.0\r\nHost: %s:%u\r\nUser-Agent: NTRIP KleiaxNtripClient/0.1\r\nAccept: */*\r\nConnection: 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\nHost: %s:%u\r\nNtrip-Version: Ntrip/2.0\r\nUser-Agent: NTRIP KleiaxNtripClient/0.1\r\nAccept: */*\r\nConnection: close\r\n"),
|
||||
this->mountPoint,
|
||||
this->host,
|
||||
this->port);
|
||||
}
|
||||
|
||||
// Add own Position if activated
|
||||
if (this->transmitLocation && !this->useNtripRev1)
|
||||
{
|
||||
std::cout << "NTRIPClient::beginClient - Add own position to server request." << std::endl;
|
||||
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"),
|
||||
data->nmea);
|
||||
strncat(static_cast<char *>(serverRequest), static_cast<const char *>(positionUpdate), this->bufferSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "NTRIPClient::beginClient - No valid data to send position to caster." << std::endl;
|
||||
}
|
||||
delete data;
|
||||
|
||||
this->lastGPGGAPushTime = millis();
|
||||
}
|
||||
|
||||
if (this->user && this->password)
|
||||
{
|
||||
// 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);
|
||||
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
|
||||
base64 b;
|
||||
String strEncodedCredentials = b.encode(userCredentials);
|
||||
// Encode
|
||||
const base64 base;
|
||||
const String strEncodedCredentials = base64::encode(userCredentials);
|
||||
delete userCredentials;
|
||||
char encodedCredentials[strEncodedCredentials.length() + 1];
|
||||
strEncodedCredentials.toCharArray(encodedCredentials, sizeof(encodedCredentials));
|
||||
strEncodedCredentials.toCharArray(static_cast<char *>(encodedCredentials), sizeof(encodedCredentials));
|
||||
|
||||
snprintf(credentials, sizeof(credentials), "Authorization: Basic %s\r\n", 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(serverRequest, credentials, this->bufferSize);
|
||||
strncat(serverRequest, "\r\n", this->bufferSize);
|
||||
strncat(static_cast<char *>(serverRequest), static_cast<const char *>(credentials), this->bufferSize);
|
||||
}
|
||||
|
||||
std::cout << "serverRequest size: "
|
||||
strncat(static_cast<char *>(serverRequest), static_cast<const char *>("\r\n"), this->bufferSize);
|
||||
|
||||
std::cout << static_cast<const char *>("serverRequest size: ")
|
||||
<< strlen(serverRequest)
|
||||
<< " of "
|
||||
<< static_cast<const char *>(" of ")
|
||||
<< this->bufferSize
|
||||
<< " bytes available"
|
||||
<< 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 +241,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 +291,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 +339,62 @@ 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) || !this->ntripClient->connected())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (millis() - this->lastGPGGAPushTime < this->pushGPGGATime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->lastGPGGAPushTime = millis();
|
||||
|
||||
auto *data = new NMEA_GGA_data_t;
|
||||
const uint8_t res = this->gnss->getLatestNMEAGPGGA(data);
|
||||
if (res > 0) // 2 means fresh data
|
||||
{
|
||||
char positionUpdate[this->bufferSizePushGPGGA];
|
||||
snprintf(static_cast<char *>(positionUpdate),
|
||||
this->bufferSizePushGPGGA,
|
||||
static_cast<const char *>("%s"),
|
||||
data->nmea);
|
||||
this->ntripClient->write(positionUpdate, strlen(positionUpdate));
|
||||
std::cout << "Position update: " << positionUpdate << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "NTRIPClient::pushGPGGA - No valid data to send position to caster." << std::endl;
|
||||
}
|
||||
delete data;
|
||||
}
|
||||
|
||||
bool NTRIPClient::isConnected()
|
||||
{
|
||||
return this->state == NTRIPClientStates::pushingData;
|
||||
}
|
||||
|
||||
@@ -19,16 +19,18 @@
|
||||
#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,
|
||||
enum NTRIPClientStates
|
||||
{
|
||||
openingConnection,
|
||||
pushingData,
|
||||
closingConnection,
|
||||
waiting,
|
||||
notAvailable
|
||||
};
|
||||
|
||||
@@ -39,34 +41,27 @@ 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:
|
||||
class NTRIPClient : public Component
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new NTRIPClient object
|
||||
*
|
||||
* @param gps The Gnss module
|
||||
* @param gnss 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(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 gpsConfiguration();
|
||||
void gnssConfiguration();
|
||||
|
||||
/**
|
||||
* @brief Activate or deactivate the location transmission
|
||||
@@ -81,11 +76,13 @@ class NTRIPClient {
|
||||
/**
|
||||
* @brief Activate or deactivate the connection to the server.
|
||||
*
|
||||
* @param b
|
||||
* @param state
|
||||
* @return true success
|
||||
* @return false failure
|
||||
*/
|
||||
bool setActivated(bool b);
|
||||
bool setActivated(bool state);
|
||||
void setAutoReconnect(bool state);
|
||||
void useOutdatedNtripRev1 (bool rev1 = false ) { this->useNtripRev1 = rev1; }
|
||||
|
||||
bool isConnected();
|
||||
|
||||
@@ -98,34 +95,44 @@ class NTRIPClient {
|
||||
*/
|
||||
NTRIPClientStates getClientState() { return this->state; }
|
||||
|
||||
private:
|
||||
void pushGPGGA(NMEA_GGA_data_t *nmeaData);
|
||||
private:
|
||||
void run() override;
|
||||
void runAsChild() override;
|
||||
void pushGPGGA();
|
||||
bool beginClient();
|
||||
void closeConnection();
|
||||
bool processConnection();
|
||||
void checkAutoReconnect();
|
||||
|
||||
SFE_UBLOX_GNSS* gps;
|
||||
WiFiClient* ntripClient;
|
||||
SFE_UBLOX_GNSS *gnss;
|
||||
WiFiClient *ntripClient;
|
||||
NTRIPClientStates state = NTRIPClientStates::notAvailable;
|
||||
|
||||
bool transmitLocation = true;
|
||||
bool transmitLocation = false;
|
||||
bool activated = true;
|
||||
bool autoReconnect = false;
|
||||
bool useNtripRev1 = false;
|
||||
|
||||
uint8_t reconnectAttemps = 0;
|
||||
uint16_t port;
|
||||
uint32_t lastReceivedRtcmTime = 0;
|
||||
uint32_t lastNtripConnectTime = 0;
|
||||
// uint32_t lastNtripConnectTime = 0; // can deleted?
|
||||
uint32_t lastGPGGAPushTime = 0;
|
||||
uint32_t lastLoopTime = 0;
|
||||
uint32_t lastReconnectTime = 0;
|
||||
|
||||
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;
|
||||
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 pushGPGGATime = 10000;
|
||||
const uint16_t bufferSizePushGPGGA = 128;
|
||||
const uint16_t pushGPGGATime = 5000;
|
||||
|
||||
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,286 @@
|
||||
/**
|
||||
* @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, bool sendOwnPosition)
|
||||
{
|
||||
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->setTransmitLocation(sendOwnPosition);
|
||||
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);
|
||||
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, bool sendOwnPosition = false);
|
||||
|
||||
/**
|
||||
* @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
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,16 +26,18 @@
|
||||
* The calculated speed is the average of an amount of last measurements.
|
||||
*
|
||||
*/
|
||||
class Speedometer {
|
||||
public:
|
||||
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 Dorection is None, no measurement will be taken.
|
||||
* If the Direction is None, no measurement will be taken.
|
||||
*/
|
||||
enum Direction {
|
||||
enum Direction
|
||||
{
|
||||
None,
|
||||
Forward,
|
||||
Backward
|
||||
@@ -57,45 +48,18 @@ class Speedometer {
|
||||
*
|
||||
* @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.
|
||||
* @param steps EncoderSteps for a complete wheel rotation.
|
||||
*/
|
||||
Speedometer(uint8_t pin, double diameter, uint16_t steps, uint8_t numOfValForAvg);
|
||||
Speedometer(uint8_t pin, double diameter, uint16_t steps);
|
||||
|
||||
~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 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 direction
|
||||
*
|
||||
* @param dir Direction
|
||||
*/
|
||||
void setDirection(Direction dir) { this->currentDirection = dir; }
|
||||
|
||||
/**
|
||||
* @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);
|
||||
void setDirection(Direction dir);
|
||||
|
||||
/**
|
||||
* @brief Set the Enc Filter to prevent bouncing
|
||||
@@ -106,26 +70,33 @@ class Speedometer {
|
||||
*/
|
||||
void setEncFilter(uint16_t val);
|
||||
|
||||
/**
|
||||
* @brief Set the min delayLoop between each loop
|
||||
*
|
||||
* @param delayLoop time in Milliseconds
|
||||
*/
|
||||
void setDelay(uint8_t delayLoop) { this->delayLoop = delayLoop; }
|
||||
|
||||
/**
|
||||
* @brief Get the Direction
|
||||
*
|
||||
* @return Direction
|
||||
*/
|
||||
Direction getDirection() { return this->currentDirection; }
|
||||
Direction getDirection() const { return this->currentDirection; }
|
||||
|
||||
/**
|
||||
* @brief Get the calculated speed of the Wheel
|
||||
* @brief Get the calculated speed of the wheel
|
||||
*
|
||||
* @return double speed in m/s
|
||||
*/
|
||||
double getSpeed() { return this->speed; }
|
||||
double getSpeed() const { return this->speed; }
|
||||
|
||||
/**
|
||||
* @brief Get the calculated speed of the wheel
|
||||
*
|
||||
* @return double speed in rad/s
|
||||
*/
|
||||
double getSpeedRad() const { return this->rad; };
|
||||
|
||||
/**
|
||||
* @brief Get the calculated average speed of the wheel
|
||||
*
|
||||
* @return double speed in m/s
|
||||
*/
|
||||
double getAvgSpeed() const;
|
||||
|
||||
/**
|
||||
* @brief Start calibration
|
||||
@@ -145,31 +116,32 @@ class Speedometer {
|
||||
*/
|
||||
uint16_t calibrationMeasurementStop();
|
||||
|
||||
|
||||
private:
|
||||
void init(uint8_t pin, double diameter, uint16_t steps);
|
||||
void initAvgBuf();
|
||||
private:
|
||||
void run() override;
|
||||
void clearAvgBuf();
|
||||
void addValToBuf(int16_t val);
|
||||
void updateAvgBufSize();
|
||||
int16_t calcAverage();
|
||||
int16_t calcAverage() const;
|
||||
|
||||
PulseCounter* pulseCounter;
|
||||
static constexpr uint8_t loopDelay = 30;
|
||||
static constexpr uint8_t bufSize = 5;
|
||||
static constexpr uint8_t conversionFactor = 100;
|
||||
|
||||
Counter *pulseCounter;
|
||||
Direction currentDirection = Direction::None;
|
||||
|
||||
bool calibrationRunning = false;
|
||||
|
||||
double speed = 0;
|
||||
double rad = 0;
|
||||
double diameter;
|
||||
|
||||
uint8_t bufSize = BUFSIZE;
|
||||
uint8_t delayLoop = DELAY_SPEEDOMETER;
|
||||
uint8_t printCounter = 0;
|
||||
uint8_t bufPos = 0;
|
||||
uint16_t steps;
|
||||
int16_t buf[Speedometer::bufSize];
|
||||
uint32_t lastMillisCalc = 0;
|
||||
|
||||
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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -28,8 +28,9 @@
|
||||
* @warning This class is not very accurate
|
||||
* It only give you the time in milliseconds.
|
||||
*/
|
||||
class DebugTimes {
|
||||
public:
|
||||
class DebugTimes
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Debug Times object
|
||||
* Starts to count milliseconds
|
||||
@@ -47,17 +48,17 @@ class DebugTimes {
|
||||
*
|
||||
* @return uint16_t elapsed milliseconds
|
||||
*/
|
||||
uint16_t stop();
|
||||
const uint16_t stop();
|
||||
|
||||
/**
|
||||
* @brief Print the elapsed time to consol
|
||||
*
|
||||
* @param name Functionname to print
|
||||
* @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);
|
||||
const uint16_t stopConsol(const char *name, uint16_t minTime = 0);
|
||||
|
||||
/**
|
||||
* @brief Sets if the result should be printed.
|
||||
@@ -66,11 +67,11 @@ class DebugTimes {
|
||||
*/
|
||||
static void setConsolOutput(bool enable);
|
||||
|
||||
private:
|
||||
private:
|
||||
uint64_t startTime;
|
||||
|
||||
static bool print;
|
||||
static bool printWarning;
|
||||
};
|
||||
|
||||
#endif //DEBUG_TIMES_H
|
||||
#endif // DEBUG_TIMES_H
|
||||
|
||||
@@ -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
|
||||
;
|
||||
;
|
||||
;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Serial.print((char) c);
|
||||
{
|
||||
this->serialBT->print(static_cast<char>(character));
|
||||
}
|
||||
return c;
|
||||
|
||||
Serial.print(static_cast<char>(character));
|
||||
}
|
||||
return character;
|
||||
}
|
||||
|
||||
@@ -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,26 +26,28 @@
|
||||
#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:
|
||||
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);
|
||||
OutputBuf(DebugMqtt *debugMqtt = nullptr, BluetoothSerial *serialBT = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Activate the mqtt output
|
||||
*
|
||||
* This only works if the DebugMqtt is set by
|
||||
* setDebugMqtt.
|
||||
* setDebugMqtt().
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
@@ -55,17 +57,16 @@ class OutputBuf : public std::streambuf {
|
||||
* @brief Active the output over the bluetooth serial consol
|
||||
*
|
||||
* This only works if BluetoothSerial is set by
|
||||
* setSerialBT.
|
||||
* setSerialBT().
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
void activateSerialBT(bool status);
|
||||
|
||||
void setDebugMqtt(DebugMqtt* debugMqtt);
|
||||
void setSerialBT(BluetoothSerial* serialBT);
|
||||
void setDebugMqtt(DebugMqtt *debugMqtt);
|
||||
void setSerialBT(BluetoothSerial *serialBT);
|
||||
|
||||
|
||||
protected:
|
||||
protected:
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
@@ -74,12 +75,12 @@ class OutputBuf : public std::streambuf {
|
||||
*/
|
||||
virtual std::streambuf::int_type overflow(std::streambuf::int_type c);
|
||||
|
||||
private:
|
||||
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:
|
||||
class MenuPidSettings : public MenuIntInputWrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Pid Settings object
|
||||
*
|
||||
* @param pid
|
||||
*/
|
||||
MenuPidSettings(PID* 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,23 +34,24 @@ 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:
|
||||
class MenuActionRoute : public MenuActionWrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Action Route object
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction like exportRoute
|
||||
*/
|
||||
MenuActionRoute(MenuRoute* menuRoute, DataFunction dataFunction);
|
||||
MenuActionRoute(MenuRoute *menuRoute, DataFunction dataFunction);
|
||||
|
||||
/**
|
||||
* @brief Runs the given DataFunction
|
||||
*/
|
||||
void action() override;
|
||||
|
||||
private:
|
||||
MenuRoute* menuRoute;
|
||||
private:
|
||||
MenuRoute *menuRoute;
|
||||
DataFunction dataFunction;
|
||||
};
|
||||
|
||||
@@ -59,14 +60,15 @@ class MenuActionRoute : public MenuActionWrapper {
|
||||
*
|
||||
* With this menu the user can import, export and delete routes.
|
||||
*/
|
||||
class MenuRoute : public MenuControl {
|
||||
public:
|
||||
class MenuRoute : public MenuControl
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route object
|
||||
*
|
||||
* @param route
|
||||
*/
|
||||
MenuRoute(Route* route);
|
||||
MenuRoute(Route *route);
|
||||
~MenuRoute();
|
||||
|
||||
/**
|
||||
@@ -109,6 +111,15 @@ class MenuRoute : public MenuControl {
|
||||
*/
|
||||
void exportRoute(uint8_t routeNumber);
|
||||
|
||||
/**
|
||||
* @brief Delete a Route
|
||||
*
|
||||
* The functions tries to delete the current route from the RoverApi.
|
||||
*
|
||||
* @param routeNumber
|
||||
*/
|
||||
void deleteRoute(uint8_t routeNumber);
|
||||
|
||||
/**
|
||||
* @brief Delete the current Route.
|
||||
*
|
||||
@@ -116,29 +127,35 @@ class MenuRoute : public MenuControl {
|
||||
*/
|
||||
void clearRoute(uint8_t none);
|
||||
|
||||
private:
|
||||
private:
|
||||
void init();
|
||||
|
||||
Route* route;
|
||||
Menu* mainMenu;
|
||||
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:
|
||||
class MenuRouteWrapper : public MenuIntInputWrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Wrapper object.
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction
|
||||
*/
|
||||
MenuRouteWrapper(MenuRoute* menuRoute, DataFunction dataFunction);
|
||||
MenuRouteWrapper(MenuRoute *menuRoute, DataFunction dataFunction);
|
||||
|
||||
/**
|
||||
* @brief Calls the given DataFunction.
|
||||
@@ -146,10 +163,10 @@ class MenuRouteWrapper : public MenuIntInputWrapper {
|
||||
* @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;
|
||||
void action(int16_t *values, uint8_t length) override;
|
||||
|
||||
private:
|
||||
MenuRoute* menuRoute;
|
||||
private:
|
||||
MenuRoute *menuRoute;
|
||||
DataFunction dataFunction = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -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,8 +20,9 @@
|
||||
* @brief Prints coordinates of Route side by side.
|
||||
*
|
||||
*/
|
||||
class MenuRoutePoints : public MenuInformationSites {
|
||||
public:
|
||||
class MenuRoutePoints : public MenuInformationSites
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Points object
|
||||
*
|
||||
@@ -34,17 +35,16 @@ class MenuRoutePoints : public MenuInformationSites {
|
||||
*
|
||||
* Set the amount of pages.
|
||||
*/
|
||||
void init () override;
|
||||
void init() override;
|
||||
|
||||
/**
|
||||
* @brief Prints the the coordinates of the current Point.
|
||||
*/
|
||||
void printPage() const override;
|
||||
|
||||
private:
|
||||
Route* route;
|
||||
private:
|
||||
Route *route;
|
||||
bool error = false;
|
||||
|
||||
};
|
||||
|
||||
#endif // MENU_ROUTE_POINTS_H
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
|
||||
void MenuSensorData::runCommand()
|
||||
{
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 5:
|
||||
{
|
||||
NTRIPClient* client = this->sensorData->getNtripClient();
|
||||
NTRIPClientStates state = client->getClientState();
|
||||
if (state == NTRIPClientStates::pushingData)
|
||||
{
|
||||
client->deactivate();
|
||||
}
|
||||
else if (state == NTRIPClientStates::waiting)
|
||||
{
|
||||
client->activate();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @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;
|
||||
void runCommand() 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;
|
||||
}
|
||||