APM:Libraries
Macros | Functions | Variables
test_perpendicular.cpp File Reference
#include <AP_gtest.h>
#include <AP_Math/vector2.h>
#include <AP_Math/vector3.h>
Include dependency graph for test_perpendicular.cpp:

Go to the source code of this file.

Macros

#define EXPECT_VECTOR2F_EQ(v1, v2)
 
#define EXPECT_VECTOR3F_EQ(v1, v2)
 
#define PERP_TEST_2D(px, py, vx, vy, ex, ey)
 
#define PERP_TEST_3D(px, py, pz, vx, vy, vz, ex, ey, ez)
 

Functions

void foo ()
 
 TEST (ThreatTests, Distance)
 

Variables

int hal = 0
 -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- More...
 

Macro Definition Documentation

◆ EXPECT_VECTOR2F_EQ

#define EXPECT_VECTOR2F_EQ (   v1,
  v2 
)
Value:
do { \
EXPECT_FLOAT_EQ(v1[0], v2[0]); \
EXPECT_FLOAT_EQ(v1[1], v2[1]); \
} while (false);

Definition at line 6 of file test_perpendicular.cpp.

◆ EXPECT_VECTOR3F_EQ

#define EXPECT_VECTOR3F_EQ (   v1,
  v2 
)
Value:
do { \
EXPECT_FLOAT_EQ(v1[0], v2[0]); \
EXPECT_FLOAT_EQ(v1[1], v2[1]); \
EXPECT_FLOAT_EQ(v1[2], v2[2]); \
} while (false);

Definition at line 12 of file test_perpendicular.cpp.

◆ PERP_TEST_2D

#define PERP_TEST_2D (   px,
  py,
  vx,
  vy,
  ex,
  ey 
)
Value:
do { \
Vector2f p(px,py); \
Vector2f v(vx,vy); \
Vector2f expected(ex,ey); \
Vector2f result; \
result = Vector2f::perpendicular(p, v); \
EXPECT_VECTOR2F_EQ(expected, result); \
} while (false)
const char * result
Definition: Printf.cpp:16
static Vector2< T > perpendicular(const Vector2< T > &pos_delta, const Vector2< T > &v1)
Definition: vector2.h:173
float v
Definition: Printf.cpp:15

Definition at line 20 of file test_perpendicular.cpp.

Referenced by TEST().

◆ PERP_TEST_3D

#define PERP_TEST_3D (   px,
  py,
  pz,
  vx,
  vy,
  vz,
  ex,
  ey,
  ez 
)
Value:
do { \
Vector3f p(px,py,pz); \
Vector3f v(vx,vy,vz); \
Vector3f expected(ex,ey,ez); \
Vector3f result; \
result = Vector3f::perpendicular(p, v); \
EXPECT_VECTOR3F_EQ(expected, result); \
} while (false)
const char * result
Definition: Printf.cpp:16
static Vector3< T > perpendicular(const Vector3< T > &p1, const Vector3< T > &v1)
Definition: vector3.h:228
float v
Definition: Printf.cpp:15

Definition at line 30 of file test_perpendicular.cpp.

Referenced by TEST().

Function Documentation

◆ foo()

void foo ( )

Definition at line 40 of file test_perpendicular.cpp.

Referenced by TEST().

Here is the caller graph for this function:

◆ TEST()

TEST ( ThreatTests  ,
Distance   
)

Definition at line 41 of file test_perpendicular.cpp.

Here is the call graph for this function:

Variable Documentation

◆ hal

int hal = 0

-*- 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 74 of file test_perpendicular.cpp.