compilation works again
This commit is contained in:
+75
-13
@@ -12,29 +12,91 @@
|
||||
#ifndef SENSOR_DATA_H
|
||||
#define SENSOR_DATA_H
|
||||
|
||||
#include "sensors.h"
|
||||
#include <SPI.h>
|
||||
#include <iostream>
|
||||
|
||||
#include "component.h"
|
||||
#include "calibrateCompass.h"
|
||||
|
||||
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
|
||||
#include <QMC5883LCompass.h>
|
||||
// Gyroskop
|
||||
#include "calcAzimuth.h"
|
||||
#include "ntripClient.h"
|
||||
|
||||
class SensorData {
|
||||
#include "point.h"
|
||||
class Sensors;
|
||||
|
||||
class SensorData : public Component {
|
||||
public:
|
||||
SensorData(Sensors *senors);
|
||||
SensorData();
|
||||
~SensorData();
|
||||
|
||||
int16_t getRealAzimuth() const { return 0; }
|
||||
int16_t getCalcAzimuth() const { return 0; }
|
||||
CalcAzimuth::CalcAzimuthState getCalcAzimuthState() const { return CalcAzimuth::CalcAzimuthState::Invalid; }
|
||||
const UBX_NAV_PVT_data_t* const getGnssData() const;
|
||||
const void* const getGyroData() const;
|
||||
void enableNtrip(String host, uint16_t port, String mountPoint, String user, String password);
|
||||
void enableGnss(SPIClass* spiPort, uint8_t csPin);
|
||||
void enableGnss();
|
||||
void enableRealCompass();
|
||||
void enableCalcCompass();
|
||||
void enableGyroskop();
|
||||
|
||||
// Interface Const kram
|
||||
int16_t getRealAzimuth() const { return this->realAzimuth; }
|
||||
int16_t getCalcAzimuth() const { return this->calcAzimuth; }
|
||||
CalcAzimuth::State getCalcAzimuthState() const;
|
||||
|
||||
Point getCurrentPos() const { return this->currentPosition; }
|
||||
const UBX_NAV_PVT_data_t* getGnssData() const { return this->gnssData; };
|
||||
const void* const getGyroData() const;
|
||||
|
||||
CalcAzimuth* getCalcCompass() const { return this->calcCompass; }
|
||||
QMC5883LCompass* getRealCompass() const { return this->realCompass; }
|
||||
NTRIPClient* getNtripClient() const { return this->ntripClient; }
|
||||
|
||||
// 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:
|
||||
Sensors* sensors;
|
||||
void run() override;
|
||||
void runAsChild() override;
|
||||
void initGnss();
|
||||
|
||||
QMC5883LCompass* realCompass = nullptr;
|
||||
CalcAzimuth* calcCompass = nullptr;
|
||||
SFE_UBLOX_GNSS* gnss = nullptr;
|
||||
NTRIPClient* ntripClient = nullptr;
|
||||
|
||||
UBX_NAV_PVT_data_t* gnssData;
|
||||
Point currentPosition;
|
||||
|
||||
char* host;
|
||||
char* mountPoint;
|
||||
char* user;
|
||||
char* password;
|
||||
|
||||
bool isNtripInit = false;
|
||||
|
||||
uint16_t port;
|
||||
int16_t realAzimuth = INT16_MAX;
|
||||
int16_t calcAzimuth = INT16_MAX;
|
||||
|
||||
// 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 bool newData;
|
||||
};
|
||||
|
||||
SensorData::SensorData(Sensors* senors) {
|
||||
this->sensors = sensors;
|
||||
}
|
||||
|
||||
#endif //SENSOR_DATA_H
|
||||
|
||||
Reference in New Issue
Block a user