GrabBag/Tools/CalibView/Inc/CalibDataWidget.h

213 lines
5.1 KiB
C
Raw Normal View History

2026-02-22 00:10:46 +08:00
#ifndef CALIBDATAWIDGET_H
#define CALIBDATAWIDGET_H
#include <QWidget>
#include <QTableWidget>
#include <QPushButton>
#include <QComboBox>
#include <QGroupBox>
#include <QSpinBox>
#include <QDoubleSpinBox>
2026-03-17 22:27:58 +08:00
#include "../../Module/HandEyeCalib/Inc/IHandEyeCalib.h"
2026-02-22 00:10:46 +08:00
#include <QLabel>
#include <vector>
#include "HandEyeCalibTypes.h"
/**
* @brief
* Eye-To-HandEye-In-Hand TCP
*/
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;
2026-03-17 22:27:58 +08:00
/**
* @brief Eye-To-Hand 姿 Park
*/
void getEyeToHandPoseData(std::vector<HECEyeToHandData>& calibData) const;
2026-02-22 00:10:46 +08:00
/**
* @brief Eye-In-Hand
*/
void getEyeInHandData(std::vector<HECEyeInHandData>& calibData) const;
/**
* @brief
*/
HECCalibrationType getCalibType() const;
/**
* @brief (0=EyeToHand, 1=EyeInHand, 2=TCP)
*/
int getCalibTypeIndex() const;
2026-03-17 22:27:58 +08:00
/**
* @brief
*/
HECEulerOrder getEulerOrder() const;
2026-02-22 00:10:46 +08:00
/**
* @brief
*/
void clearAll();
/**
* @brief
*/
void setRobotInput(double x, double y, double z, double rx, double ry, double rz);
/**
* @brief Eye-To-Hand
*/
void setCameraInput(double x, double y, double z, double rx, double ry, double rz);
/**
* @brief TCP
*/
HECTCPCalibData getTCPCalibData() const;
/**
* @brief INI
*/
void saveCalibData(const QString& filePath) const;
/**
* @brief INI
*/
void loadCalibData(const QString& filePath);
signals:
/**
* @brief
*/
void calibTypeChanged(HECCalibrationType type);
/**
* @brief Eye-To-Hand
*/
void requestEyeToHandCalib();
/**
* @brief Eye-In-Hand
*/
void requestEyeInHandCalib();
/**
* @brief TCP
*/
void requestTCPCalib();
private slots:
/**
* @brief
*/
void onCalibTypeChanged(int index);
/**
* @brief TCP 3-DOF / 6-DOF
*/
void onTCPModeChanged(int index);
/**
* @brief TCP
*/
void onTCPAddRow();
/**
* @brief TCP
*/
void onTCPRemoveRow();
private:
/**
* @brief
*/
void setupUI();
/**
2026-03-17 22:27:58 +08:00
* @brief Eye-To-Hand Eye-In-Hand
2026-02-22 00:10:46 +08:00
*/
2026-03-17 22:27:58 +08:00
QWidget* createHandEyeGroup();
2026-02-22 00:10:46 +08:00
/**
* @brief TCP
*/
QWidget* createTCPCalibGroup();
/**
* @brief
*/
void updateTableVisibility();
// 标定模式选择
QComboBox* m_cbCalibType;
2026-03-17 22:27:58 +08:00
// 欧拉角顺序选择
QComboBox* m_cbEulerOrder;
2026-02-22 00:10:46 +08:00
2026-03-17 22:27:58 +08:00
// 手眼标定通用数据表格Eye-To-Hand 和 Eye-In-Hand 共用)
QTableWidget* m_tableHandEye;
QWidget* m_groupHandEye;
2026-02-22 00:10:46 +08:00
2026-03-17 22:27:58 +08:00
// 手眼标定内联按钮
QPushButton* m_btnHandEyeAddRow;
QPushButton* m_btnHandEyeDeleteRow;
QPushButton* m_btnHandEyeCalib;
2026-02-22 00:10:46 +08:00
// 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;
2026-03-17 22:27:58 +08:00
// 手眼标定通用输入框
2026-02-22 00:10:46 +08:00
QDoubleSpinBox* m_inputCamX;
QDoubleSpinBox* m_inputCamY;
QDoubleSpinBox* m_inputCamZ;
2026-03-17 22:27:58 +08:00
QDoubleSpinBox* m_inputCamRoll;
QDoubleSpinBox* m_inputCamPitch;
QDoubleSpinBox* m_inputCamYaw;
QDoubleSpinBox* m_inputRobotX;
QDoubleSpinBox* m_inputRobotY;
QDoubleSpinBox* m_inputRobotZ;
QDoubleSpinBox* m_inputRobotRoll;
QDoubleSpinBox* m_inputRobotPitch;
QDoubleSpinBox* m_inputRobotYaw;
QPushButton* m_btnHandEyeAddInput;
2026-02-22 00:10:46 +08:00
// TCP 输入框
QDoubleSpinBox* m_inputTcpX;
QDoubleSpinBox* m_inputTcpY;
QDoubleSpinBox* m_inputTcpZ;
QDoubleSpinBox* m_inputTcpRx;
QDoubleSpinBox* m_inputTcpRy;
QDoubleSpinBox* m_inputTcpRz;
QPushButton* m_btnTcpAddInput;
2026-03-17 22:27:58 +08:00
// 存储加载的标定板姿态信息(用于 Park 方法)
std::vector<std::array<double, 3>> m_boardPoseData; // 每行存储 roll, pitch, yaw (弧度)
2026-02-22 00:10:46 +08:00
};
#endif // CALIBDATAWIDGET_H