PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Unit testing for controllib. More...
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[]) |
Unit testing for controllib.
Definition in file controllib_test_main.cpp.
#define ASSERT_CL | ( | T | ) | if (!(T)) { printf("FAIL\n"); return -1; } |
Definition at line 49 of file controllib_test_main.cpp.
Referenced by blockDelayTest(), blockDerivativeTest(), blockHighPassTest(), blockIntegralTest(), blockIntegralTrapTest(), blockLimitSymTest(), blockLimitTest(), blockLowPass2Test(), blockLowPassTest(), blockOutputTest(), blockPDTest(), blockPIDTest(), blockPITest(), blockPTest(), blockRandGaussTest(), blockRandUniformTest(), and blockStatsTest().
int basicBlocksTest | ( | ) |
Definition at line 70 of file controllib_test_main.cpp.
References control::blockDelayTest(), control::blockDerivativeTest(), control::blockHighPassTest(), control::blockIntegralTest(), control::blockIntegralTrapTest(), control::blockLimitSymTest(), control::blockLimitTest(), control::blockLowPass2Test(), control::blockLowPassTest(), control::blockOutputTest(), control::blockPDTest(), control::blockPIDTest(), control::blockPITest(), control::blockPTest(), control::blockRandGaussTest(), control::blockRandUniformTest(), and control::blockStatsTest().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
int blockPDTest | ( | ) |
Definition at line 352 of file controllib_test_main.cpp.
References ASSERT_CL, equal(), f(), control::BlockPD::getDerivative(), control::Block::getDt(), control::BlockPD::getKD(), control::BlockPD::getKP(), control::BlockDerivative::getLP(), control::BlockDerivative::getU(), control::SuperBlock::setDt(), control::BlockDerivative::setU(), control::BlockPD::update(), and control::BlockDerivative::update().
int blockPIDTest | ( | ) |
Definition at line 377 of file controllib_test_main.cpp.
References ASSERT_CL, equal(), f(), control::BlockPID::getDerivative(), control::Block::getDt(), control::BlockPID::getIntegral(), control::BlockPID::getKD(), control::BlockPID::getKI(), control::BlockPID::getKP(), control::BlockDerivative::getLP(), control::BlockIntegral::getMax(), control::BlockDerivative::getU(), control::BlockIntegral::getY(), control::SuperBlock::setDt(), control::BlockDerivative::setU(), control::BlockIntegral::setY(), control::BlockPID::update(), and control::BlockDerivative::update().
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().
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().
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().
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().
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().
int controllib_test_main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 532 of file controllib_test_main.cpp.
References control::basicBlocksTest().
Referenced by blockDelayTest().