功能 | 监听UDP20101++2系列端口读取飞控状态数据 |
---|---|
参数 | |
CopterID | - 飞机ID,用于标识需要控制或监听的特定飞机。 |
GPS Orin latLon (degree) | - GPS原点的经纬度,格式为[纬度,经度],单位为度。用于定义飞行器的初始位置。 |
GPS Orin Altitude (m) | - GPS原点的高度,单位为米。用于设定飞行器的起始高度。 |
Sample Time (s) | - 模块的采样时间,单位为秒。 |
输入 | UDP打包封装的结构体为 |
typedef struct _netDataShortShort { | |
TargetType tg; //目标端口 uint32 | |
int len; //这个长度为传输结构体长度,目前是120 | |
char payload[112];//有效数据负载,存放了outHILStateData | |
}netDataShortShort; | |
输出 | 实际要传输的飞控状态数据的详细结构体如下 |
struct outHILStateData{ // mavlink data forward from Pixhawk | |
uint32_t time_boot_ms; //Timestamp of the message | |
uint32_t copterID; //Copter ID start from 1 | |
int32_t GpsPos[3]; //Estimated GPS position,lat&long: deg*1e7, alt: m*1e3 and up is positive | |
int32_t GpsVel[3]; //Estimated GPS velocity, NED, m/s*1e2->cm/s | |
int32_t gpsHome[3]; //Home GPS position, lat&long: deg*1e7, alt: m*1e3 and up is positive | |
int32_t relative_alt; //alt: m*1e3 and up is positive | |
int32_t hdg; //Course angle, NED,deg*1000, 0~360 | |
int32_t satellites_visible; //GPS Raw data, sum of satellite | |
int32_t fix_type; //GPS Raw data, Fixed type, 3 for fixed (good precision) | |
int32_t resrveInit; //Int, reserve for the future use | |
float AngEular[3]; //Estimated Euler angle, unit: rad/s | |
float localPos[3]; //Estimated locoal position, NED, unit: m | |
float localVel[3]; //Estimated locoal velocity, NED, unit: m/s | |
float pos_horiz_accuracy; //GPS horizontal accuracy, unit: m | |
float pos_vert_accuracy; //GPS vertical accuracy, unit: m | |
float resrveFloat; //float,reserve for the future use | |
} | |
使用示例 | 【安装目录】\RflySimAPIs\4.RflySimModel\0.ApiExps\3.ExtCtrlAPI\1.ExtCtrlAPI-UDP20100\Readme.pdf |
模块实现详解:【安装目录】\RflySimAPIs\4.RflySimModel\0.ApiExps\3.ExtCtrlAPI\Intro.pdf