driveManager gets now the object

This commit is contained in:
2023-09-04 15:25:56 +02:00
parent 6a76470f45
commit befbd898cc
23 changed files with 63 additions and 156 deletions
+2 -3
View File
@@ -26,12 +26,11 @@ void DirectionChangeSignal::action() {
}
Autopilot::Autopilot(DriveModiParams params, Navigation* navigation)
: ManualControl(params) {
Autopilot::Autopilot() {
this->setInputMode(ManualControl::InputMode::Digital);
this->directionChangeSignal = new DirectionChangeSignal(this);
this->setDirectionChangeCallback(this->directionChangeSignal);
this->navigation = navigation;
this->navigation = new Navigation(this->sensorData);
this->init();
}
+2 -1
View File
@@ -47,7 +47,7 @@ class Autopilot : public ManualControl {
* @param moveControl for ManualControl
* @param navigation for route instructions
*/
Autopilot(DriveModiParams params, Navigation* navigation);
Autopilot();
/**
* @brief Destroy the Autopilot object
@@ -78,6 +78,7 @@ class Autopilot : public ManualControl {
* @return State
*/
State getState() const { return this->state; }
Navigation* getNavigation() const { return this->navigation; }
/**
* @brief Tells if there are new informations to display
@@ -11,7 +11,6 @@
#include "calibrateCompassM.h"
CalibrateCompassM::CalibrateCompassM(DriveModiParams params) : ManualControl(params) {}
void CalibrateCompassM::setCalibrateCompass(CalibrateCompass *caliCompass) {
if (caliCompass) {
@@ -18,8 +18,6 @@
class CalibrateCompassM : public ManualControl {
public:
CalibrateCompassM(DriveModiParams params);
void setCalibrateCompass(CalibrateCompass* caliCompass = nullptr);
private:
@@ -11,9 +11,8 @@
#include "driveModi/Modi/CaptureRoute/captureRoute.h"
CaptureRoute::CaptureRoute(DriveModiParams params, Navigation* navigation)
: ManualControl(params) {
this->navigation = navigation;
CaptureRoute::CaptureRoute() {
this->navigation = new Navigation(this->sensorData);
this->navigation->getRoute()->clear();
this->sensorData->getNtripClient()->setAutoReconnect(true);
this->routeInfo = navigation->getRouteInfo();
@@ -27,13 +27,7 @@
*/
class CaptureRoute : public ManualControl {
public:
/**
* @brief Construct a new Capture Route object
*
* @param moveControl for ManualControl
* @param navigation to add Points
*/
CaptureRoute(DriveModiParams params, Navigation* navigation);
CaptureRoute();
/**
* @brief Destroy the Capture Route object
@@ -56,6 +50,7 @@ class CaptureRoute : public ManualControl {
*/
RouteInfo getRouteInfo() const { return this->routeInfo; }
Navigation::Status getLastStatus() const { return this->status; }
Navigation* getNavigation() const { return this->navigation; }
/**
* @brief Get the distance to the last saved oint
@@ -33,8 +33,6 @@ class ManualControl : public DriveModi {
Digital
};
ManualControl(DriveModiParams params) : DriveModi(params){};
void switchInputMode();
void setInputMode(InputMode mode) { this->inputMode = mode; }
InputMode getInputMode() const { return this->inputMode; }
-9
View File
@@ -10,15 +10,6 @@
*/
#include "testMode.h"
TestMode::TestMode(DriveModiParams params, Navigation* navigation)
: DriveModi(params) {
this->navigation = navigation;
}
TestMode::~TestMode() {
this->moveControl->setDrivingStatus(MoveControl::Status::Stop);
}
void TestMode::run() {
if (this->maneuver == Maneuver::Turn) {
uint16_t delta = abs(this->azimuth - this->getSensorData()->getRealAzimuth());
-9
View File
@@ -38,15 +38,6 @@ class TestMode : public DriveModi {
Drive
};
/**
* @brief Construct a new Test Mode object
*
* @param moveControl
* @param navigation
*/
TestMode(DriveModiParams params, Navigation* navigation);
~TestMode();
bool drive(int16_t cm = 0, int16_t degree = 0);
/**