From 118e9d82484e13d6c86b95c653408a56db80f6df Mon Sep 17 00:00:00 2001
From: Joan Sola <jsola@iri.upc.edu>
Date: Sun, 24 Apr 2022 23:31:58 +0200
Subject: [PATCH] Use Eigen::Map

---
 include/vision/factor/factor_pixel_hp.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/vision/factor/factor_pixel_hp.h b/include/vision/factor/factor_pixel_hp.h
index eed7e421b..0edfcb65e 100644
--- a/include/vision/factor/factor_pixel_hp.h
+++ b/include/vision/factor/factor_pixel_hp.h
@@ -131,10 +131,10 @@ inline void FactorPixelHp::expectation(const T* const _frame_p,
     using namespace Eigen;
 
     // frames w: world; r: robot; c: camera
-    Matrix<T, 3, 1> p_wr(_frame_p);
-    Quaternion<T>   q_wr(_frame_o);
-    Matrix<T, 3, 1> p_rc(_sensor_p);
-    Quaternion<T>   q_rc(_sensor_o);
+    Map<const Matrix<T, 3, 1> > p_wr(_frame_p);
+    Map<const Quaternion<T> >   q_wr(_frame_o);
+    Map<const Matrix<T, 3, 1> > p_rc(_sensor_p);
+    Map<const Quaternion<T> >   q_rc(_sensor_o);
 
     // camera pose in world frame: transforms from camera to world
     Matrix<T, 3, 1> p_wc = p_wr + q_wr * p_rc;
-- 
GitLab