2,新增“Apps”; 3,新增“Common”; 4,新增“FileList”; 5,新增“MediaX”; 6,新增“OpenSource”; 7,新增“Samples”; 8,新增“SoftwareBusinessLines”.
196 lines
5.0 KiB
C++
196 lines
5.0 KiB
C++
#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
|