mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
Forced function instantiation for coverage testing.
This commit is contained in:
parent
410bbc4c71
commit
a334cecfa7
@ -5,7 +5,7 @@
|
||||
namespace matrix {
|
||||
|
||||
template<typename Type, size_t M, size_t N>
|
||||
void kalman_correct(
|
||||
int kalman_correct(
|
||||
const SquareMatrix<Type, M> & P,
|
||||
const Matrix<Type, N, M> & C,
|
||||
const SquareMatrix<Type, N> & R,
|
||||
@ -20,6 +20,7 @@ void kalman_correct(
|
||||
dx = K*r;
|
||||
beta = Scalar<Type>(r.T()*S_I*r);
|
||||
dP = K*C*P*(-1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}; // namespace matrix
|
||||
|
||||
@ -5,7 +5,15 @@
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
template class Vector<float, 5>;
|
||||
template int kalman_correct<float, 6, 5>(
|
||||
const SquareMatrix<float, 6> & P,
|
||||
const Matrix<float, 5, 6> & C,
|
||||
const SquareMatrix<float, 5> & R,
|
||||
const Vector<float, 5> &r,
|
||||
Vector<float, 6> & dx,
|
||||
SquareMatrix<float, 6> & dP,
|
||||
float & beta
|
||||
);
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@ -5,6 +5,14 @@
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
// instantiate template to ensure coverage check
|
||||
template int integrate_rk4<float, 6>(
|
||||
Vector<float, 6> (*f)(float, Vector<float, 6>),
|
||||
Vector<float, 6> & y,
|
||||
float & t,
|
||||
float h
|
||||
);
|
||||
|
||||
Vector<float, 6> f(float t, Vector<float, 6> y);
|
||||
|
||||
Vector<float, 6> f(float t, Vector<float, 6> y) {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
template class Vector<float, 3>;
|
||||
template class Vector<float, 2>;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user