2023-01-31 12:45:08 +01:00

25 lines
719 B
C++

#pragma once
#include <mutex>
#include <vector>
#include <iostream>
class ControlModule
{
private:
mutable std::mutex mtx;
float motors[4]; //LeftFront; RightFront; LeftBack; RightBack
float maxSpeed;
float rotateSpeed;
float moveSideSpeed;
public:
ControlModule(/* args */);
ControlModule(float maxSpeed, float rotateSpeed, float moveSideSpeed);
~ControlModule();
void adjustSpeed();
void moveSide(int imageColumsMiddle, int contourColumsMiddle);
void rotate(int angle);
void unit(); //Brings the max Value to 1.0
void calcSpeeds(int imageColumsMiddle, int contourColumsMiddle, int angle); //Funktion to be called
std::vector<float> readMotors();
};