25 lines
733 B
C
Raw Normal View History

2022-11-10 17:07:39 +01:00
#pragma once
2023-01-04 21:47:54 +01:00
#include <mutex>
#include <vector>
#include <iostream>
2022-11-10 17:07:39 +01:00
2022-11-03 08:54:35 +01:00
class ControlModule
{
private:
2023-01-04 21:47:54 +01:00
mutable std::mutex mtx;
2023-01-31 21:05:04 +01:00
double motors[4]; //LeftFront; RightFront; LeftBack; RightBack
double maxSpeed;
double rotateSpeed;
double moveSideSpeed;
2022-11-03 08:54:35 +01:00
public:
ControlModule(/* args */);
2023-01-31 21:05:04 +01:00
ControlModule(double maxSpeed, double rotateSpeed, double moveSideSpeed);
2022-11-03 08:54:35 +01:00
~ControlModule();
2023-01-31 12:45:08 +01:00
void adjustSpeed();
2022-12-14 16:14:00 +01:00
void moveSide(int imageColumsMiddle, int contourColumsMiddle);
2023-01-31 21:05:04 +01:00
void rotate(double angle);
2022-12-14 16:14:00 +01:00
void unit(); //Brings the max Value to 1.0
2023-01-31 21:05:04 +01:00
void calcSpeeds(int imageColumsMiddle, int contourColumsMiddle, double angle); //Funktion to be called
std::vector<double> readMotors();
2022-11-03 08:54:35 +01:00
};