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.

main.cpp 956B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include <iostream>
  2. #include <lfr.h>
  3. #include <lfr_socket.h>
  4. #include <uart_communication.h>
  5. int main(void)
  6. {
  7. std::cout << "hello central" << std::endl;
  8. const int thresholdBinary = 140;
  9. const int videoHeight = 720;
  10. const int videoWidth = 1280;
  11. const int gaussKernelSize = 11;
  12. std::mutex mutex;
  13. std::cout << "create lfr" << std::endl;
  14. LFR lfr(videoHeight, videoWidth, thresholdBinary, gaussKernelSize, [&](std::exception const &ex)
  15. {
  16. std::unique_lock<std::mutex> lock(mutex);
  17. std::cerr<<"camera exception:"<<ex.what()<<std::endl;
  18. return false;
  19. });
  20. std::cout << "create uart" << std::endl;
  21. LFR_UART uartCommunicator;
  22. std::cout << "create socket" << std::endl;
  23. LFR_Socket socket([&](std::exception const &ex)
  24. {
  25. std::unique_lock<std::mutex> lock(mutex);
  26. std::cerr<<"socket exception:"<<ex.what()<<std::endl;
  27. return false;
  28. });
  29. return 0;
  30. }