Commit dd499560 authored by Tim Übelhör's avatar Tim Übelhör

Update .gitlab-ci.yml

Deleted test_package/CMakeLists.txt, test_package/conanfile.py, test_package/example.cpp files
parent f2928748
Pipeline #201039 passed with stages
in 7 minutes and 29 seconds
......@@ -27,7 +27,7 @@ catkin_tools:
script:
- catkin build --summarize --no-status --force-color
catkin tools_tests:
ctest:
stage: test
script:
- catkin config --cmake-args -DCMAKE_BUILD_TYPE=Debug # release optimizations cause tests to fail
......
project(PackageTest)
cmake_minimum_required(VERSION 2.8.12)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_executable(example example.cpp)
target_link_libraries(example ${CONAN_LIBS} ${CMAKE_DL_LIBS})
from conans import ConanFile, CMake
import os
class Gl3wTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def imports(self):
self.copy("*.dll", dst="bin", src="bin")
self.copy("*.dylib*", dst="bin", src="lib")
def test(self):
os.chdir("bin")
self.run(".%sexample" % os.sep)
#include <filter_bay/kalman_filter/kalman_filter.hpp>
#include <iostream>
// Typedef the filter to get correct Matrices
using MyFilter = typename filter_bay::KalmanFilter<2, 3, 1, 1>;
using TransitionModel = typename MyFilter::TransitionModel;
using ObservationModel = typename MyFilter::ObservationModel;
// Threshold for positiv floating point test
const double EPS = 0.01;
const int LOOP_COUNT = 10000;
// Parameters of model
const double T = 1;
const double c = 5;
const double d = 2;
const double m = 10;
const double var_p = 0.3;
const double var_m = 0.1;
/*!
Creates the kalman filter for the test methods.
*/
MyFilter create_filter()
{
// transition model
TransitionModel::TransitionMatrix F;
F << 1 - c * pow(T, 2) / (2 * m),
T - d * pow(T, 2) / (2 * m),
-c * T / m,
1 - d * T / m;
TransitionModel::InputMatrix B;
B << c * pow(T, 2) / (2 * m),
d * pow(T, 2) / (2 * m),
pow(T, 2) / (2 * m),
c * T / m,
d * T / m,
T / m;
TransitionModel::NoiseMatrix G;
G << pow(T, 2) / (2 * m),
T / m;
TransitionModel transition_model(std::move(F),
std::move(B), std::move(G));
// observation model
ObservationModel::ObservationMatrix H;
H << 1, 0;
ObservationModel::NoiseCovariance R;
R << var_m;
ObservationModel observation_model(std::move(H), std::move(R));
// filter
return MyFilter(std::move(transition_model), std::move(observation_model));
}
int main(int argc, char **argv)
{
auto my_filter = create_filter();
std::cout << "Initialized a filter with state " << my_filter.get_state()
<< "\n";
return EXIT_SUCCESS;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment