PX4 Firmware
PX4 Autopilot Software http://px4.io
SmoothZTest Class Reference
Inheritance diagram for SmoothZTest:
Collaboration diagram for SmoothZTest:

Public Member Functions

virtual bool run_tests ()
 Override to run your unit tests. More...
 
bool brakeUpward ()
 
bool brakeDownward ()
 
bool accelerateUpwardFromBrake ()
 
bool accelerateDownwardFromBrake ()
 
- Public Member Functions inherited from UnitTest
 UnitTest ()=default
 
virtual ~UnitTest ()=default
 
void print_results ()
 Prints results from running of unit tests. More...
 

Additional Inherited Members

- Protected Member Functions inherited from UnitTest
virtual void _init (void)
 Run before each unit test. Override to provide custom behavior. More...
 
virtual void _cleanup (void)
 Run after each unit test. Override to provide custom behavior. More...
 
void _print_assert (const char *msg, const char *test, const char *file, int line)
 
void _print_compare (const char *msg, const char *v1_text, int v1, const char *v2_text, int v2, const char *file, int line)
 
- Protected Attributes inherited from UnitTest
int _tests_run {0}
 The number of individual unit tests run. More...
 
int _tests_failed {0}
 The number of unit tests which failed. More...
 
int _tests_passed {0}
 The number of unit tests which passed. More...
 
int _assertions {0}
 Total number of assertions tested by all unit tests. More...
 

Detailed Description

Definition at line 44 of file test_smooth_z.cpp.

Member Function Documentation

◆ accelerateDownwardFromBrake()

bool SmoothZTest::accelerateDownwardFromBrake ( )

Definition at line 223 of file test_smooth_z.cpp.

References acceleration, dt, f(), FLT_EPSILON, ManualSmoothingZ::getIntention(), ManualSmoothingZ::getMaxAcceleration(), ManualSmoothingZ::overwriteAccelerationDown(), ManualSmoothingZ::overwriteAccelerationUp(), ManualSmoothingZ::overwriteJerkMax(), ManualSmoothingZ::smoothVelFromSticks(), test_smooth_z(), ut_assert_true, and ut_declare_test_c.

Referenced by run_tests().

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

◆ accelerateUpwardFromBrake()

bool SmoothZTest::accelerateUpwardFromBrake ( )

Definition at line 174 of file test_smooth_z.cpp.

References acceleration, dt, f(), FLT_EPSILON, ManualSmoothingZ::getIntention(), ManualSmoothingZ::getMaxAcceleration(), ManualSmoothingZ::overwriteAccelerationDown(), ManualSmoothingZ::overwriteAccelerationUp(), ManualSmoothingZ::overwriteJerkMax(), ManualSmoothingZ::smoothVelFromSticks(), and ut_assert_true.

Referenced by run_tests().

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

◆ brakeDownward()

bool SmoothZTest::brakeDownward ( )

Definition at line 118 of file test_smooth_z.cpp.

References acceleration, brake, dt, f(), FLT_EPSILON, ManualSmoothingZ::getIntention(), ManualSmoothingZ::getMaxAcceleration(), ManualSmoothingZ::overwriteAccelerationDown(), ManualSmoothingZ::overwriteAccelerationUp(), ManualSmoothingZ::overwriteJerkMax(), ManualSmoothingZ::smoothVelFromSticks(), and ut_assert_true.

Referenced by run_tests().

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

◆ brakeUpward()

bool SmoothZTest::brakeUpward ( )

Definition at line 66 of file test_smooth_z.cpp.

References acceleration, brake, dt, f(), FLT_EPSILON, ManualSmoothingZ::getIntention(), ManualSmoothingZ::getMaxAcceleration(), ManualSmoothingZ::overwriteAccelerationDown(), ManualSmoothingZ::overwriteAccelerationUp(), ManualSmoothingZ::overwriteJerkMax(), ManualSmoothingZ::smoothVelFromSticks(), and ut_assert_true.

Referenced by run_tests().

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

◆ run_tests()

bool SmoothZTest::run_tests ( )
virtual

Override to run your unit tests.

Unit tests should be called using ut_run_test macro.

Returns
true: all unit tests succeeded, false: one or more unit tests failed

Implements UnitTest.

Definition at line 56 of file test_smooth_z.cpp.

References UnitTest::_tests_failed, accelerateDownwardFromBrake(), accelerateUpwardFromBrake(), brakeDownward(), brakeUpward(), and ut_run_test.

Here is the call graph for this function:

The documentation for this class was generated from the following file: