29 using namespace gtsam;
38 MixtureFactor::const_iterator const_it = factor.
begin();
40 MixtureFactor::iterator it = factor.
begin();
48 double between0 = 0.0;
49 double between1 = 1.0;
52 auto model = noiseModel::Diagonal::Sigmas(sigmas,
false);
55 std::make_shared<BetweenFactor<double>>(
X(1),
X(2), between0,
model);
57 std::make_shared<BetweenFactor<double>>(
X(1),
X(2), between1,
model);
58 std::vector<NonlinearFactor::shared_ptr>
factors{f0, f1};
66 0 Leaf Nonlinear factor on 2 keys 67 1 Leaf Nonlinear factor on 2 keys 76 double between0 = 0.0;
77 double between1 = 1.0;
80 auto model = noiseModel::Diagonal::Sigmas(sigmas,
false);
83 std::make_shared<BetweenFactor<double>>(
X(1),
X(2), between0,
model);
85 std::make_shared<BetweenFactor<double>>(
X(1),
X(2), between1,
model);
86 std::vector<NonlinearFactor::shared_ptr>
factors{f0, f1};
97 continuousValues.
insert<
double>(
X(1), 0);
98 continuousValues.
insert<
double>(
X(2), 1);
103 std::vector<DiscreteKey> discrete_keys = {m1};
104 std::vector<double> errors = {0.5, 0};
Provides additional testing facilities for common data structures.
Matrix< RealScalar, Dynamic, Dynamic > M
static int runAllTests(TestResult &result)
bool assert_print_equal(const std::string &expected, const V &actual, const std::string &s="")
Eigen::Matrix< double, 1, 1 > Vector1
noiseModel::Diagonal::shared_ptr model
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
const GaussianFactorGraph factors
Nonlinear Mixture factor of continuous and discrete.
const_iterator end() const
static MixtureFactor getMixtureFactor()
#define EXPECT(condition)
TEST(MixtureFactor, Constructor)
#define EXPECT_LONGS_EQUAL(expected, actual)
Point2 f1(const Point3 &p, OptionalJacobian< 2, 3 > H)
std::pair< Key, size_t > DiscreteKey
void insert(Key j, const Value &val)
Implementation of a discrete conditional mixture factor.
The matrix class, also used for vectors and row-vectors.
const_iterator begin() const