56 lines
1.6 KiB
C++
56 lines
1.6 KiB
C++
/**
|
|
* @file driveModi.h
|
|
* @author Alexander Klein (alex@kleiax.de)
|
|
* @brief Contains a virtual class for all Modi
|
|
* @version 0.1
|
|
* @date 2021-12-14
|
|
*
|
|
* @copyright Copyright (c) 2021
|
|
*
|
|
*/
|
|
|
|
#ifndef DRIVEMODI_H
|
|
#define DRIVEMODI_H
|
|
|
|
#include "component.h"
|
|
#include "moveControl.h"
|
|
|
|
/**
|
|
* @brief Baseclass to build DriveModi
|
|
*
|
|
* This class must be inherited by other classes which want to be
|
|
* act as a DriveModi, because the DriveModi structure uses polymorphism.
|
|
*/
|
|
class DriveModi : public Component {
|
|
public:
|
|
DriveModi(MoveControl* moveControl);
|
|
virtual ~DriveModi();
|
|
|
|
/**
|
|
* @brief Set the max speed
|
|
*
|
|
* @param maxSpeed in m/s
|
|
*/
|
|
void setMaxSpeed(double maxForwardSpeed) { maxForwardSpeed = maxForwardSpeed; }
|
|
void increaseMaxSpeed(double increase = 0.1) { maxForwardSpeed += increase; }
|
|
void decreaseMaxSpeed(double increase = 0.1) { maxForwardSpeed -= increase; }
|
|
double getMaxSpeed() const { return this->maxForwardSpeed; }
|
|
|
|
/**
|
|
* @brief Set the max rotation
|
|
*
|
|
* @param maxRotation in rad/s (maybe)
|
|
*/
|
|
void setMaxRotation(double maxRotation) { maxRotationSpeed = maxRotation; }
|
|
void increaseMaxRotation(double increase = 0.1) { maxRotationSpeed += increase; }
|
|
void decreaseMaxRotation(double increase = 0.1) { maxRotationSpeed -= increase; }
|
|
double getMaxRotation() const { return this->maxRotationSpeed; }
|
|
|
|
protected:
|
|
MoveControl *moveControl;
|
|
double maxForwardSpeed = 1;
|
|
double maxRotationSpeed = 7;
|
|
|
|
};
|
|
#endif // DRIVEMODI_H
|