Start with Capture Route

This commit is contained in:
2022-01-31 21:12:11 +01:00
parent ab4ceb8b09
commit d356b28ffb
24 changed files with 327 additions and 320 deletions
+27
View File
@@ -1,2 +1,29 @@
/**
* @file navigation.cpp
* @author Alexander Klein (alex@kleiax.de)
* @brief
* @version 0.1
* @date 2022-01-31
*
* @copyright Copyright (c) 2022
*
*/
#include "navigation.h"
Navigation::Navigation(uint8_t rx, uint8_t tx) {
this->gps = new TinyGPSPlus();
Serial1.begin(9600, SERIAL_8N1, rx, tx);
}
void Navigation::loop() {
gps->encode(Serial1.read());
}
void Navigation::addCurrentPosToRoute() {
Point p;
if (this->gps->location.isUpdated() && this->gps->location.isValid()) {
p.lat = this->gps->location.lat();
p.lon = this->gps->location.lng();
}
}