Update doxygen comments

This commit is contained in:
2023-02-13 20:36:04 +01:00
parent 1604cb0026
commit deecf7724c
23 changed files with 497 additions and 70 deletions
+8 -9
View File
@@ -57,7 +57,6 @@ void Navigation::init(Route* route) {
else
this->route = new Route();
this->ntripClient = new NTRIPClient();
this->compass = new QMC5883LCompass();
// Init Compass
@@ -77,7 +76,7 @@ Navigation::~Navigation() {
}
void Navigation::initNtrip(String host, uint16_t port, String mountPoint, String user, String password) {
this->ntripClient->init(this->gps, host.c_str(), port, mountPoint.c_str(), user.c_str(), password.c_str());
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);
@@ -93,7 +92,7 @@ void Navigation::loop() {
Navigation::newData = false;
}
if (this->isNtripInit)
if (this->ntripClient)
this->ntripClient->loop();
if (millis() - this->lastMillis > AZIMUTH_UPDATE_DELAY) {
@@ -169,12 +168,12 @@ bool Navigation::addCurrentPosToRoute() {
return false;
}
bool Navigation::setPointBeforeTurn() {
if (millis() - this->currentPosition.getCreationTime() > 1000)
return false;
this->beforeTurnPoint = this->currentPosition;
return true;
}
// bool Navigation::setPointBeforeTurn() {
// if (millis() - this->currentPosition.getCreationTime() > 1000)
// return false;
// this->beforeTurnPoint = this->currentPosition;
// return true;
// }
void Navigation::updateCurrentLocation() {
if (Navigation::ubxUpdateTimeStatic == this->ubxUpdateTime)
+19 -8
View File
@@ -128,14 +128,8 @@ class Navigation {
*/
bool addCurrentPosToRoute();
bool setPointBeforeTurn();
// /**
// * @brief Returns the GPS object
// *
// * @return SFE_UBLOX_GNSS*
// */
// SFE_UBLOX_GNSS* getGPS() { return this->gps; }
// TODO: can be deleted?
// bool setPointBeforeTurn();
/**
* @brief Get the Ubx Data object
@@ -163,8 +157,25 @@ class Navigation {
*/
RouteInfo getRouteInfo() const { return this->route->getRouteInfo(); }
Route* getRoute() const { return this->route; }
/**
* @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; }
/**
* @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:
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* @file route.cpp
* @author Alexander Klein (alex@kleiax.de)
* @brief Implements the class Route
* @brief Implements the class Route and Point
* @version 0.1
* @date 2022-01-31
*
+76 -8
View File
@@ -1,7 +1,7 @@
/**
* @file route.h
* @author Alexander Klein (alex@kleiax.de)
* @brief Contains a class which hold multiple Points
* @brief Contains the class Point and Route
* @version 0.1
* @date 2022-01-31
*
@@ -30,6 +30,10 @@
*/
class Point{
public:
/**
* @brief Hold the data longitude and latitude
*
*/
struct Coordinates {
double lon;
double lat;
@@ -39,6 +43,10 @@ class Point{
}
};
/**
* @brief The Accuracy is set by the constructor
*
*/
enum PointAccuracy {
none,
fourDigOfCM,
@@ -54,6 +62,9 @@ class Point{
*
* @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);
@@ -62,7 +73,7 @@ class Point{
Point();
/**
* @brief checks if to points are equal
* @brief Checks if to points are equal.
*
* @param rhs
* @return true
@@ -71,16 +82,38 @@ class Point{
bool operator==(const Point& rhs) const;
/**
* @brief Checks if the Point is initalized.
* @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;
@@ -89,6 +122,14 @@ class Point{
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:
@@ -124,32 +165,49 @@ struct RouteInfo{
class Route {
public:
/**
* @brief Construct a new Route object
* @brief Construct a new Route object.
*/
Route();
/**
* @brief Adds a point to the list
* @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
* @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
* @brief Get the next point and set it as target.
*
* @return Point is zero if there are no more Points
* @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();
/**
@@ -158,6 +216,16 @@ class Route {
* @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:
+6 -9
View File
@@ -1,7 +1,7 @@
/**
* @file NTRIPClient.cpp
* @author Alexander Klein (alex@kleiax.de)
* @brief
* @brief Contains the implementation of the class NTRIPClient.
* @version 0.1
* @date 2022-09-18
*
@@ -11,15 +11,8 @@
#include "ntripClient.h"
NTRIPClient::NTRIPClient() {
}
NTRIPClient::~NTRIPClient() {
delete this->ntripClient;
}
void NTRIPClient::init(SFE_UBLOX_GNSS* gps, const char* host, uint16_t port, const char* mountPoint, const char* user, const char* password) {
NTRIPClient::NTRIPClient(SFE_UBLOX_GNSS* gps, const char* host, uint16_t port, const char* mountPoint, const char* user, const char* password) {
this->gps = gps;
strcpy(this->host, host);
this->port = port;
@@ -31,6 +24,10 @@ void NTRIPClient::init(SFE_UBLOX_GNSS* gps, const char* host, uint16_t port, con
this->state = NTRIPClientStates::closeConnection;
}
NTRIPClient::~NTRIPClient() {
delete this->ntripClient;
}
void NTRIPClient::loop() {
if (millis() - this->lastLoopTime < this->delayTime)
return;
+68 -4
View File
@@ -1,3 +1,14 @@
/**
* @file ntripClient.h
* @author Alexander Klein (alex@kleiax.de)
* @brief Contains the class NTRIPClient
* @version 0.1
* @date 2023-02-13
*
* @copyright Copyright (c) 2023
*
*/
#ifndef NTRIP_CLIENT
#define NTRIP_CLIENT
@@ -9,6 +20,10 @@
#include "debugTimes.h"
/**
* @brief States for the state machine.
*
*/
enum NTRIPClientStates {
openConnection,
pushData,
@@ -16,23 +31,72 @@ enum NTRIPClientStates {
wait,
notAvailable
};
/**
* @brief Ntrip Client
*
* This class can connect to a ntrip server to pull correction
* 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:
NTRIPClient();
/**
* @brief Construct a new NTRIPClient object
*
* @param gps 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();
void init(SFE_UBLOX_GNSS* gps, const char* host, uint16_t port, const char* mountPoint, const char* user, const char* password);
/**
* @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();
/**
* @brief Activate or deactivate the location transmission
*
* Some server need the position of the Gnss module to send the
* right correction data.
*
* @param b
*/
void setTransmitLocation(bool b) { this->transmitLocation = b; }
/**
* @brief Activate or deactivate the connection to the server.
*
* @param b
* @return true success
* @return false failure
*/
bool setActivated(bool b);
bool isConnected();
NTRIPClientStates getClientState() { return this->state; }
/**
* @brief Get the Client State object
*
* Returns the state of the State machine
*
* @return NTRIPClientStates
*/
NTRIPClientStates getClientState() { return this->state; }
private:
void pushGPGGA(NMEA_GGA_data_t *nmeaData);
+15
View File
@@ -100,7 +100,22 @@ class Speedometer {
*/
double getSpeed();
/**
* @brief Start calibration
*
* This functions stops the loop. So that steps of one manual wheel turn
* can measured. Call calibrationMeasurementStop to start the loop and get
* the result.
*/
void calibrationMeasurementStart();
/**
* @brief Stop calibration
*
* Start the loop function and read the past steps.
*
* @return uint16_t steps since calibrationMeasurementStart was called
*/
uint16_t calibrationMeasurementStop();
+5
View File
@@ -59,6 +59,11 @@ class DebugTimes {
*/
uint16_t stopConsol(const char* name, uint16_t minTime = 0);
/**
* @brief Sets if the result should be printed.
*
* @param enable
*/
static void setConsolOutput(bool enable);
private: