APM:Libraries
Classes | Macros | Functions | Variables
RCOutput.cpp File Reference
#include <AP_Common/AP_Common.h>
#include <AP_HAL/AP_HAL.h>
#include <AP_Menu/AP_Menu.h>
Include dependency graph for RCOutput.cpp:

Go to the source code of this file.

Classes

class  Menu_Commands
 

Macros

#define MENU_FUNC(func)   FUNCTOR_BIND(&commands, &Menu_Commands::func, int8_t, uint8_t, const Menu::arg *)
 
#define ESC_HZ   490
 
#define SERVO_HZ   50
 

Functions

void setup ()
 
void loop ()
 
void drive (uint16_t hz_speed)
 
 MENU (menu, "Menu: ", rcoutput_menu_commands)
 
 AP_HAL_MAIN ()
 

Variables

const AP_HAL::HALhal = AP_HAL::get_HAL()
 -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- More...
 
Menu_Commands commands
 
static uint16_t pwm = 1500
 
static int8_t delta = 1
 
const struct Menu::command rcoutput_menu_commands []
 

Macro Definition Documentation

◆ ESC_HZ

#define ESC_HZ   490

Definition at line 15 of file RCOutput.cpp.

Referenced by Menu_Commands::menu_esc().

◆ MENU_FUNC

#define MENU_FUNC (   func)    FUNCTOR_BIND(&commands, &Menu_Commands::func, int8_t, uint8_t, const Menu::arg *)

Definition at line 13 of file RCOutput.cpp.

◆ SERVO_HZ

#define SERVO_HZ   50

Definition at line 16 of file RCOutput.cpp.

Referenced by Menu_Commands::menu_servo().

Function Documentation

◆ AP_HAL_MAIN()

AP_HAL_MAIN ( )

◆ drive()

void drive ( uint16_t  hz_speed)

Definition at line 39 of file RCOutput.cpp.

Referenced by Menu_Commands::menu_esc(), and Menu_Commands::menu_servo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loop()

void loop ( void  )

Definition at line 86 of file RCOutput.cpp.

Here is the call graph for this function:

◆ MENU()

MENU ( menu  ,
"Menu: "  ,
rcoutput_menu_commands   
)

◆ setup()

void setup ( void  )

Definition at line 78 of file RCOutput.cpp.

Here is the call graph for this function:

Variable Documentation

◆ commands

Menu_Commands commands

Definition at line 33 of file RCOutput.cpp.

◆ delta

int8_t delta = 1
static

Definition at line 36 of file RCOutput.cpp.

Referenced by drive().

◆ hal

const AP_HAL::HAL& hal = AP_HAL::get_HAL()

-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-

The strategy for roll/pitch autotune is to give the user a AUTOTUNE flight mode which behaves just like FBWA, but does automatic tuning.

While the user is flying in AUTOTUNE the gains are saved every 10 seconds, but the saved gains are not the current gains, instead it saves the gains from 10s ago. When the user exits AUTOTUNE the gains are restored from 10s ago.

This allows the user to fly as much as they want in AUTOTUNE mode, and if they are ever unhappy they just exit the mode. If they stay in AUTOTUNE for more than 10s then their gains will have changed.

Using this approach users don't need any special switches, they just need to be able to enter and exit AUTOTUNE mode

Definition at line 31 of file RCOutput.cpp.

◆ pwm

uint16_t pwm = 1500
static

Definition at line 35 of file RCOutput.cpp.

Referenced by drive().

◆ rcoutput_menu_commands

const struct Menu::command rcoutput_menu_commands[]
Initial value:
= {
{ "servo", MENU_FUNC(menu_servo) },
{ "esc", MENU_FUNC(menu_esc) },
}
#define MENU_FUNC(func)
Definition: RCOutput.cpp:13

Definition at line 71 of file RCOutput.cpp.