PX4 Firmware
PX4 Autopilot Software http://px4.io
controllib_test_main.cpp File Reference

Unit testing for controllib. More...

#include <math.h>
#include <stdio.h>
#include <float.h>
#include <controllib/blocks.hpp>
Include dependency graph for controllib_test_main.cpp:

Go to the source code of this file.

Macros

#define ASSERT_CL(T)   if (!(T)) { printf("FAIL\n"); return -1; }
 

Functions

int basicBlocksTest ()
 
int blockLimitTest ()
 
int blockLimitSymTest ()
 
int blockLowPassTest ()
 
int blockHighPassTest ()
 
int blockLowPass2Test ()
 
int blockIntegralTest ()
 
int blockIntegralTrapTest ()
 
int blockDerivativeTest ()
 
int blockPTest ()
 
int blockPITest ()
 
int blockPDTest ()
 
int blockPIDTest ()
 
int blockOutputTest ()
 
int blockRandUniformTest ()
 
int blockRandGaussTest ()
 
int blockStatsTest ()
 
int blockDelayTest ()
 
__EXPORT int controllib_test_main (int argc, char *argv[])
 

Detailed Description

Unit testing for controllib.

Author
James Goppert james.nosp@m..gop.nosp@m.pert@.nosp@m.gmai.nosp@m.l.com

Definition in file controllib_test_main.cpp.

Macro Definition Documentation

◆ ASSERT_CL

Function Documentation

◆ basicBlocksTest()

◆ blockDelayTest()

int blockDelayTest ( )

Definition at line 502 of file controllib_test_main.cpp.

References ASSERT_CL, controllib_test_main(), equal(), and control::BlockDelay< Type, M, N, LEN >::update().

Here is the call graph for this function:

◆ blockDerivativeTest()

int blockDerivativeTest ( )

Definition at line 291 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockDerivative::getLP(), control::BlockDerivative::getU(), control::SuperBlock::setDt(), control::BlockDerivative::setU(), and control::BlockDerivative::update().

Here is the call graph for this function:

◆ blockHighPassTest()

int blockHighPassTest ( )

Definition at line 152 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockHighPass::getFCut(), control::BlockHighPass::getU(), control::BlockHighPass::getY(), control::Block::setDt(), control::BlockHighPass::setU(), control::BlockHighPass::setY(), and control::BlockHighPass::update().

Here is the call graph for this function:

◆ blockIntegralTest()

int blockIntegralTest ( )

Definition at line 211 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockIntegral::getMax(), control::BlockIntegral::getY(), control::SuperBlock::setDt(), control::BlockIntegral::setY(), and control::BlockIntegral::update().

Here is the call graph for this function:

◆ blockIntegralTrapTest()

int blockIntegralTrapTest ( )

Definition at line 248 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockIntegralTrap::getMax(), control::BlockIntegralTrap::getU(), control::BlockIntegralTrap::getY(), control::SuperBlock::setDt(), control::BlockIntegralTrap::setU(), control::BlockIntegralTrap::setY(), and control::BlockIntegralTrap::update().

Here is the call graph for this function:

◆ blockLimitSymTest()

int blockLimitSymTest ( )

Definition at line 109 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockLimitSym::getMax(), and control::BlockLimitSym::update().

Here is the call graph for this function:

◆ blockLimitTest()

int blockLimitTest ( )

Definition at line 93 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockLimit::getMax(), control::BlockLimit::getMin(), and control::BlockLimit::update().

Here is the call graph for this function:

◆ blockLowPass2Test()

int blockLowPass2Test ( )

Definition at line 183 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockLowPass2::getFCutParam(), control::BlockLowPass2::getState(), control::Block::setDt(), control::BlockLowPass2::setState(), and control::BlockLowPass2::update().

Here is the call graph for this function:

◆ blockLowPassTest()

int blockLowPassTest ( )

Definition at line 124 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockLowPass::getFCut(), control::BlockLowPass::getState(), control::Block::setDt(), control::BlockLowPass::setState(), and control::BlockLowPass::update().

Here is the call graph for this function:

◆ blockOutputTest()

int blockOutputTest ( )

Definition at line 407 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::BlockOutput::get(), control::Block::getDt(), control::BlockOutput::getMax(), control::BlockOutput::getMin(), and control::BlockOutput::update().

Here is the call graph for this function:

◆ blockPDTest()

int blockPDTest ( )

◆ blockPIDTest()

◆ blockPITest()

int blockPITest ( )

Definition at line 330 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockPI::getIntegral(), control::BlockPI::getKI(), control::BlockPI::getKP(), control::BlockIntegral::getMax(), control::BlockIntegral::getY(), control::SuperBlock::setDt(), control::BlockIntegral::setY(), and control::BlockPI::update().

Here is the call graph for this function:

◆ blockPTest()

int blockPTest ( )

Definition at line 314 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockP::getKP(), control::Block::setDt(), and control::BlockP::update().

Here is the call graph for this function:

◆ blockRandGaussTest()

int blockRandGaussTest ( )

Definition at line 455 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockRandGauss::getMean(), control::BlockRandGauss::getStdDev(), and control::BlockRandGauss::update().

Here is the call graph for this function:

◆ blockRandUniformTest()

int blockRandUniformTest ( )

Definition at line 429 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::Block::getDt(), control::BlockRandUniform::getMax(), control::BlockRandUniform::getMin(), greater_than_or_equal(), less_than_or_equal(), and control::BlockRandUniform::update().

Here is the call graph for this function:

◆ blockStatsTest()

int blockStatsTest ( )

Definition at line 485 of file controllib_test_main.cpp.

References ASSERT_CL, equal(), f(), control::BlockStats< Type, M >::getMean(), control::BlockStats< Type, M >::getStdDev(), control::BlockStats< Type, M >::reset(), and control::BlockStats< Type, M >::update().

Here is the call graph for this function:

◆ controllib_test_main()

int controllib_test_main ( int  argc,
char *  argv[] 
)

Definition at line 532 of file controllib_test_main.cpp.

References control::basicBlocksTest().

Referenced by blockDelayTest().

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