91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 27.65MB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-07-15
  • 語言: 其他
  • 標(biāo)簽:

資源簡介

匿名地面站6.5版本傳輸協(xié)議,第六版本可用,包括詳細(xì)的C文件以及頭文件,本人已經(jīng)全部測試完畢可以使用,相關(guān)說明可以查閱本人博客或私聊,如果你下載以后使用出現(xiàn)問題,可私聊解決

資源截圖

代碼片段和文件信息

#include?“ANO_DT.h“
#include?“mpu6050.h“
#include?“flight_control.h“
#include?“24l01.h“
#include?“HCSR04.h“
#include?“usart.h“
#include?“stm32f10x_usart.h“
#include?“kalman.h“
#include?“stmflash.h“
#include?“adc.h“
#include?“debug_para.h“
/////////////////////////////////////////////////////////////////////////////////////
//數(shù)據(jù)拆分宏定義,在發(fā)送大于1字節(jié)的數(shù)據(jù)類型時,比如int16、float等,需要把數(shù)據(jù)拆分成單獨字節(jié)進行發(fā)送
#define?BYTE0(dwTemp)???????(?*(?(char?*)(&dwTemp)????)?)
#define?BYTE1(dwTemp)???????(?*(?(char?*)(&dwTemp)?+?1)?)
#define?BYTE2(dwTemp)???????(?*(?(char?*)(&dwTemp)?+?2)?)
#define?BYTE3(dwTemp)???????(?*(?(char?*)(&dwTemp)?+?3)?)


dt_flag_t?f;????????????//需要發(fā)送數(shù)據(jù)的標(biāo)志
u8?data_to_send[50];????//發(fā)送數(shù)據(jù)緩存
extern?float?motor_duty[4];
extern?struct?PID_parameter?PID_pitch?;??//姿態(tài)角PID
extern?struct?PID_parameter?PID_roll;
extern?struct?PID_parameter?PID_yaw;

extern?struct?PID_parameter?PID_gyro_x;??//角速度PID
extern?struct?PID_parameter?PID_gyro_y;
extern?struct?PID_parameter?PID_gyro_z;

extern?float?accel[3];

extern?struct?PID_parameter?PID_height;??//高度PID

extern?struct?Kalman_data?kalman_accel_x?;?????//三軸的加速度卡爾曼濾波數(shù)據(jù)(從左到右為last_p?Q?R?output)
extern?struct?Kalman_data?kalman_accel_y?;
extern?struct?Kalman_data?kalman_accel_z?;

extern?struct?Attitude_int?offset;?????//四旋翼靜態(tài)的時候6050測得的數(shù)據(jù)
extern?struct?Attitude_float?attitude;???//四旋翼當(dāng)前的姿態(tài)數(shù)據(jù)

extern?float?Power_V;

extern?struct?debug_data?debug;

/////////////////////////////////////////////////////////////////////////////////////
//Data_Exchange函數(shù)處理各種數(shù)據(jù)發(fā)送請求,比如想實現(xiàn)每5ms發(fā)送一次傳感器數(shù)據(jù)至上位機,即在此函數(shù)內(nèi)實現(xiàn)
//此函數(shù)應(yīng)由用戶每1ms調(diào)用一次
void?ANO_DT_Data_Exchange(void)
{
????static?u8?cnt?=?0;
????static?u8?senser_cnt????=?10;
????static?u8?status_cnt????=?15;
????static?u8?motopwm_cnt???=?20;
static?u8?udata_cnt = 25;
????static?u8?power_cnt?????=?50; //計量值用來確定數(shù)據(jù)傳輸頻率
????
????if((cnt?%?senser_cnt)?==?(senser_cnt-1))
????????f.send_senser?=?1;??

????if((cnt?%?status_cnt)?==?(status_cnt-1))
????????f.send_status?=?1;??
????
????if((cnt?%?motopwm_cnt)?==?(motopwm_cnt-1))
????????f.send_motopwm?=?1;?
????
if((cnt?%?udata_cnt)?==?(udata_cnt-1))
f.udata?=1;
????if((cnt?%?power_cnt)?==?(power_cnt-1))
????????f.send_power?=?1; //到達(dá)計數(shù)值,標(biāo)志位置一
????
????cnt++;

/////////////////////////////////////////////////////////////////////////////////////
????if(f.send_status)//傳輸UAV當(dāng)前狀態(tài)、姿態(tài)角、高度
????{
????????f.send_status?=?0;
????????ANO_DT_Send_Status(attitude.roll?attitude.pitch?attitude.yaw?attitude.height21);
????}???
/////////////////////////////////////////////////////////////////////////////////////
????else?if(f.send_senser)//傳輸傳感器數(shù)據(jù)6050和磁力計等數(shù)據(jù)
????{
????????f.send_senser?=?0;
????????ANO_DT_Send_Senser(debug.temp_duty_Kd*100?debug.temp_duty_Kp*100?debug.angleattitude.gyro_xattitude.gyro_yattitude.gyro_zaccel[0]accel[1]accel[2]);
????}???
??else?if(f.udata)
{
f.udata=0;
ANO_DT_Send_Udata(000000000);
}
////////////////////////////////

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1344??2019-04-10?21:43??ANO_DT.h
?????文件????71262208??2018-11-21?00:04??ANO_TC匿名上位機V65_.exe
?????文件???????15907??2019-04-10?22:48??ANO_DT.c

評論

共有 條評論

相關(guān)資源