Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

control_module.h 812B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <mutex>
  3. #include <vector>
  4. #include <iostream>
  5. #include <cmath>
  6. class ControlModule
  7. {
  8. private:
  9. mutable std::mutex mtx;
  10. double motors[4]; //LeftFront; RightFront; LeftBack; RightBack
  11. double maxSpeed;
  12. double rotateSpeed;
  13. double moveSideSpeed;
  14. public:
  15. ControlModule(/* args */);
  16. ControlModule(double maxSpeed, double rotateSpeed, double moveSideSpeed);
  17. ~ControlModule();
  18. void adjustSpeed();
  19. void moveSide(int imageColumsMiddle, int contourColumsMiddle);
  20. void rotate(double ratio);
  21. void drive(double ratio);
  22. void unit(); //Brings the max Value to 1.0
  23. double ratio(double angle);
  24. void calcSpeeds(int imageColumsMiddle, int contourColumsMiddle, double angle); //Funktion to be called
  25. std::vector<double> readMotors();
  26. };