mirror of https://github.com/ArduPilot/ardupilot
uncrustify libraries/AP_LeadFilter/examples/AP_LeadFilter/AP_LeadFilter.pde
This commit is contained in:
parent
ad51ac5e11
commit
966c0a0d1c
|
@ -1,19 +1,19 @@
|
||||||
/*
|
/*
|
||||||
Example of AP Lead_Filter library.
|
* Example of AP Lead_Filter library.
|
||||||
Code by Jason Short. 2010
|
* Code by Jason Short. 2010
|
||||||
DIYDrones.com
|
* DIYDrones.com
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <FastSerial.h>
|
#include <FastSerial.h>
|
||||||
#include <AP_Common.h> // ArduPilot Mega Common Library
|
#include <AP_Common.h> // ArduPilot Mega Common Library
|
||||||
#include <Arduino_Mega_ISR_Registry.h>
|
#include <Arduino_Mega_ISR_Registry.h>
|
||||||
#include <AP_Math.h> // ArduPilot Mega Vector/Matrix math Library
|
#include <AP_Math.h> // ArduPilot Mega Vector/Matrix math Library
|
||||||
#include <AP_LeadFilter.h> // GPS Lead filter
|
#include <AP_LeadFilter.h> // GPS Lead filter
|
||||||
|
|
||||||
// define APM1 or APM2
|
// define APM1 or APM2
|
||||||
#define APM_HARDWARE_APM1 1
|
#define APM_HARDWARE_APM1 1
|
||||||
#define APM_HARDWARE_APM2 2
|
#define APM_HARDWARE_APM2 2
|
||||||
|
|
||||||
// set your hardware type here
|
// set your hardware type here
|
||||||
#define CONFIG_APM_HARDWARE APM_HARDWARE_APM2
|
#define CONFIG_APM_HARDWARE APM_HARDWARE_APM2
|
||||||
|
@ -36,22 +36,22 @@ FastSerialPort3(Serial3); // Telemetry port
|
||||||
// RC Hardware
|
// RC Hardware
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
#if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2
|
#if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2
|
||||||
APM_RC_APM2 APM_RC;
|
APM_RC_APM2 APM_RC;
|
||||||
#else
|
#else
|
||||||
APM_RC_APM1 APM_RC;
|
APM_RC_APM1 APM_RC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AP_LeadFilter xLeadFilter; // GPS lag filter
|
AP_LeadFilter xLeadFilter; // GPS lag filter
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
Serial.println("ArduPilot RC Channel test");
|
Serial.println("ArduPilot RC Channel test");
|
||||||
|
|
||||||
delay(500);
|
delay(500);
|
||||||
|
|
||||||
int32_t temp = xLeadFilter.get_position(0, 100);
|
int32_t temp = xLeadFilter.get_position(0, 100);
|
||||||
Serial.printf("temp %ld \n", temp);
|
Serial.printf("temp %ld \n", temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
|
Loading…
Reference in New Issue