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 795B

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