strategie.h

来自「this the code of bootstation」· C头文件 代码 · 共 62 行

H
62
字号

#ifndef _Strategie_h_
#define _Strategie_h_

#include "global.h"


int Handlung		= Fwd;	//(Fwd)	


//Parameter
//-----------------------------------------------------------------------------------------
const float P_Entf_Fwd	= 0.05;	//PID Parameter Geschwindigkeit
const float I_Entf_Fwd	= 0.02;
const float D_Entf_Fwd	= 0.7;

const float P_Seite	= 20;	//PID Parameter Seitenregelung (Sollwert鋘derung Richtung)
const float I_Seite	= 0.3;
const float D_Seite	= 0;
//-----------------------------------------------------------------------------------------

//Sollwerte und Konstanten
const float Deckenabstand		= 1;	//Abstand zur Decke
const float max_Flughoehe		= 1.4;	//maximale Flugh鰄e
float Stop_vor_Wand				= 1.5;	//Stoppunkt (Entfernung) vor einem Hindernis

const float Entf_soll			= 2.2;	//angestrebter Seitenabstand, wenn (R + L >=4) && (R || L <3)
float Richtungs_Orientierung	= 0;
bit		Hoehen_sprung			= false;//Merker 

//-----------------------------------------------------------------------------------------
//Messwerte
float Entf_vorne[5];			//Entfernungen zu Hindernissen
float Entf_hinten[5];
float Entf_rechts[5];
float Entf_links[5];
float Entf_oben[5];
float Entf_unten[5];
//-----------------------------------------------------------------------------------------

//temp Variablen
float Hoehe_soll_Merker;		//Merker f黵 Hoehensollwert
float e_Entf_Fwd_alt	= 0;
float I_Anteil_Entf_Fwd	= 0;
float e_Seite_alt		= 0;
float I_Anteil_Seite	= 0;
float temp_Entf_stop	= 1;	//Rev stopp (evtl an einem Seitengang)
int Strategie_Sperrzeit = 0;	//wenn !=0 wird die Sollwertberechnung f黵 n Schritte ausgesetzt
bit Seitenweg_gesehen	= false;//true, wenn ein Seitengang entdeckt wurde
bit Dreh_gestartet		= false;

//Funktionen
//-----------------------------------------------------------------------------------------
void Strategie();
void Strategie_Vor();
void Strategie_Dreh();
void Strategie_Ruek();
void Flug_Hoehe();
void PID_Seite(bit Richtung, float Seitenabstand[5], float Seitenabstand_soll);
void temp_init();

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?