292 lines
9.2 KiB
C
292 lines
9.2 KiB
C
/*
|
||
* Header: VZNL_Graphics.h
|
||
* Description:当前文件为伟景智能(Vizum)所研发的EyeCB板提供检测函数接口。
|
||
*
|
||
* Sample:
|
||
* VzNL_BeginDetectLogistics();
|
||
*
|
||
* VzNL_SetLaserStandard();
|
||
*
|
||
* VzNL_EndDetectLogistics();
|
||
* Author: Mjw
|
||
* Date: 2021/02/05
|
||
*/
|
||
|
||
#ifndef __VIZUM_DETECTED_LOGISTICS_HEADER__
|
||
#define __VIZUM_DETECTED_LOGISTICS_HEADER__
|
||
|
||
#include "VZNL_Export.h"
|
||
#include "VZNL_Types.h"
|
||
|
||
/**
|
||
* @brief 获取自动检测结果
|
||
* @param [in] eStatus keLogisticsResultStatus_Begin 开始检测物体
|
||
* keLogisticsResultStatus_Work 检测
|
||
* keLogisticsResultStatus_End 结束本次物体检测
|
||
* @param [in] pResultData
|
||
* keLogisticsResultMask_PointCloud & pResultData->eMask 包含点云数据
|
||
* keLogisticsResultMask_ObjectInfo & pResultData->eMask 包含物体数据
|
||
* keLogisticsResultMask_ColorImage & pResultData->eMask 包含图像数据
|
||
*
|
||
* @param [out] pParam 回调参数
|
||
*/
|
||
typedef int(*VzFunLogisticsResultDataCB)(EVzLogisticsResultStatus eStatus, SVzLogisticsResultData* pResultData, void* pParam);
|
||
|
||
/**
|
||
* @brief 创建物流体积检测函数
|
||
* @param [in] hDevice 设备句柄
|
||
* @return 返回0表示正确
|
||
* @retval 0 表示成功
|
||
* @retval 非0 表示失败,可以使用VzNL_GetErrorInfo获取
|
||
*/
|
||
VZNLAPI int VzNL_BeginDetectLogistics(VZNLHANDLE hDevice);
|
||
|
||
/**
|
||
* @brief 设置矫正需要的检测范围
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] dStartAngle 开始角度
|
||
* @param [in] dEndAngle 结束角度
|
||
* @return 非0 表示失败,可以使用VzNL_GetErrorInfo获取
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsCalibAngleRange(VZNLHANDLE hDevice, double dStartAngle, double dEndAngle);
|
||
|
||
/**
|
||
* @brief 设置矫正时角度的步进
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] dStepAngle 矫正角度步进
|
||
* @return 非0 表示失败,可以使用VzNL_GetErrorInfo获取
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsCalibAngleStep(VZNLHANDLE hDevice, double dStepAngle);
|
||
|
||
/**
|
||
* @brief 物流标定。
|
||
* @param [in] hDevice 设备句柄
|
||
* @return 返回0为正确,失败返回错误码
|
||
*/
|
||
VZNLAPI int VzNL_LogisticsCalibration(VZNLHANDLE hDevice);
|
||
|
||
/**
|
||
* @brief 圆盘标定。
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] pCB 回调函数
|
||
* @param [in] pCBParam 回调参数
|
||
* @return 返回0为正确,失败返回错误码
|
||
*/
|
||
VZNLAPI int VzNL_LogisticsCalibrationEx(VZNLHANDLE hDevice, VzFunLogisticsResultDataCB pCB, void* pCBParam);
|
||
|
||
/**
|
||
* @brief 打断圆盘标定
|
||
* @param [in] hDevice 设备句柄
|
||
*/
|
||
VZNLAPI int VzNL_LogisticsAbortCalibrationEx(VZNLHANDLE hDevice);
|
||
|
||
/**
|
||
* @brief 清除物流标定信息。
|
||
* @return 返回0为正确,失败返回错误码
|
||
*/
|
||
VZNLAPI int VzNL_ClearLogisticsCalibration(VZNLHANDLE hDevice);
|
||
|
||
/**
|
||
* @brief 获取基准平面高度(在标定后进行获取)
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] pdPlaneHeight 基准面高度
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_GetLogisticsBasePlaneHeight(VZNLHANDLE hDevice, double* pdPlaneHeight);
|
||
|
||
/**
|
||
* @brief 眼睛是否标定过
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [out] pbIsCalib 是否在标定状态
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_LogisticsIsCalibration(VZNLHANDLE hDevice, VzBool* pbIsCalib);
|
||
|
||
/**
|
||
* @brief 设置/获取过滤高度
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] dFilterHeight 过滤高度(此高度以下的数据不输出)
|
||
* @return 如果标定过返回VzTrue
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsFilterHeight(VZNLHANDLE hDevice, double dFilterHeight);
|
||
VZNLAPI int VzNL_GetLogisticsFilterHeight(VZNLHANDLE hDevice, double* pdFilterHeight);
|
||
|
||
/**
|
||
* @brief 重置激光线偏移
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] dOffsetValue 偏移: 默认为0.
|
||
* @return 如果标定过返回VzTrue
|
||
*/
|
||
VZNLAPI int VzNL_ResetLogisticsBeginOffsetValue(VZNLHANDLE hDevice, double dOffsetValue);
|
||
|
||
/**
|
||
* @brief 地面长度大于X自动重置
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] dLength 地面长度
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_AutoStopForMaxScanBlockLen(VZNLHANDLE hDevice, double dLength);
|
||
VZNLAPI int VzNL_GetAutoStopForMaxScanBlockLen(VZNLHANDLE hDevice, double* pdLength);
|
||
|
||
/**
|
||
* @brief 偏移总长度大于dLength自动重置
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] dLength 设置阈值
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_AutoResetForXTotleLength(VZNLHANDLE hDevice, double dLength);
|
||
VZNLAPI int VzNL_GetAutoResetForXTotleLength(VZNLHANDLE hDevice, double* pdLength);
|
||
|
||
/**
|
||
* @brief 物体间隔长度为X自动重置
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] dObjectDiff 物体间隔距离
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_AutoResetForObjectInterval(VZNLHANDLE hDevice, double dObjectDiff);
|
||
VZNLAPI int VzNL_GetAutoResetForObjectInterval(VZNLHANDLE hDevice, double* pdObjectDiff);
|
||
|
||
/**
|
||
* @brief 物体间时间长度大于X自动重置
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] dTimeOut 超时时间
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_AutoResetForObjectTimeOut(VZNLHANDLE hDevice, double dTimeOut);
|
||
VZNLAPI int VzNL_GetAutoResetForObjectTimeOut(VZNLHANDLE hDevice, double* pdTimeOut);
|
||
|
||
/**
|
||
* @brief 设置Y标定数据偏移
|
||
* @param [in] hDevice 设备句柄
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsYDelta(VZNLHANDLE hDevice, double dYDelta);
|
||
VZNLAPI int VzNL_GetLogisticsYDelta(VZNLHANDLE hDevice, double* pYDelta);
|
||
|
||
/**
|
||
* @brief 设置/获取物体最小点数
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] nObjMinPoint 物体最小点
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsObjMinPoint(VZNLHANDLE hDevice, unsigned int nObjMinPoint);
|
||
VZNLAPI int VzNL_GetLogisticsObjMinPoint(VZNLHANDLE hDevice, unsigned int* pnObjMinPoint);
|
||
|
||
/**
|
||
* @brief 设置/获取物体分离高度
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] nDeltaHeight 物体分离高度
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsSplitObjDeltaHeight(VZNLHANDLE hDevice, unsigned int nDeltaHeight);
|
||
VZNLAPI int VzNL_GetLogisticsSplitObjDeltaHeight(VZNLHANDLE hDevice, unsigned int* pnDeltaHeight);
|
||
|
||
/**
|
||
* @brief 设置/获取扫描延时时间
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] nScanDelay 扫描延时
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsScanDelay(VZNLHANDLE hDevice, unsigned int nScanDelay);
|
||
VZNLAPI int VzNL_GetLogisticsScanDelay(VZNLHANDLE hDevice, unsigned int* pnScanDelay);
|
||
|
||
/**
|
||
* @brief 设置/获取最大检测激光线个数
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] nScanMaxLine 单个物体最大扫描线数
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsScanMaxLine(VZNLHANDLE hDevice, unsigned int nScanMaxLine);
|
||
VZNLAPI int VzNL_GetLogisticsScanMaxLine(VZNLHANDLE hDevice, unsigned int* pnScanMaxLine);
|
||
|
||
/**
|
||
* @brief 设置传送带速度值
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] dSpeed 速度
|
||
* @return 如果标定过返回VzTrue
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsSpeed(VZNLHANDLE hDevice, double dSpeed);
|
||
VZNLAPI int VzNL_GetLogisticsSpeed(VZNLHANDLE hDevice, double* pdSpeed);
|
||
|
||
/**
|
||
* @brief 设置运行模式
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] eRunMode 运行模式
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsRunMode(VZNLHANDLE hDevice, EVzLogisticsRunMode eRunMode);
|
||
VZNLAPI int VzNL_GetLogisticsRunMode(VZNLHANDLE hDevice, EVzLogisticsRunMode* peRunMode);
|
||
|
||
/**
|
||
* @brief 设置运行模式
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] pCB 回调函数
|
||
* @param [in] pCBParam 回调参数
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_StartLogisticsAutoDetect(VZNLHANDLE hDevice, VzFunLogisticsResultDataCB pCB, void* pCBParam);
|
||
VZNLAPI int VzNL_StopLogisticsAutoDetect(VZNLHANDLE hDevice);
|
||
|
||
/**
|
||
* @brief 生成一个软使能信号 VzNL_SetLogisticsRunMode(hDevice, keLogisticsRunMode_SoftSignal)时使用
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] bRunSignal 创建使能信号(运行/停止)【软使能模式下作用】
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_LogisticsGenRunSignal(VZNLHANDLE hDevice, VzBool bRunSignal);
|
||
|
||
/**
|
||
* @brief 设置/获取物流编码器距离
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] fDistance 脉冲间距 (3.1415926 * 传动轴直径) / 编码器分辨率
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsEncodeDistance(VZNLHANDLE hDevice, float fDistance);
|
||
VZNLAPI int VzNL_GetLogisticsEncodeDistance(VZNLHANDLE hDevice, float* pfDistance);
|
||
|
||
/**
|
||
* @brief 设置/获取包裹触发时的触发模式
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] fDistance 脉冲间距 (3.1415926 * 传动轴直径) / 编码器分辨率
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsPackageSyncType(VZNLHANDLE hDevice, EVzLogisticsPackageSyncType eSyncType);
|
||
VZNLAPI int VzNL_GetLogisticsPackageSyncType(VZNLHANDLE hDevice, EVzLogisticsPackageSyncType* eSyncType);
|
||
|
||
/**
|
||
* @brief 获取包裹位置
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] points 点云数据
|
||
* @param [in] nPointCount 点数
|
||
* @param [in] offsetX 偏移值
|
||
* @param [in] pnErrorCode 错误码
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI SVzNLRect VzNL_GetLogisticsRectFromPoints(VZNLHANDLE hDevice, SVzNL3DPoint* points, unsigned int nPointCount, double offsetX, int* pnErrorCode);
|
||
|
||
/**
|
||
* @brief 启用/禁用分割物体图像模式
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] eClipObjMode 分割物体图像模式
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_EnableLogisticsOutputClipImageMode(VZNLHANDLE hDevice, EVzLogisticsClipObjMode eClipObjMode);
|
||
|
||
/**
|
||
* @brief 启用/禁用分割物体图像模式
|
||
* @param [in] hDevice 设备句柄
|
||
* @param [in] eCodeType 设置检测类型
|
||
* keLogisticsDetectCodeType_QRCode:检测二维码,若检测成功则会在结果SVzLogisticsObjInfo中szQRCode字段输出
|
||
* keLogisticsDetectCodeType_QRCode:检测二维码,若检测成功则会在结果SVzLogisticsObjInfo中szBarCode字段输出
|
||
* @return 返回错误值
|
||
*/
|
||
VZNLAPI int VzNL_SetLogisticsDetectDataType(VZNLHANDLE hDevice, EVzLogisticsDetectCodeType eCodeType);
|
||
|
||
/**
|
||
* @brief 结束物流检测
|
||
* @param [in] hDevice 设备句柄
|
||
* @return 返回点的个数
|
||
*/
|
||
VZNLAPI void VzNL_EndDetectLogistics(VZNLHANDLE hDevice);
|
||
#endif //__VIZUM_DETECTED_LOGISTICS_HEADER__
|