Update doxygen comments
This commit is contained in:
@@ -40,7 +40,25 @@ class OutputBuf : public std::streambuf {
|
||||
* @param debugMqtt
|
||||
*/
|
||||
OutputBuf(DebugMqtt* debugMqtt = nullptr, BluetoothSerial* serialBT = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Activate the mqtt output
|
||||
*
|
||||
* This only works if the DebugMqtt is set by
|
||||
* setDebugMqtt.
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
void activateMqtt(bool status);
|
||||
|
||||
/**
|
||||
* @brief Active the output over the bluetooth serial consol
|
||||
*
|
||||
* This only works if BluetoothSerial is set by
|
||||
* setSerialBT.
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
void activateSerialBT(bool status);
|
||||
|
||||
void setDebugMqtt(DebugMqtt* debugMqtt);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file menuRoute.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @brief Contains the implementation of the classes MenuActionRoute, MenuRoute and MenuRouteWrapper.
|
||||
* @version 0.1
|
||||
* @date 2022-12-28
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file menuRoute.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @brief Contains a classes to handles routes with the user input.
|
||||
* @version 0.1
|
||||
* @date 2022-12-28
|
||||
*
|
||||
@@ -28,9 +28,25 @@
|
||||
class MenuRoute;
|
||||
typedef void (MenuRoute::*DataFunction)(uint8_t);
|
||||
|
||||
/**
|
||||
* @brief MenuActionWrapper to call DataFunctions
|
||||
*
|
||||
* This class should be used to call importRoute,
|
||||
* exportRoute and clearRoute over the Menu.
|
||||
*/
|
||||
class MenuActionRoute : public MenuActionWrapper {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Action Route object
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction like exportRoute
|
||||
*/
|
||||
MenuActionRoute(MenuRoute* menuRoute, DataFunction dataFunction);
|
||||
|
||||
/**
|
||||
* @brief Runs the given DataFunction
|
||||
*/
|
||||
void action() override;
|
||||
|
||||
private:
|
||||
@@ -38,21 +54,66 @@ class MenuActionRoute : public MenuActionWrapper {
|
||||
DataFunction dataFunction;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Handles routes
|
||||
*
|
||||
* With this menu the user can import, export and delete routes.
|
||||
*/
|
||||
class MenuRoute : public MenuControl {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route object
|
||||
*
|
||||
* @param route
|
||||
*/
|
||||
MenuRoute(Route* route);
|
||||
~MenuRoute();
|
||||
|
||||
/**
|
||||
* @brief Prints the last informations
|
||||
*
|
||||
* On first call this function calls the init function.
|
||||
* On every call this functions call the printMenu function from
|
||||
* the mainMenu of this class.
|
||||
*/
|
||||
void printMenu() override;
|
||||
|
||||
/**
|
||||
* @name User Inputs
|
||||
* @brief Inputs given by the parentMenu
|
||||
*/
|
||||
///@{
|
||||
void down() override;
|
||||
void up() override;
|
||||
void right() override;
|
||||
void left() override;
|
||||
void yes() override;
|
||||
void no() override;
|
||||
///@}
|
||||
|
||||
/**
|
||||
* @brief Import a Route.
|
||||
*
|
||||
* The functions tries to pull the given route id from the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void importRoute(uint8_t routeNumber);
|
||||
|
||||
/**
|
||||
* @brief Export a Route.
|
||||
*
|
||||
* The functions tries to push the current route to the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void exportRoute(uint8_t routeNumber);
|
||||
|
||||
/**
|
||||
* @brief Delete the current Route.
|
||||
*
|
||||
* @param none this param is not be used.
|
||||
*/
|
||||
void clearRoute(uint8_t none);
|
||||
|
||||
private:
|
||||
@@ -65,11 +126,26 @@ class MenuRoute : public MenuControl {
|
||||
bool blockInput = false;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief MenuRouteWrapper to call DataFunctions with numeric user input
|
||||
*
|
||||
*/
|
||||
class MenuRouteWrapper : public MenuIntInputWrapper {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Wrapper object.
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction
|
||||
*/
|
||||
MenuRouteWrapper(MenuRoute* menuRoute, DataFunction dataFunction);
|
||||
|
||||
/**
|
||||
* @brief Calls the given DataFunction.
|
||||
*
|
||||
* @param values The value to be given to the DataFunction.
|
||||
* @param length Number of values, should be 1.
|
||||
*/
|
||||
void action(int16_t* values, uint8_t length) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file menuRoutePoints.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @brief Contains the implementation of the class MenuRoutePoints.
|
||||
* @version 0.1
|
||||
* @date 2022-12-28
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file menuRoutePoints.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @brief Contains a class to print the coordinates of a Route.
|
||||
* @version 0.1
|
||||
* @date 2022-12-28
|
||||
*
|
||||
@@ -16,11 +16,29 @@
|
||||
#include "route.h"
|
||||
#include "menuInformationSites.h"
|
||||
|
||||
/**
|
||||
* @brief Prints coordinates of Route side by side.
|
||||
*
|
||||
*/
|
||||
class MenuRoutePoints : public MenuInformationSites {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Points object
|
||||
*
|
||||
* @param route
|
||||
*/
|
||||
MenuRoutePoints(Route *route);
|
||||
|
||||
/**
|
||||
* @brief Configure the base class MenuInformationSites
|
||||
*
|
||||
* Set the amount of pages.
|
||||
*/
|
||||
void init () override;
|
||||
|
||||
/**
|
||||
* @brief Prints the the coordinates of the current Point.
|
||||
*/
|
||||
void printPage() const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -18,8 +18,19 @@
|
||||
#include "menuInformationSites.h"
|
||||
#include "battery.h"
|
||||
|
||||
/**
|
||||
* @brief Prints information about the current system status.
|
||||
*
|
||||
* The informations are about the batteries, memory and uptime.
|
||||
*/
|
||||
class MenuSysteminformation : public MenuInformationSites {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Systeminformation object
|
||||
*
|
||||
* @param mainBattery
|
||||
* @param gamepad
|
||||
*/
|
||||
MenuSysteminformation(Battery* mainBattery, Ps3Controller* gamepad);
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file menuTestMode.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @brief Contains the implementation of the class MenuTestMode.
|
||||
* @version 0.1
|
||||
* @date 2022-09-08
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file menuTestMode.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @brief Contains a class to use and print information about the TestMode.
|
||||
* @version 0.1
|
||||
* @date 2022-09-08
|
||||
*
|
||||
@@ -17,11 +17,35 @@
|
||||
#include "menuAction.h"
|
||||
#include "menuIntInput.h"
|
||||
|
||||
/**
|
||||
* @brief Interact with the TestMode
|
||||
*
|
||||
*/
|
||||
class MenuTestMode : public MenuDriveMode {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Test Mode object
|
||||
*
|
||||
* @param driveManager
|
||||
*/
|
||||
MenuTestMode(DriveManager *driveManager);
|
||||
~MenuTestMode();
|
||||
void printMenu();
|
||||
|
||||
/**
|
||||
* @brief Prints the last informations
|
||||
*
|
||||
* On first call this function calls the init function.
|
||||
* On every call this functions call the printMenu function from
|
||||
* the mainMenu of this class.
|
||||
*/
|
||||
void printMenu() override;
|
||||
|
||||
/**
|
||||
* @brief Prints maneuver Timer
|
||||
*
|
||||
* Aside from that the function looks if the maneuver is done and
|
||||
* give the user input free.
|
||||
*/
|
||||
void printManeuverTime();
|
||||
|
||||
void down() override;
|
||||
@@ -31,6 +55,10 @@ class MenuTestMode : public MenuDriveMode {
|
||||
void yes() override;
|
||||
void no() override;
|
||||
|
||||
/**
|
||||
* @brief Calls the printManeuverTime function if a maneuver is in process.
|
||||
*
|
||||
*/
|
||||
void update() override;
|
||||
|
||||
TestMode* getTestMode() const { return this->testMode; }
|
||||
|
||||
@@ -30,8 +30,17 @@ class MenuDriveMode : public MenuControl {
|
||||
void down() override {}
|
||||
void up() override {}
|
||||
void right() override {}
|
||||
|
||||
/**
|
||||
* @brief Goes back to the parentMenu.
|
||||
*/
|
||||
void left() override;
|
||||
|
||||
/**
|
||||
* @brief Calls left.
|
||||
*/
|
||||
void no() override;
|
||||
|
||||
void yes() override {}
|
||||
|
||||
virtual void printMenu() = 0;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file testMode.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @brief Contains the implementation of the class TestMode.
|
||||
* @version 0.1
|
||||
* @date 2022-09-08
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file testMode.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @brief Contains a class to test different functions from the rover.
|
||||
* @version 0.1
|
||||
* @date 2022-09-08
|
||||
*
|
||||
@@ -17,8 +17,18 @@
|
||||
#include "navigation.h"
|
||||
#include "driveModi/driveModi.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Test different functions from the rover.
|
||||
*
|
||||
* You can test engine, engine controller, light and speed meter.
|
||||
*/
|
||||
class TestMode : public DriveModi {
|
||||
public:
|
||||
/**
|
||||
* @brief Different states to test the engine
|
||||
*
|
||||
*/
|
||||
enum Maneuver {
|
||||
None,
|
||||
LeftEngine,
|
||||
@@ -28,23 +38,87 @@ class TestMode : public DriveModi {
|
||||
Drive
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Construct a new Test Mode object
|
||||
*
|
||||
* @param moveControl
|
||||
* @param navigation
|
||||
*/
|
||||
TestMode(MoveControl *moveControl, Navigation* navigation);
|
||||
~TestMode();
|
||||
|
||||
/**
|
||||
* @brief Controls the maneuver.
|
||||
*
|
||||
* Needed for actions which take a longer time.
|
||||
* Should be called ever main loop.
|
||||
*/
|
||||
void loop() override;
|
||||
|
||||
/**
|
||||
* @brief Set the speed for the Maneuver Drive
|
||||
*
|
||||
* @param speed m/s / 100
|
||||
*/
|
||||
void setSpeed(int16_t speed);
|
||||
|
||||
/**
|
||||
* @brief Set the rotation speed for the Maneuver Drive
|
||||
*
|
||||
* @param speed rad/s / 100
|
||||
*/
|
||||
void setRotationSpeed(int16_t speed);
|
||||
|
||||
bool drive(int16_t cm = 0, int16_t degree = 0);
|
||||
|
||||
/**
|
||||
* @brief Sets the left Engine to a specific power value.
|
||||
*
|
||||
* This start a maneuver with the given time.
|
||||
*
|
||||
* @param powerPercentage from 0% to 100%
|
||||
* @param seconds time to run the engine
|
||||
* @return true success
|
||||
* @return false failure
|
||||
*/
|
||||
bool leftEngine(int16_t powerPercentage, int16_t seconds);
|
||||
|
||||
/**
|
||||
* @brief See leftEngine
|
||||
*
|
||||
* @param powerPercentage
|
||||
* @param seconds
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool rightEngine(int16_t powerPercentage, int16_t seconds);
|
||||
|
||||
/**
|
||||
* @brief See leftEngine
|
||||
*
|
||||
* @param powerPercentage
|
||||
* @param seconds
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool bothEngine(int16_t powerPercentage, int16_t seconds);
|
||||
|
||||
/**
|
||||
* @brief Abort the running maneuver.
|
||||
*
|
||||
* Stops all movement. This is the only possibility to cancel a maneuver
|
||||
* before the time is up.
|
||||
*/
|
||||
void abortManeuver();
|
||||
|
||||
uint8_t getRemainingManeuverTime();
|
||||
|
||||
/**
|
||||
* @brief Returns true if a maneuver is running
|
||||
*
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool getBusy() const { return this->busy; }
|
||||
Maneuver getManeuver() const { return this->maneuver; }
|
||||
|
||||
|
||||
+21
-21
@@ -50,7 +50,7 @@ MoveControl moveController;
|
||||
DriveManager* driveManager;
|
||||
Menu* main_m;
|
||||
LiquidCrystal_I2C* lcd;
|
||||
DisplayWrapper* lcdWrapper;
|
||||
LcdWrapper* lcdWrapper;
|
||||
OutputBuf* outputBuf;
|
||||
DebugMqtt* debugMqtt = nullptr;
|
||||
Battery* mainBattery;
|
||||
@@ -125,7 +125,7 @@ void setup() {
|
||||
lcd->printf("%c Kleiax-Rover %c", wifiIndicator, wifiIndicator);
|
||||
lcd->setCursor(0, 1);
|
||||
lcd->print("Press PS-Button");
|
||||
lcdWrapper = new DisplayWrapper(lcd);
|
||||
lcdWrapper = new LcdWrapper(lcd);
|
||||
|
||||
makeMenu();
|
||||
|
||||
@@ -280,17 +280,17 @@ void makeMenu() {
|
||||
// Set Menus on LCD
|
||||
main_m->setLcd(lcdWrapper);
|
||||
mode_m->setLcd(lcdWrapper);
|
||||
pid_m->setLcd(lcdWrapper);
|
||||
pidl_m->setLcd(lcdWrapper);
|
||||
pidr_m->setLcd(lcdWrapper);
|
||||
man_m->setLcd(lcdWrapper);
|
||||
cap_m->setLcd(lcdWrapper);
|
||||
auto_m->setLcd(lcdWrapper);
|
||||
testM_m->setLcd(lcdWrapper);
|
||||
gps_m->setLcd(lcdWrapper);
|
||||
sys_m->setLcd(lcdWrapper);
|
||||
rout_m->setLcd(lcdWrapper);
|
||||
test_m->setLcd(lcdWrapper);
|
||||
pid_m->setLcd(LcdWrapper);
|
||||
pidl_m->setLcd(LcdWrapper);
|
||||
pidr_m->setLcd(LcdWrapper);
|
||||
man_m->setLcd(LcdWrapper);
|
||||
cap_m->setLcd(LcdWrapper);
|
||||
auto_m->setLcd(LcdWrapper);
|
||||
testM_m->setLcd(LcdWrapper);
|
||||
gps_m->setLcd(LcdWrapper);
|
||||
sys_m->setLcd(LcdWrapper);
|
||||
rout_m->setLcd(LcdWrapper);
|
||||
test_m->setLcd(LcdWrapper);
|
||||
|
||||
|
||||
// Entry for the main menu
|
||||
@@ -342,17 +342,17 @@ void makeMenu() {
|
||||
}
|
||||
|
||||
void restart(void) {
|
||||
lcdWrapper->clear();
|
||||
lcdWrapper->setCursor(0, 0);
|
||||
lcdWrapper->print("Rebooting ...");
|
||||
LcdWrapper->clear();
|
||||
LcdWrapper->setCursor(0, 0);
|
||||
LcdWrapper->print("Rebooting ...");
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
void disconnectController(void) {
|
||||
disconnectPs3 = true;
|
||||
lcdWrapper->clear();
|
||||
lcdWrapper->setCursor(0, 0);
|
||||
lcdWrapper->print("Controller is");
|
||||
lcdWrapper->setCursor(0, 1);
|
||||
lcdWrapper->print("disconnected.");
|
||||
LcdWrapper->clear();
|
||||
LcdWrapper->setCursor(0, 0);
|
||||
LcdWrapper->print("Controller is");
|
||||
LcdWrapper->setCursor(0, 1);
|
||||
LcdWrapper->print("disconnected.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user