135 lines
3.4 KiB
C
135 lines
3.4 KiB
C
#ifndef __VIZUM_HANDEYECONVERT_HEADER__
|
||
#define __VIZUM_HANDEYECONVERT_HEADER__
|
||
|
||
#include "VZNL_Export.h"
|
||
#include "VZNL_Types.h"
|
||
/// @brief
|
||
/// 转换句柄
|
||
typedef void* VZEHPCHANDLE;
|
||
|
||
// 标定方式
|
||
enum EVzHandEyeConvertType
|
||
{
|
||
EVzHandEyeConvertType_Eye_In_Hand = 0, //眼在手上
|
||
EVzHandEyeConvertType_Eye_To_Hand = 1, //眼在手外
|
||
};
|
||
|
||
enum EVzRPYSeqConvertType
|
||
{
|
||
RPYSeqConvertType_S_ZYX,
|
||
RPYSeqConvertType_S_XYZ,
|
||
RPYSeqConvertType_S_XZY,
|
||
RPYSeqConvertType_S_YXZ,
|
||
RPYSeqConvertType_S_YZX,
|
||
RPYSeqConvertType_S_ZXY,
|
||
RPYSeqConvertType_R_XYZ
|
||
};
|
||
|
||
// 机械臂坐标定义
|
||
typedef struct
|
||
{
|
||
double x, y, z, a, b, c;
|
||
}SVzNLRobotPointD;
|
||
|
||
|
||
typedef struct {
|
||
float rx[3];
|
||
float ry[3];
|
||
float rz[3];
|
||
}SVzNLNormal3D;
|
||
|
||
typedef struct {
|
||
SVzNL3DPoint point; //XYZ坐标
|
||
SVzNLNormal3D normal; //法向量
|
||
}SVzNLPCameraPointinfo;
|
||
|
||
/**
|
||
* @brief 初始化算法库
|
||
* @param hDevice 当前设备句柄
|
||
* @param [out] pErrorCode 返回错误码, 为 NULL时,不返回
|
||
* @return 转换句柄
|
||
*/
|
||
VZNLAPI VZEHPCHANDLE VzNL_CreateEyeHandPosConvertHandle(VZNLHANDLE hDevice, int* pErrorCode);
|
||
|
||
/**
|
||
* @brief 释放算法库资源
|
||
* @param hConvertHandle 转换句柄
|
||
* @return 正确返回0, 失败返回其他值
|
||
*/
|
||
VZNLAPI int VzNL_ReleaseEyeHandPosConvert(VZEHPCHANDLE hConvertHandle);
|
||
|
||
/* 三轴标定算法函数接口
|
||
* hConvertHandle 转换句柄
|
||
* pCameraPoint 点数组
|
||
* nCount 点个数,目前仅支持1个点的转换
|
||
* dCalibMatrix 标定矩阵
|
||
* eConvertType 标定方式
|
||
* pRobotPoint 输出的机械臂坐标
|
||
* @return 正确返回0, 失败返回其他值
|
||
*/
|
||
VZNLAPI int VzNL_EyeHandPosConvert3(VZEHPCHANDLE hConvertHandle,
|
||
SVzNL3DPoint* pCameraPoints,
|
||
int nCount,
|
||
double dCalibMatrix[16],
|
||
EVzHandEyeConvertType eConvertType,
|
||
SVzNL3DPoint* pRobotPoint);
|
||
|
||
/* 六轴标定算法函数接口:输入点坐标+三轴矢量
|
||
* hConvertHandle 转换句柄
|
||
* pCameraPoints 相机点数组
|
||
* pRobpose 拍摄时机械臂坐标
|
||
* nCount 点个数,目前仅支持1个点的转换
|
||
* dCalibMatrix 标定矩阵
|
||
* eConvertType 标定方式
|
||
* ePosSeqType 姿态顺序
|
||
* pRobotPoint 输出的机械臂坐标
|
||
* @return 正确返回0, 失败返回其他值
|
||
*/
|
||
VZNLAPI int VzNL_EyeHandPosConvert6WithNormal(VZEHPCHANDLE hConvertHandle,
|
||
SVzNLPCameraPointinfo* pCameraPoints,
|
||
SVzNLRobotPointD* pRobpose,
|
||
int nCount,
|
||
double dCalibMatrix[16],
|
||
EVzHandEyeConvertType eConvertType,
|
||
EVzRPYSeqConvertType ePosSeqType,
|
||
SVzNLRobotPointD* pRobotPoint);
|
||
|
||
/* 六轴标定算法函数接口:输入点坐标+姿态角
|
||
* hConvertHandle 转换句柄
|
||
* pCameraPoints 相机点数组// xyzabc
|
||
* pRobpose 拍摄时机械臂坐标
|
||
* nCount 点个数,目前仅支持1个点的转换
|
||
* dCalibMatrix 标定矩阵
|
||
* eConvertType 标定方式
|
||
* ePosSeqType 姿态顺序
|
||
* pRobotPoint 输出的机械臂坐标
|
||
* @return 正确返回0, 失败返回其他值
|
||
*/
|
||
VZNLAPI int VzNL_EyeHandPosConvert6WithEuler(VZEHPCHANDLE hConvertHandle,
|
||
SVzNLRobotPointD* pCameraPoints,
|
||
SVzNLRobotPointD* pRobpose,
|
||
int nCount,
|
||
double dCalibMatrix[16],
|
||
EVzHandEyeConvertType eConvertType,
|
||
EVzRPYSeqConvertType ePosSeqType,
|
||
SVzNLRobotPointD* pRobotPoint);
|
||
|
||
/**
|
||
* @brief R2RPY 旋转矩阵转RPY角
|
||
* @param hConvertHandle 转换句柄
|
||
* @param R 旋转矩阵3*3
|
||
* @param RPY RPY角,顺序为Roll-Pitch-Yaw. 角度制
|
||
* @return 正确返回0, 失败返回其他值
|
||
*/
|
||
VZNLAPI int VzNL_R2RPY(VZEHPCHANDLE hConvertHandle, double R[9], double RPY[3], const EVzRPYSeqConvertType ePosSeqType);
|
||
|
||
/**
|
||
* @brief R2RPY RPY角转旋转矩阵
|
||
* @param hConvertHandle 转换句柄
|
||
* @param R 旋转矩阵3*3
|
||
* @param RPY RPY角,顺序为Roll-Pitch-Yaw.角度制
|
||
* @return 正确返回0, 失败返回其他值
|
||
*/
|
||
VZNLAPI int VzNL_RPY2R(VZEHPCHANDLE hConvertHandle, double RPY[3], double R[9], const EVzRPYSeqConvertType ePosSeqType);
|
||
|
||
#endif |