math: support max of three values additional to min and use it everywhere

This commit is contained in:
Matthias Grob
2021-12-07 21:06:51 +01:00
parent e8676fe87a
commit 68e2940f58
12 changed files with 18 additions and 12 deletions
+1 -1
View File
@@ -335,7 +335,7 @@ void UavcanGnssBridge::process_fixx(const uavcan::ReceivedDataStructure<FixType>
}
if (valid_vel_cov) {
report.s_variance_m_s = math::max(math::max(vel_cov[0], vel_cov[4]), vel_cov[8]);
report.s_variance_m_s = math::max(vel_cov[0], vel_cov[4], vel_cov[8]);
/* There is a nonlinear relationship between the velocity vector and the heading.
* Use Jacobian to transform velocity covariance to heading covariance