123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // Created by zx on 2020/1/10.
- //
- #ifndef VERIFY_RESULT_H
- #define VERIFY_RESULT_H
- #include "hardware_limit.pb.h"
- #include "Railing.h"
- /*
- * 硬件限制检验
- * 包括旋转矩形是否会碰撞栏杆,旋转矩形中心是否在plc运动范围内
- */
- class Verify_result
- {
- public:
- #define LIMIT_FRONT_ERROR 0x000001
- #define LIMIT_BACK_ERROR 0x000002
- #define LIMIT_LEFT_ERROR 0x000004
- #define LIMIT_RIGHT_ERROR 0x000008
- public:
- /*
- * 构造函数
- * parameter:硬件限制配置参数
- */
- Verify_result(Hardware_limit::Hardware_parameter parameter);
- /*
- * 检验硬件限制
- * rotate_rect:待检验的旋转矩形
- * height:输入高度
- * verify_vertex:只检验中心点,不检验顶角
- */
- Error_manager verify(cv::RotatedRect rotate_rect,float height,bool verify_vertex=true);
- /*
- * 检验硬件限制
- * rotate_rect:待检验的旋转矩形
- * height:输入高度
- * terminal_id:终端编号,终端对应的左右栏杆号为: id,id+1
- * code:返回超界状态(前后左右,按位或运算)
- * 主要用于电子围栏,检验栏杆及前后
- */
- Error_manager verify(cv::RotatedRect rotate_rect,int terminal_id,int& code);
- private:
- Hardware_limit::Hardware_parameter m_hardware_parameter;
- };
- #endif //VERIFY_RESULT_H
|