Skip to content
Snippets Groups Projects
Commit 33fd1190 authored by Mirko Wächter's avatar Mirko Wächter
Browse files

added simple pid controller sanity test

parent 8ca2940c
No related branches found
No related tags found
No related merge requests found
set(LIBS ${LIBS} RobotAPICore )
armarx_add_test(TrajectoryTest TrajectoryTest.cpp "${LIBS}")
armarx_add_test(PIDControllerTest PIDControllerTest.cpp "${LIBS}")
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package ArmarX::RobotAPI::Test
* @author Nils Adermann (naderman at naderman dot de)
* @date 2010
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#define BOOST_TEST_MODULE RobotAPI::PIDController::Test
#define ARMARX_BOOST_TEST
#include <RobotAPI/Test.h>
#include <ArmarXCore/core/test/IceTestHelper.h>
#include <ArmarXCore/util/json/JSONObject.h>
#include "../PIDController.h"
using namespace armarx;
BOOST_AUTO_TEST_CASE(PIDControllerTest)
{
PIDController c(1, 0, 0, 0.1, 0.1);
c.update(0.1, 0, 1);
ARMARX_INFO << "velocity: " << c.getControlValue();
BOOST_CHECK_LE(c.getControlValue(), 0.1);
BOOST_CHECK_LE(c.controlValueDerivation, 0.11);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment