make all possible functions const
This commit is contained in:
@@ -65,18 +65,6 @@ class Autopilot : public ManualControl {
|
||||
*/
|
||||
~Autopilot();
|
||||
|
||||
/**
|
||||
* @brief Calls runAutopilot or ManualControl loop
|
||||
*
|
||||
* This function should be called every main loop. If self
|
||||
* driving is activated the function call run Autopilot. If
|
||||
* the loopDelayMillis is not reached the function returns immediately.
|
||||
*
|
||||
* If self driving is not activated this functions calls the
|
||||
* ManualControl loop additionally.
|
||||
*/
|
||||
void loop();
|
||||
|
||||
void restart();
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,7 +35,7 @@ void CaptureRoute::run() {
|
||||
}
|
||||
}
|
||||
|
||||
double CaptureRoute::getDistanceToLastPoint() {
|
||||
double CaptureRoute::getDistanceToLastPoint() const {
|
||||
if (!this->lastSavedPoint.isInit())
|
||||
return 0;
|
||||
return this->lastSavedPoint.distanceTo(this->navigation->getCurrentPosition());
|
||||
|
||||
@@ -62,7 +62,7 @@ class CaptureRoute : public ManualControl {
|
||||
*
|
||||
* @return double in meters
|
||||
*/
|
||||
double getDistanceToLastPoint();
|
||||
double getDistanceToLastPoint() const;
|
||||
|
||||
/**
|
||||
* @brief Tells if there are new informations to display
|
||||
|
||||
@@ -120,7 +120,7 @@ void TestMode::abortManeuver() {
|
||||
this->abort = true;
|
||||
}
|
||||
|
||||
uint8_t TestMode::getRemainingManeuverTime() {
|
||||
uint8_t TestMode::getRemainingManeuverTime() const {
|
||||
if (busy)
|
||||
return (uint8_t) ((this->maneuverTime - (millis() - this->actionStart)) / 1000);
|
||||
return 0;
|
||||
|
||||
@@ -89,7 +89,7 @@ class TestMode : public DriveModi {
|
||||
*/
|
||||
void abortManeuver();
|
||||
|
||||
uint8_t getRemainingManeuverTime();
|
||||
uint8_t getRemainingManeuverTime() const;
|
||||
|
||||
/**
|
||||
* @brief Returns true if a maneuver is running
|
||||
@@ -99,8 +99,8 @@ class TestMode : public DriveModi {
|
||||
*/
|
||||
bool getBusy() const { return this->busy; }
|
||||
Maneuver getManeuver() const { return this->maneuver; }
|
||||
Speedometer* getSpeedometerLeft() { return this->moveControl->getSpeedometerLeft(); }
|
||||
Speedometer* getSpeedometerRight() { return this->moveControl->getSpeedometerRight(); }
|
||||
Speedometer* getSpeedometerLeft() const { return this->moveControl->getSpeedometerLeft(); }
|
||||
Speedometer* getSpeedometerRight() const { return this->moveControl->getSpeedometerRight(); }
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
|
||||
@@ -84,7 +84,7 @@ class DriveManager : public Component {
|
||||
*
|
||||
* @return Navigation*
|
||||
*/
|
||||
Navigation* getNavigation() {return this->navigation;}
|
||||
Navigation* getNavigation() const {return this->navigation;}
|
||||
|
||||
/**
|
||||
* @brief Get the DriveModi Ptr object
|
||||
@@ -96,14 +96,14 @@ class DriveManager : public Component {
|
||||
* @see getDriveModi
|
||||
* @return DriveModi*
|
||||
*/
|
||||
DriveModi* getDriveModiPtr() { return this->currentModusPtr; }
|
||||
DriveModi* getDriveModiPtr() const { return this->currentModusPtr; }
|
||||
|
||||
/**
|
||||
* @brief Get the DriveModi enum
|
||||
*
|
||||
* @return Modi
|
||||
*/
|
||||
Modi getDriveModi() { return this->currentModus; }
|
||||
Modi getDriveModi() const { return this->currentModus; }
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
|
||||
@@ -34,7 +34,7 @@ class DriveModi : public Component {
|
||||
void setMaxSpeed(double maxForwardSpeed) { maxForwardSpeed = maxForwardSpeed; }
|
||||
void increaseMaxSpeed(double increase = 0.1) { maxForwardSpeed += increase; }
|
||||
void decreaseMaxSpeed(double increase = 0.1) { maxForwardSpeed -= increase; }
|
||||
double getMaxSpeed() { return this->maxForwardSpeed; }
|
||||
double getMaxSpeed() const { return this->maxForwardSpeed; }
|
||||
|
||||
/**
|
||||
* @brief Set the max rotation
|
||||
@@ -44,7 +44,7 @@ class DriveModi : public Component {
|
||||
void setMaxRotation(double maxRotation) { maxRotationSpeed = maxRotation; }
|
||||
void increaseMaxRotation(double increase = 0.1) { maxRotationSpeed += increase; }
|
||||
void decreaseMaxRotation(double increase = 0.1) { maxRotationSpeed -= increase; }
|
||||
double getMaxRotation() { return this->maxRotationSpeed; }
|
||||
double getMaxRotation() const { return this->maxRotationSpeed; }
|
||||
|
||||
protected:
|
||||
MoveControl *moveControl;
|
||||
|
||||
Reference in New Issue
Block a user