mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AP_Motors, AP_RangeFinder, Filter: fixes to example sketches
This commit is contained in:
parent
56f88821e9
commit
50a4838879
@ -42,7 +42,7 @@ Arduino_Mega_ISR_Registry isr_registry;
|
|||||||
//APM_RC_APM1 APM_RC;
|
//APM_RC_APM1 APM_RC;
|
||||||
APM_RC_APM2 APM_RC;
|
APM_RC_APM2 APM_RC;
|
||||||
|
|
||||||
RC_Channel rc1, rc2, rc3, rc4;
|
RC_Channel rc1(CH_1), rc2(CH_2), rc3(CH_3), rc4(CH_4);
|
||||||
|
|
||||||
// uncomment the row below depending upon what frame you are using
|
// uncomment the row below depending upon what frame you are using
|
||||||
//AP_MotorsTri motors(AP_MOTORS_APM1, &APM_RC, &rc1, &rc2, &rc3, &rc4);
|
//AP_MotorsTri motors(AP_MOTORS_APM1, &APM_RC, &rc1, &rc2, &rc3, &rc4);
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <AP_ADC.h> // ArduPilot Mega Analog to Digital Converter Library
|
#include <AP_ADC.h> // ArduPilot Mega Analog to Digital Converter Library
|
||||||
#include <AP_AnalogSource.h>
|
#include <AP_AnalogSource.h>
|
||||||
#include <ModeFilter.h> // mode filter
|
#include <ModeFilter.h> // mode filter
|
||||||
|
#include <AP_Buffer.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Serial ports
|
// Serial ports
|
||||||
@ -57,7 +58,6 @@ void setup()
|
|||||||
timer_scheduler.init(&isr_registry);
|
timer_scheduler.init(&isr_registry);
|
||||||
|
|
||||||
#ifdef USE_ADC_ADS7844
|
#ifdef USE_ADC_ADS7844
|
||||||
adc.filter_result = true;
|
|
||||||
adc.Init(&timer_scheduler); // APM ADC initialization
|
adc.Init(&timer_scheduler); // APM ADC initialization
|
||||||
aRF.calculate_scaler(SONAR_TYPE,3.3); // setup scaling for sonar
|
aRF.calculate_scaler(SONAR_TYPE,3.3); // setup scaling for sonar
|
||||||
#else
|
#else
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <AP_Math.h>
|
#include <AP_Math.h>
|
||||||
#include <Filter.h>
|
#include <Filter.h>
|
||||||
#include <DerivativeFilter.h>
|
#include <DerivativeFilter.h>
|
||||||
|
#include <AP_Buffer.h>
|
||||||
|
|
||||||
#ifdef DESKTOP_BUILD
|
#ifdef DESKTOP_BUILD
|
||||||
// all of this is needed to build with SITL
|
// all of this is needed to build with SITL
|
||||||
@ -24,6 +25,7 @@
|
|||||||
#include <I2C.h>
|
#include <I2C.h>
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <AP_Declination.h>
|
#include <AP_Declination.h>
|
||||||
|
#include <AP_Semaphore.h>
|
||||||
Arduino_Mega_ISR_Registry isr_registry;
|
Arduino_Mega_ISR_Registry isr_registry;
|
||||||
AP_Baro_BMP085_HIL barometer;
|
AP_Baro_BMP085_HIL barometer;
|
||||||
AP_Compass_HIL compass;
|
AP_Compass_HIL compass;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <Filter.h> // Filter library
|
#include <Filter.h> // Filter library
|
||||||
#include <ModeFilter.h> // ModeFilter class (inherits from Filter class)
|
#include <ModeFilter.h> // ModeFilter class (inherits from Filter class)
|
||||||
#include <AverageFilter.h> // AverageFilter class (inherits from Filter class)
|
#include <AverageFilter.h> // AverageFilter class (inherits from Filter class)
|
||||||
|
#include <AP_Buffer.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Serial ports
|
// Serial ports
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <AP_Math.h> // ArduPilot Mega Vector/Matrix math Library
|
#include <AP_Math.h> // ArduPilot Mega Vector/Matrix math Library
|
||||||
#include <Filter.h> // Filter library
|
#include <Filter.h> // Filter library
|
||||||
#include <LowPassFilter.h> // LowPassFilter class (inherits from Filter class)
|
#include <LowPassFilter.h> // LowPassFilter class (inherits from Filter class)
|
||||||
|
#include <AP_Buffer.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Serial ports
|
// Serial ports
|
||||||
|
Loading…
Reference in New Issue
Block a user