2026-02-04 22:21:32 +08:00
|
|
|
|
#ifndef CALIBDATAWIDGET_H
|
|
|
|
|
|
#define CALIBDATAWIDGET_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
#include <QTableWidget>
|
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
|
#include <QGroupBox>
|
|
|
|
|
|
#include <QSpinBox>
|
|
|
|
|
|
#include <QDoubleSpinBox>
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
|
|
#include "HandEyeCalibTypes.h"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 标定数据输入控件
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* 支持 Eye-To-Hand、Eye-In-Hand 和 TCP 三种模式的数据输入
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
|
|
|
|
|
class CalibDataWidget : public QWidget
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
explicit CalibDataWidget(QWidget* parent = nullptr);
|
|
|
|
|
|
~CalibDataWidget() override;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 获取 Eye-To-Hand 标定数据
|
|
|
|
|
|
*/
|
|
|
|
|
|
void getEyeToHandData(std::vector<HECPoint3D>& eyePoints,
|
|
|
|
|
|
std::vector<HECPoint3D>& robotPoints) const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 获取 Eye-In-Hand 标定数据
|
|
|
|
|
|
*/
|
|
|
|
|
|
void getEyeInHandData(std::vector<HECEyeInHandData>& calibData) const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 获取当前标定模式
|
|
|
|
|
|
*/
|
|
|
|
|
|
HECCalibrationType getCalibType() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 清除所有数据
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void clearAll();
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 供外部设置机械臂数据到输入框(根据当前模式自动填充)
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void setRobotInput(double x, double y, double z, double rx, double ry, double rz);
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 供外部设置相机数据到输入框(Eye-To-Hand 模式)
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void setCameraInput(double x, double y, double z, double rx, double ry, double rz);
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 获取 TCP 标定输入数据
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
HECTCPCalibData getTCPCalibData() const;
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
2026-02-18 15:11:41 +08:00
|
|
|
|
signals:
|
2026-02-04 22:21:32 +08:00
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 标定模式改变信号
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void calibTypeChanged(HECCalibrationType type);
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 请求 Eye-To-Hand 标定
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void requestEyeToHandCalib();
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 请求 Eye-In-Hand 标定
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void requestEyeInHandCalib();
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 请求 TCP 标定
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void requestTCPCalib();
|
|
|
|
|
|
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 标定模式切换
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void onCalibTypeChanged(int index);
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief TCP 模式切换(3-DOF / 6-DOF)
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void onTCPModeChanged(int index);
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief TCP 添加行
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
void onTCPAddRow();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief TCP 删除行
|
|
|
|
|
|
*/
|
|
|
|
|
|
void onTCPRemoveRow();
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 初始化界面
|
|
|
|
|
|
*/
|
|
|
|
|
|
void setupUI();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 创建 Eye-To-Hand 数据表格
|
|
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
QWidget* createEyeToHandGroup();
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 创建 Eye-In-Hand 数据表格
|
|
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
QWidget* createEyeInHandGroup();
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2026-02-18 15:11:41 +08:00
|
|
|
|
* @brief 创建 TCP 标定数据组
|
2026-02-04 22:21:32 +08:00
|
|
|
|
*/
|
2026-02-18 15:11:41 +08:00
|
|
|
|
QWidget* createTCPCalibGroup();
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @brief 更新表格显示
|
|
|
|
|
|
*/
|
|
|
|
|
|
void updateTableVisibility();
|
|
|
|
|
|
|
|
|
|
|
|
// 标定模式选择
|
|
|
|
|
|
QComboBox* m_cbCalibType;
|
|
|
|
|
|
|
|
|
|
|
|
// Eye-To-Hand 数据表格
|
|
|
|
|
|
QTableWidget* m_tableEyeToHand;
|
2026-02-18 15:11:41 +08:00
|
|
|
|
QWidget* m_groupEyeToHand;
|
2026-02-04 22:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
// Eye-In-Hand 数据表格
|
|
|
|
|
|
QTableWidget* m_tableEyeInHand;
|
2026-02-18 15:11:41 +08:00
|
|
|
|
QWidget* m_groupEyeInHand;
|
|
|
|
|
|
|
|
|
|
|
|
// Eye-To-Hand 内联按钮
|
|
|
|
|
|
QPushButton* m_btnEyeToHandAddRow;
|
|
|
|
|
|
QPushButton* m_btnEyeToHandDeleteRow;
|
|
|
|
|
|
QPushButton* m_btnEyeToHandCalib;
|
|
|
|
|
|
|
|
|
|
|
|
// Eye-In-Hand 内联按钮
|
|
|
|
|
|
QPushButton* m_btnEyeInHandAddRow;
|
|
|
|
|
|
QPushButton* m_btnEyeInHandDeleteRow;
|
|
|
|
|
|
QPushButton* m_btnEyeInHandCalib;
|
|
|
|
|
|
|
|
|
|
|
|
// TCP 标定相关
|
|
|
|
|
|
QWidget* m_groupTCPCalib;
|
|
|
|
|
|
QTableWidget* m_tableTCP;
|
|
|
|
|
|
QComboBox* m_tcpModeCombo;
|
|
|
|
|
|
QComboBox* m_tcpEulerOrderCombo;
|
|
|
|
|
|
QSpinBox* m_tcpRefPoseIndex;
|
|
|
|
|
|
QDoubleSpinBox* m_tcpWorldRx;
|
|
|
|
|
|
QDoubleSpinBox* m_tcpWorldRy;
|
|
|
|
|
|
QDoubleSpinBox* m_tcpWorldRz;
|
|
|
|
|
|
QGroupBox* m_tcpOrientationGroup;
|
|
|
|
|
|
QPushButton* m_tcpAddRowBtn;
|
|
|
|
|
|
QPushButton* m_tcpRemoveRowBtn;
|
|
|
|
|
|
QPushButton* m_btnTCPCalib;
|
|
|
|
|
|
|
|
|
|
|
|
// Eye-To-Hand 输入框
|
|
|
|
|
|
QDoubleSpinBox* m_inputEyeX;
|
|
|
|
|
|
QDoubleSpinBox* m_inputEyeY;
|
|
|
|
|
|
QDoubleSpinBox* m_inputEyeZ;
|
|
|
|
|
|
QDoubleSpinBox* m_inputRobotX;
|
|
|
|
|
|
QDoubleSpinBox* m_inputRobotY;
|
|
|
|
|
|
QDoubleSpinBox* m_inputRobotZ;
|
|
|
|
|
|
QPushButton* m_btnEyeToHandAddInput;
|
|
|
|
|
|
|
|
|
|
|
|
// Eye-In-Hand 输入框
|
|
|
|
|
|
QDoubleSpinBox* m_inputEndX;
|
|
|
|
|
|
QDoubleSpinBox* m_inputEndY;
|
|
|
|
|
|
QDoubleSpinBox* m_inputEndZ;
|
|
|
|
|
|
QDoubleSpinBox* m_inputEndRoll;
|
|
|
|
|
|
QDoubleSpinBox* m_inputEndPitch;
|
|
|
|
|
|
QDoubleSpinBox* m_inputEndYaw;
|
|
|
|
|
|
QDoubleSpinBox* m_inputCamX;
|
|
|
|
|
|
QDoubleSpinBox* m_inputCamY;
|
|
|
|
|
|
QDoubleSpinBox* m_inputCamZ;
|
|
|
|
|
|
QPushButton* m_btnEyeInHandAddInput;
|
|
|
|
|
|
|
|
|
|
|
|
// TCP 输入框
|
|
|
|
|
|
QDoubleSpinBox* m_inputTcpX;
|
|
|
|
|
|
QDoubleSpinBox* m_inputTcpY;
|
|
|
|
|
|
QDoubleSpinBox* m_inputTcpZ;
|
|
|
|
|
|
QDoubleSpinBox* m_inputTcpRx;
|
|
|
|
|
|
QDoubleSpinBox* m_inputTcpRy;
|
|
|
|
|
|
QDoubleSpinBox* m_inputTcpRz;
|
|
|
|
|
|
QPushButton* m_btnTcpAddInput;
|
2026-02-04 22:21:32 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // CALIBDATAWIDGET_H
|