25 lines
719 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;
2022-12-14 12:30:54 +01:00
float motors[4]; //LeftFront; RightFront; LeftBack; RightBack
2023-01-31 12:45:08 +01:00
float maxSpeed;
2022-12-14 12:30:54 +01:00
float rotateSpeed;
float moveSideSpeed;
2022-11-03 08:54:35 +01:00
public:
ControlModule(/* args */);
2023-01-31 12:45:08 +01:00
ControlModule(float maxSpeed, float rotateSpeed, float 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);
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
2023-01-04 21:47:54 +01:00
std::vector<float> readMotors();
2022-11-03 08:54:35 +01:00
};