From 8d25dcd54376967944f7b4bf527cd3cc9cf29f44 Mon Sep 17 00:00:00 2001 From: kamilritz Date: Tue, 21 Jan 2020 14:40:32 +0100 Subject: [PATCH] Update EKF auxiliary velocity interface --- src/modules/ekf2/ekf2_main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index 81fa27871f..04e87f6ba5 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -1180,9 +1180,11 @@ void Ekf2::Run() // we can only use the landing target if it has a fixed position and a valid velocity estimate if (landing_target_pose.is_static && landing_target_pose.rel_vel_valid) { // velocity of vehicle relative to target has opposite sign to target relative to vehicle - matrix::Vector3f velocity { -landing_target_pose.vx_rel, -landing_target_pose.vy_rel, 0.0f}; - matrix::Vector3f variance {landing_target_pose.cov_vx_rel, landing_target_pose.cov_vy_rel, 0.0f}; - _ekf.setAuxVelData(landing_target_pose.timestamp, velocity, variance); + auxVelSample auxvel_sample; + auxvel_sample.vel = matrix::Vector3f{-landing_target_pose.vx_rel, -landing_target_pose.vy_rel, 0.0f}; + auxvel_sample.velVar = matrix::Vector3f{landing_target_pose.cov_vx_rel, landing_target_pose.cov_vy_rel, 0.0f}; + auxvel_sample.time_us = landing_target_pose.timestamp; + _ekf.setAuxVelData(auxvel_sample); } } }