Add planar trifocal tensor#1094
Conversation
add trifocal tensor constructor from bearing measurements
| @@ -0,0 +1,128 @@ | |||
| #include <iostream> | |||
| Matrix2 mat1() const { return matrix1_; } | ||
| }; | ||
|
|
||
| } // namespace gtsam |
dellaert
left a comment
There was a problem hiding this comment.
We need to thin k about the nonlinear case before reviewing
| using namespace std; | ||
| using namespace gtsam; | ||
|
|
||
| TEST(TrifocalTensor2, transform) { |
| } | ||
|
|
||
| // calculate trifocal tensor | ||
| TrifocalTensor2 T(measurement_u, measurement_v, measurement_w); |
There was a problem hiding this comment.
Change to a "named constructor", static FromBearingMeasurements()
There was a problem hiding this comment.
Have a test for this method, and explain where the ground truth comes from!
|
|
||
| // estimate measurement of a robot from the measurements of the other two | ||
| // robots | ||
| for (unsigned int i = 0; i < measurement_u.size(); i++) { |
| // robots | ||
| for (unsigned int i = 0; i < measurement_u.size(); i++) { | ||
| const Rot2 actual_measurement_u = | ||
| T.transform(measurement_v[i], measurement_w[i]); |
There was a problem hiding this comment.
comment that this is important and is being tested
|
|
||
| // 2D landmarks | ||
| vector<Point2> landmarks; | ||
| landmarks.push_back(Point2(2.0, 0.5)); |
|
|
||
| // 2D landmarks | ||
| vector<Point2> landmarks; | ||
| landmarks.push_back(Point2(2.0, 0.5)); |
|
|
||
| Matrix2 actual_trifocal_tensor_mat0 = T.mat1(); | ||
|
|
||
| Matrix2 exp_trifocal_tensor_mat0; |
There was a problem hiding this comment.
Annotate this with //regression
|
Oh, and, BTW, CI seems to fail. Please do "make check" before doing a push to gtsam repo. As an aside, every push triggers CI, so please don't push every commit - push once you both are satisfied with changes. A development like this might be better done in a fork |
|
@Hal-Zhaodong-Yang do you intend to continue working on this? |
This PR adds the following:
TrifocalTensor2.[h|cpp], which declare and define planar trifocal tensor classTrifocalTensor2.TrifocalTensor2constructors from bearing measurements and bearing measurements expressed in projective coordinates.transformto find a measurement in the first view using measurements from second and third views.testTrifocalTensor2.cpp, which tests the constructed planar trifocal tensor.transformmethod by comparing a set of ground-true bearing measurements with an estimated bearing measurements.