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: