Verify_result.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // Created by zx on 2020/1/10.
  3. //
  4. #ifndef VERIFY_RESULT_H
  5. #define VERIFY_RESULT_H
  6. #include "hardware_limit.pb.h"
  7. #include "Railing.h"
  8. /*
  9. * 硬件限制检验
  10. * 包括旋转矩形是否会碰撞栏杆,旋转矩形中心是否在plc运动范围内
  11. */
  12. class Verify_result
  13. {
  14. public:
  15. #define LIMIT_FRONT_ERROR 0x000001
  16. #define LIMIT_BACK_ERROR 0x000002
  17. #define LIMIT_LEFT_ERROR 0x000004
  18. #define LIMIT_RIGHT_ERROR 0x000008
  19. public:
  20. /*
  21. * 构造函数
  22. * parameter:硬件限制配置参数
  23. */
  24. Verify_result(Hardware_limit::Hardware_parameter parameter);
  25. /*
  26. * 检验硬件限制
  27. * rotate_rect:待检验的旋转矩形
  28. * height:输入高度
  29. * verify_vertex:只检验中心点,不检验顶角
  30. */
  31. Error_manager verify(cv::RotatedRect rotate_rect,float height,bool verify_vertex=true);
  32. /*
  33. * 检验硬件限制
  34. * rotate_rect:待检验的旋转矩形
  35. * height:输入高度
  36. * terminal_id:终端编号,终端对应的左右栏杆号为: id,id+1
  37. * code:返回超界状态(前后左右,按位或运算)
  38. * 主要用于电子围栏,检验栏杆及前后
  39. */
  40. Error_manager verify(cv::RotatedRect rotate_rect,int terminal_id,int& code);
  41. private:
  42. Hardware_limit::Hardware_parameter m_hardware_parameter;
  43. };
  44. #endif //VERIFY_RESULT_H