142 lines
3.0 KiB
C++
142 lines
3.0 KiB
C++
#ifndef CALIBRESULTWIDGET_H
|
|
#define CALIBRESULTWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QTableWidget>
|
|
#include <QTextEdit>
|
|
#include <QLabel>
|
|
#include <QGroupBox>
|
|
#include <QPushButton>
|
|
|
|
#include "HandEyeCalibTypes.h"
|
|
|
|
/**
|
|
* @brief 标定结果显示控件
|
|
* 显示旋转矩阵、平移向量、欧拉角、误差等信息
|
|
*/
|
|
class CalibResultWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CalibResultWidget(QWidget* parent = nullptr);
|
|
~CalibResultWidget() override;
|
|
|
|
/**
|
|
* @brief 显示标定结果
|
|
*/
|
|
void showCalibResult(const HECCalibResult& result);
|
|
|
|
/**
|
|
* @brief 显示变换结果
|
|
*/
|
|
void showTransformResult(const HECPoint3D& srcPoint,
|
|
const HECPoint3D& dstPoint);
|
|
|
|
/**
|
|
* @brief 显示欧拉角转换结果
|
|
*/
|
|
void showEulerResult(const HECEulerAngles& inputAngles,
|
|
const HECRotationMatrix& R,
|
|
const HECEulerAngles& outputAngles,
|
|
HECEulerOrder order);
|
|
|
|
/**
|
|
* @brief 清除所有结果
|
|
*/
|
|
void clearAll();
|
|
|
|
/**
|
|
* @brief 追加日志
|
|
*/
|
|
void appendLog(const QString& message);
|
|
|
|
/**
|
|
* @brief 获取当前标定结果
|
|
*/
|
|
const HECCalibResult& getCurrentResult() const { return m_currentResult; }
|
|
|
|
/**
|
|
* @brief 是否有有效结果
|
|
*/
|
|
bool hasValidResult() const { return m_hasResult; }
|
|
|
|
private:
|
|
/**
|
|
* @brief 初始化界面
|
|
*/
|
|
void setupUI();
|
|
|
|
/**
|
|
* @brief 创建旋转矩阵显示组
|
|
*/
|
|
QGroupBox* createRotationGroup();
|
|
|
|
/**
|
|
* @brief 创建平移向量显示组
|
|
*/
|
|
QGroupBox* createTranslationGroup();
|
|
|
|
/**
|
|
* @brief 创建欧拉角显示组
|
|
*/
|
|
QGroupBox* createEulerGroup();
|
|
|
|
/**
|
|
* @brief 创建误差显示组
|
|
*/
|
|
QGroupBox* createErrorGroup();
|
|
|
|
/**
|
|
* @brief 创建日志显示组
|
|
*/
|
|
QGroupBox* createLogGroup();
|
|
|
|
/**
|
|
* @brief 更新旋转矩阵显示
|
|
*/
|
|
void updateRotationDisplay(const HECRotationMatrix& R);
|
|
|
|
/**
|
|
* @brief 更新平移向量显示
|
|
*/
|
|
void updateTranslationDisplay(const HECTranslationVector& T);
|
|
|
|
/**
|
|
* @brief 更新欧拉角显示
|
|
*/
|
|
void updateEulerDisplay(const HECEulerAngles& angles);
|
|
|
|
// 旋转矩阵表格
|
|
QTableWidget* m_tableRotation;
|
|
|
|
// 平移向量标签
|
|
QLabel* m_lblTransX;
|
|
QLabel* m_lblTransY;
|
|
QLabel* m_lblTransZ;
|
|
|
|
// 欧拉角标签
|
|
QLabel* m_lblRoll;
|
|
QLabel* m_lblPitch;
|
|
QLabel* m_lblYaw;
|
|
QLabel* m_lblRollDeg;
|
|
QLabel* m_lblPitchDeg;
|
|
QLabel* m_lblYawDeg;
|
|
|
|
// 误差标签
|
|
QLabel* m_lblError;
|
|
|
|
// 质心标签
|
|
QLabel* m_lblCenterEye;
|
|
QLabel* m_lblCenterRobot;
|
|
|
|
// 日志显示
|
|
QTextEdit* m_logEdit;
|
|
|
|
// 当前结果
|
|
HECCalibResult m_currentResult;
|
|
bool m_hasResult;
|
|
};
|
|
|
|
#endif // CALIBRESULTWIDGET_H
|