network is now a component

This commit is contained in:
2023-09-20 08:51:31 +02:00
parent 936d2b9647
commit baf1936824
9 changed files with 340 additions and 414 deletions
+14 -6
View File
@@ -171,10 +171,14 @@ void SensorData::setOutputStatusPrintPVTdata(bool status) {
}
void SensorData::run() {
this->realCompass->read();
this->realAzimuth = this->realCompass->getAzimuth();
if (this->realCompass) {
this->realCompass->read();
this->realAzimuth = this->realCompass->getAzimuth();
}
if (this->gyroskop->dmpGetCurrentFIFOPacket(this->gyroBuffer)) {
if (this->gyroskop
&& this->gyroskop->dmpGetCurrentFIFOPacket(this->gyroBuffer))
{
this->gyroskop->dmpGetQuaternion(&this->quaternion, this->gyroBuffer);
this->gyroskop->dmpGetGravity(&this->gravity, &this->quaternion);
this->gyroskop->dmpGetYawPitchRoll(this->yawPitchRoll, &this->quaternion, &this->gravity);
@@ -182,11 +186,15 @@ void SensorData::run() {
}
void SensorData::runAsChild() {
this->gnss->checkUblox();
this->gnss->checkCallbacks();
if (this->gnss) {
this->gnss->checkUblox();
this->gnss->checkCallbacks();
}
if (SensorData::newData)
if (SensorData::newData) {
SensorData::newData = false;
// TODO: Update data
}
}
void SensorData::initGnss() {