mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 17:23:34 +08:00
Forced function instantiation for coverage testing.
This commit is contained in:
+2
-1
@@ -5,7 +5,7 @@
|
|||||||
namespace matrix {
|
namespace matrix {
|
||||||
|
|
||||||
template<typename Type, size_t M, size_t N>
|
template<typename Type, size_t M, size_t N>
|
||||||
void kalman_correct(
|
int kalman_correct(
|
||||||
const SquareMatrix<Type, M> & P,
|
const SquareMatrix<Type, M> & P,
|
||||||
const Matrix<Type, N, M> & C,
|
const Matrix<Type, N, M> & C,
|
||||||
const SquareMatrix<Type, N> & R,
|
const SquareMatrix<Type, N> & R,
|
||||||
@@ -20,6 +20,7 @@ void kalman_correct(
|
|||||||
dx = K*r;
|
dx = K*r;
|
||||||
beta = Scalar<Type>(r.T()*S_I*r);
|
beta = Scalar<Type>(r.T()*S_I*r);
|
||||||
dP = K*C*P*(-1);
|
dP = K*C*P*(-1);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // namespace matrix
|
}; // namespace matrix
|
||||||
|
|||||||
+9
-1
@@ -5,7 +5,15 @@
|
|||||||
|
|
||||||
using namespace matrix;
|
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()
|
int main()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,14 @@
|
|||||||
|
|
||||||
using namespace matrix;
|
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);
|
||||||
|
|
||||||
Vector<float, 6> f(float t, Vector<float, 6> y) {
|
Vector<float, 6> f(float t, Vector<float, 6> y) {
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
using namespace matrix;
|
using namespace matrix;
|
||||||
|
|
||||||
template class Vector<float, 3>;
|
template class Vector<float, 2>;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user