network is now a component
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user