APM:Libraries
Macros | Functions | Variables
eulers.cpp File Reference
#include <AP_HAL/AP_HAL.h>
#include <AP_Math/AP_Math.h>
Include dependency graph for eulers.cpp:

Go to the source code of this file.

Macros

#define SHOW_POLES_BREAKDOWN   0
 

Functions

void setup ()
 
void loop ()
 
void test_matrix_rotate (void)
 
void test_frame_transforms (void)
 
void test_conversions (void)
 
void test_quaternion_eulers (void)
 
void test_matrix_eulers (void)
 
static float rad_diff (float rad1, float rad2)
 
static void check_result (const char *msg, float roll, float pitch, float yaw, float roll2, float pitch2, float yaw2)
 
static void test_euler (float roll, float pitch, float yaw)
 
static void test_quaternion (float roll, float pitch, float yaw)
 
static void test_conversion (float roll, float pitch, float yaw)
 
static float rand_num (void)
 
 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...
 
static const float angles []
 

Macro Definition Documentation

◆ SHOW_POLES_BREAKDOWN

#define SHOW_POLES_BREAKDOWN   0

Definition at line 18 of file eulers.cpp.

Function Documentation

◆ AP_HAL_MAIN()

AP_HAL_MAIN ( )

Referenced by loop().

Here is the caller graph for this function:

◆ check_result()

static void check_result ( const char *  msg,
float  roll,
float  pitch,
float  yaw,
float  roll2,
float  pitch2,
float  yaw2 
)
static

Definition at line 32 of file eulers.cpp.

Referenced by test_conversion(), test_euler(), and test_quaternion().

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

◆ loop()

void loop ( void  )

Definition at line 304 of file eulers.cpp.

Here is the call graph for this function:

◆ rad_diff()

static float rad_diff ( float  rad1,
float  rad2 
)
static

Definition at line 20 of file eulers.cpp.

Referenced by check_result().

Here is the caller graph for this function:

◆ rand_num()

static float rand_num ( void  )
static

Definition at line 244 of file eulers.cpp.

Referenced by test_matrix_rotate().

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

◆ setup()

void setup ( void  )

Definition at line 291 of file eulers.cpp.

Here is the call graph for this function:

◆ test_conversion()

static void test_conversion ( float  roll,
float  pitch,
float  yaw 
)
static

Definition at line 164 of file eulers.cpp.

Referenced by setup(), and test_conversions().

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

◆ test_conversions()

void test_conversions ( void  )

Definition at line 192 of file eulers.cpp.

Referenced by setup().

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

◆ test_euler()

static void test_euler ( float  roll,
float  pitch,
float  yaw 
)
static

Definition at line 80 of file eulers.cpp.

Referenced by test_matrix_eulers().

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

◆ test_frame_transforms()

void test_frame_transforms ( void  )

Definition at line 212 of file eulers.cpp.

Referenced by setup().

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

◆ test_matrix_eulers()

void test_matrix_eulers ( void  )

Definition at line 93 of file eulers.cpp.

Referenced by setup().

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

◆ test_matrix_rotate()

void test_matrix_rotate ( void  )

Definition at line 249 of file eulers.cpp.

Referenced by setup().

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

◆ test_quaternion()

static void test_quaternion ( float  roll,
float  pitch,
float  yaw 
)
static

Definition at line 107 of file eulers.cpp.

Referenced by test_quaternion_eulers().

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

◆ test_quaternion_eulers()

void test_quaternion_eulers ( void  )

Definition at line 131 of file eulers.cpp.

Referenced by setup().

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

Variable Documentation

◆ angles

const float angles[]
static
Initial value:
= { 0, M_PI/8, M_PI/4, M_PI/2, M_PI,
-M_PI/8, -M_PI/4, -M_PI/2, -M_PI}
#define M_PI
Definition: definitions.h:10

Definition at line 90 of file eulers.cpp.

Referenced by AP_MotorsHeli_Quad::calculate_roll_pitch_collective_factors(), test_conversions(), test_matrix_eulers(), and test_quaternion_eulers().

◆ 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 16 of file eulers.cpp.