Skip to content

Commit 55facad

Browse files
jwahlen64Jonas Wahlen
andauthored
Add missing covariance initialization (#74)
Co-authored-by: Jonas Wahlen <jonas.wahlen@fixposition.com>
1 parent a66ef9a commit 55facad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fixposition_driver_lib/include/fixposition_driver_lib/messages/base_converter.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ inline times::GpsTime ConvertGpsTime(const std::string& gps_wno, const std::stri
186186
inline Eigen::Matrix<double, 3, 3> BuildCovMat3D(const double xx, const double yy, const double zz,
187187
const double xy, const double yz, const double xz) {
188188
Eigen::Matrix<double, 3, 3> cov;
189+
cov.setZero();
190+
189191
// Diagonals
190192
cov(0, 0) = xx; // 0
191193
cov(1, 1) = yy; // 4
@@ -227,6 +229,8 @@ inline Eigen::Matrix<double, 6, 6> BuildCovMat6D(const double xx, const double y
227229
const double yz, const double xz, double xx1, const double yy1,
228230
const double zz1, const double xy1, const double yz1, double xz1) {
229231
Eigen::Matrix<double, 6, 6> cov;
232+
cov.setZero();
233+
230234
// Diagonals
231235
cov(0, 0) = xx; // 0
232236
cov(1, 1) = yy; // 7

0 commit comments

Comments
 (0)