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

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