Files
chenzhen 222dda1e43 1,新增“App_ThermalImageSystem”;
2,新增“Apps”;
3,新增“Common”;
4,新增“FileList”;
5,新增“MediaX”;
6,新增“OpenSource”;
7,新增“Samples”;
8,新增“SoftwareBusinessLines”.
2026-02-14 23:03:23 +08:00

196 lines
5.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef GDUFLYATTITUDEINFO_H
#define GDUFLYATTITUDEINFO_H
#include <QObject>
#include "GDUModule/glink/glink_m/glink_m.h"
#include "GDUModule/glink/glink_np/glink_np.h"
enum DroneConnState {
DroneConn_Sucess, //Success:连接成功
DroneConn_None, //None:是没有连接上
DroneConn_MoreOne //MoreOne:多个连接
};
class GDUFlightInfo : public QObject
{
Q_OBJECT
public:
explicit GDUFlightInfo(QObject *parent = nullptr);
DroneConnState drone_connect_state = DroneConn_None;
/*
* 偏移地址byte0 - byte3
* 格式uint32
* 获取无人机姿态的时间戳单位ms
*/
Q_PROPERTY(long attitude_timestamp READ attitude_timestamp NOTIFY attitudeInfoNotify)
long attitude_timestamp(){
return attitudeInfo->timestamp;
}
/*
* 偏移地址byte4 - byte7
* 格式float
* 获取陀螺数据:X轴单位deg/s
*/
Q_PROPERTY(float top_x READ top_x NOTIFY attitudeInfoNotify)
float top_x(){
return attitudeInfo->top_x;
}
/*
* 偏移地址byte8 - byte11
* 格式float
* 获取陀螺数据:Y轴单位deg/s
*/
Q_PROPERTY(float top_y READ top_y NOTIFY attitudeInfoNotify)
float top_y(){
return attitudeInfo->top_y;
}
/*
* 偏移地址byte12 - byte15
* 格式float
* 获取陀螺数据:Z轴单位deg/s
*/
Q_PROPERTY(float top_z READ top_z NOTIFY attitudeInfoNotify)
float top_z(){
return attitudeInfo->top_z;
}
/*
* 偏移地址byte16 - byte19
* 格式float
* 加速度计数据:X轴单位deg/s
*/
Q_PROPERTY(float a_x READ a_x NOTIFY attitudeInfoNotify)
float a_x(){
return attitudeInfo->a_x;
}
/*
* 偏移地址byte20 - byte23
* 格式float
* 加速度计数据:Y轴单位m/s2
*/
Q_PROPERTY(float a_y READ a_y NOTIFY attitudeInfoNotify)
float a_y(){
return attitudeInfo->a_y;
}
/*
* 偏移地址byte24 - byte27
* 格式float
* 加速度计数据:Z轴单位m/s2
*/
Q_PROPERTY(float a_z READ a_z NOTIFY attitudeInfoNotify)
float a_z(){
return attitudeInfo->a_z;
}
/*
* 偏移地址byte28 - byte29
* 格式int16
* 航向角单位deg
*/
Q_PROPERTY(short course READ course NOTIFY attitudeInfoNotify)
short course(){
return attitudeInfo->course;
}
/*
* 偏移地址byte30 - byte31
* 格式int16
* 横滚角单位deg
*/
Q_PROPERTY(short roll READ roll NOTIFY attitudeInfoNotify)
short roll(){
return attitudeInfo->roll;
}
/*
* 偏移地址byte32 - byte33
* 格式int16
* 俯仰角单位deg
*/
Q_PROPERTY(short pitch READ pitch NOTIFY attitudeInfoNotify)
short pitch(){
return attitudeInfo->pitch;
}
/*
* 偏移地址byte0 - byte3
* 格式uint32
* 获取无人机速度的时间戳单位ms
*/
Q_PROPERTY(long speed_timestamp READ speed_timestamp NOTIFY speedInfoNotify)
long speed_timestamp(){
return speedInfo->timestamp;
}
/*
* 偏移地址byte4 - byte5
* 格式int16
* 北向速度单位cm/s
*/
Q_PROPERTY(short northSpeed READ northSpeed NOTIFY speedInfoNotify)
short northSpeed(){
return speedInfo->northSpeed;
}
/*
* 偏移地址byte6 - byte7
* 格式int16
* 东向速度单位cm/s
*/
Q_PROPERTY(short eastSpeed READ eastSpeed NOTIFY speedInfoNotify)
short eastSpeed(){
return speedInfo->eastSpeed;
}
/*
* 偏移地址byte8 - byte9
* 格式int16
* 机头速度单位cm/s
*/
Q_PROPERTY(short headSpeed READ headSpeed NOTIFY speedInfoNotify)
short headSpeed(){
return speedInfo->headSpeed;
}
/*
* 偏移地址byte10 - byte11
* 格式int16
* 右向速度单位cm/s
*/
Q_PROPERTY(short rightSpeed READ rightSpeed NOTIFY speedInfoNotify)
short rightSpeed(){
return speedInfo->rightSpeed;
}
/*
* 偏移地址byte12 - byte13
* 格式int16
* 垂直速度单位cm/s
*/
Q_PROPERTY(short verticalSpeed READ verticalSpeed NOTIFY speedInfoNotify)
short verticalSpeed(){
return speedInfo->verticalSpeed;
}
//飞机姿态信息
glink_m_aircraft_fc_attitudeinfo_t *attitudeInfo = glink_m_aircraft_fc_attitudeinfo_createEmptyInfo();
//飞机速度信息
glink_m_aircraft_fc_speedinfo_t *speedInfo = glink_m_aircraft_fc_speedinfo_createEmptyInfo();
//更新姿态信息
void updateAttitudeInfo(){
attitudeInfoNotify();
}
void updateSpeedInfo(){
speedInfoNotify();
}
void receiveFlyAttitudeInfo(QByteArray frameBytes);
signals:
void attitudeInfoNotify();
void speedInfoNotify();
public slots:
};
#endif // GDUFLYATTITUDEINFO_H