summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiller2017-07-03 21:48:37 -0500
committerMiller2017-07-03 21:48:37 -0500
commit552df867b38b5873f3562ae9f762c30e94cf9a17 (patch)
tree43483c59d42c32402ff4a12fda986112f8ace04f
parent262fadf50b4463554d496f73573b7257a2abceec (diff)
downloadrefslam-552df867b38b5873f3562ae9f762c30e94cf9a17.zip
refslam-552df867b38b5873f3562ae9f762c30e94cf9a17.tar.gz
Make it run on CC
-rw-r--r--src/state.cpp8
-rw-r--r--src/types.h3
-rw-r--r--src/vision.cpp16
3 files changed, 15 insertions, 12 deletions
diff --git a/src/state.cpp b/src/state.cpp
index cba336e..cbf0e15 100644
--- a/src/state.cpp
+++ b/src/state.cpp
@@ -215,7 +215,7 @@ State::partialUpdate( const MatrixXd &h, const MatrixXd &S,
{
MatrixXd K;
// P^T is implied here since P is symmetric
- K = S.fullPivLu().solve(h*P).transpose();
+ K = S.fullPivHouseholderQr().solve(h*P).transpose();
// Compute the innovation or error
Matrix<double,Dynamic,1> y;
@@ -1111,8 +1111,10 @@ State::featuresAsMeasurements ( vector<measurement_t> &yk, const Camera &cam,
// Get ellipse
Matrix<double,6,6> s;
s = (*i)->S(Pxx(), Pxy((*i)->id()), Pyy((*i)->id()), body->ned(), q);
- z.Ssrc << s(0,0), s(1,1);
- z.Sref << s(4,4), s(5,5);
+ z.Ssrc[0] = s(0,0);
+ z.Ssrc[1] = s(1,1);
+ z.Sref[0] = s(4,4);
+ z.Sref[1] = s(5,5);
yk.push_back(z);
}
diff --git a/src/types.h b/src/types.h
index ff0a089..52f8228 100644
--- a/src/types.h
+++ b/src/types.h
@@ -24,7 +24,8 @@ typedef struct {
int id;
Vector3d source, reflection;
double height;
- UVector2d Ssrc, Sref;
+ double Ssrc[2];
+ double Sref[2];
cv::Mat patch, refpatch;
double xcorrmax;
} measurement_t;
diff --git a/src/vision.cpp b/src/vision.cpp
index 27d4a7b..148f643 100644
--- a/src/vision.cpp
+++ b/src/vision.cpp
@@ -82,10 +82,10 @@ Vision::drawMeasurements ( const vector<measurement_t> &z, const Camera &cam,
if (drawEllipse) {
double xs, ys, xr, yr;
- xs = 2*sqrt(i->Ssrc(0));
- ys = 2*sqrt(i->Ssrc(1));
- xr = 2*sqrt(i->Sref(0));
- yr = 2*sqrt(i->Sref(1));
+ xs = 2*sqrt(i->Ssrc[0]);
+ ys = 2*sqrt(i->Ssrc[1]);
+ xr = 2*sqrt(i->Sref[0]);
+ yr = 2*sqrt(i->Sref[1]);
// Create rotated rect for ellipse
cv::RotatedRect rrs(ps, cv::Size(2*INLIER_THRESHOLD*xs, 2*INLIER_THRESHOLD*ys), 0.);
@@ -332,11 +332,11 @@ Vision::searchRegion ( const Camera &cam, const measurement_t &z, cv::RotatedRec
double xs, ys;
if (z.z_type==MONO) {
- xs = 2*sqrt(z.Ssrc(0));
- ys = 2*sqrt(z.Ssrc(1));
+ xs = 2*sqrt(z.Ssrc[0]);
+ ys = 2*sqrt(z.Ssrc[1]);
} else {
- xs = 2*sqrt(z.Sref(0));
- ys = 2*sqrt(z.Sref(1));
+ xs = 2*sqrt(z.Sref[0]);
+ ys = 2*sqrt(z.Sref[1]);
}
// Create rotated rect for ellipse