Fixed incorrect replacement of Vector.h's ones(n) with Matrix::Ones(m,n).

release/4.3a0
Alex Hagiopol 2016-04-11 15:25:08 -04:00
parent 70b2aab352
commit 379ad8b3d2
3 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ TEST(GaussianFactorGraph, initialization) {
SharedDiagonal unit2 = noiseModel::Unit::Create(2);
fg +=
JacobianFactor(0, 10*I_2x2, -1.0*Matrix::Ones(2,2), unit2),
JacobianFactor(0, 10*I_2x2, -1.0*ones(2), unit2),
JacobianFactor(0, -10*I_2x2,1, 10*I_2x2, Vector2(2.0, -1.0), unit2),
JacobianFactor(0, -5*I_2x2, 2, 5*I_2x2, Vector2(0.0, 1.0), unit2),
JacobianFactor(1, -5*I_2x2, 2, 5*I_2x2, Vector2(-1.0, 1.5), unit2);
@ -166,7 +166,7 @@ static GaussianFactorGraph createSimpleGaussianFactorGraph() {
GaussianFactorGraph fg;
SharedDiagonal unit2 = noiseModel::Unit::Create(2);
// linearized prior on x1: c[_x1_]+x1=0 i.e. x1=-c[_x1_]
fg += JacobianFactor(2, 10*I_2x2, -1.0*Matrix::Ones(2,2), unit2);
fg += JacobianFactor(2, 10*I_2x2, -1.0*ones(2), unit2);
// odometry between x1 and x2: x2-x1=[0.2;-0.1]
fg += JacobianFactor(0, 10*I_2x2, 2, -10*I_2x2, Vector2(2.0, -1.0), unit2);
// measurement between x1 and l1: l1-x1=[0.0;0.2]

View File

@ -186,7 +186,7 @@ TEST (Serialization, gaussian_factor_graph) {
{
Key i1 = 4, i2 = 7;
Matrix A1 = I_3x3, A2 = -1.0 * I_3x3;
Vector b = Matrix::Ones(3,3);
Vector b = ones(3);
SharedDiagonal model = noiseModel::Diagonal::Sigmas(Vector3(1.0, 2.0, 3.0));
JacobianFactor jacobianfactor(i1, A1, i2, A2, b, model);
HessianFactor hessianfactor(jacobianfactor);

View File

@ -274,7 +274,7 @@ inline GaussianFactorGraph createGaussianFactorGraph() {
GaussianFactorGraph fg;
// linearized prior on x1: c[_x1_]+x1=0 i.e. x1=-c[_x1_]
fg += JacobianFactor(X(1), 10*I_2x2, -1.0*Matrix::Ones(2,2));
fg += JacobianFactor(X(1), 10*I_2x2, -1.0*ones(2));
// odometry between x1 and x2: x2-x1=[0.2;-0.1]
fg += JacobianFactor(X(1), -10*I_2x2, X(2), 10*I_2x2, Vector2(2.0, -1.0));