28 #include <boost/assign/std/list.hpp> 29 #include <boost/assign/std/vector.hpp> 30 #include <boost/assign/list_of.hpp> 34 #include <type_traits> 36 using namespace gtsam;
38 static double inf = std::numeric_limits<double>::infinity();
61 void print(
const std::string&
str =
"")
const {}
63 size_t dim()
const {
return 0; }
178 Matrix23
M1 = Matrix23::Zero(),
M2 = Matrix23::Zero();
214 expected.insert(key1,
Vector3(2.0, 3.1, 4.2));
233 expected.insert(key2,
Vector3(6.3, 7.4, 8.5));
251 poseconfig.insert(
key2,
Pose2(0.3, 0.4, 0.5));
254 CHECK(poseconfig.equals(poseconfig));
287 KeyVector::const_iterator itAct = actual.begin(), itExp =
expected.begin();
288 for (; itAct != actual.end() && itExp !=
expected.end(); ++itAct, ++itExp) {
300 boost::optional<const double&>
v = config0.
exists<
double>(
key1);
337 Values::Filtered<Value> filtered = values.
filter(boost::bind(std::greater_equal<Key>(), _1, 2));
339 for(
const auto key_value: filtered) {
342 try {key_value.value.cast<
Pose2>();}
catch (
const std::bad_cast&
e) {
FAIL(
"can't cast Value to Pose2");}
347 try {key_value.value.cast<
Pose3>();}
catch (
const std::bad_cast&
e) {
FAIL(
"can't cast Value to Pose3");}
358 Values actualSubValues1(filtered);
359 Values expectedSubValues1;
360 expectedSubValues1.
insert(2, pose2);
361 expectedSubValues1.
insert(3, pose3);
365 Values::ConstFiltered<Value> constfiltered = values.
filter(boost::bind(std::greater_equal<Key>(), _1, 2));
367 Values fromconstfiltered(constfiltered);
372 Values::ConstFiltered<Pose3> pose_filtered = values.
filter<
Pose3>();
374 for(
const auto key_value: pose_filtered) {
391 Values actualSubValues2(pose_filtered);
392 Values expectedSubValues2;
393 expectedSubValues2.
insert(1, pose1);
394 expectedSubValues2.
insert(3, pose3);
412 for(
const auto key_value: values.
filter(Symbol::ChrTest(
'y'))) {
538 Vector v(3); v << 5.0, 6.0, 7.0;
549 Vector v(3); v << 5.0, 6.0, 7.0;
586 Matrix v(1,3); v << 5.0, 6.0, 7.0;
595 Matrix13
v; v << 5.0, 6.0, 7.0;
597 string expected =
"Values with 1 values:\nValue v1: (Eigen::Matrix<double, 1, 3, 1, 1, 3>)\n[\n 5, 6, 7\n]\n\n";
604 const Pose2 poseA(1.0, 2.0, 0.3), poseC(.0, .0, .0);
bool equals(const TestValue &other, double tol=1e-9) const
Provides additional testing facilities for common data structures.
iterator lower_bound(Key j)
Both ManifoldTraits and Testable.
void print(const std::string &str="") const
Concept check for values that can be used in unit tests.
Vector localCoordinates(const TestValue &, OptionalJacobian< dimension, dimension > H1=boost::none, OptionalJacobian< dimension, dimension > H2=boost::none) const
static int runAllTests(TestResult &result)
A non-templated config holding any types of Manifold-group elements.
bool assert_print_equal(const std::string &expected, const V &actual, const std::string &s="")
void insert(Key j, const Value &val)
#define DOUBLES_EQUAL(expected, actual, threshold)
TestValues(const TestValue &value1, const TestValue &value2)
Values retract(const VectorValues &delta) const
#define CHECK_EXCEPTION(condition, exception_name)
bool equals(const Values &other, double tol=1e-9) const
const Symbol key1('v', 1)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
#define THROWS_EXCEPTION(condition)
const ValueType at(Key j) const
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;Map< MatrixXf > M2(M1.data(), 6, 2)
#define EXPECT(condition)
static Pose3 pose3(rt3, pt3)
static int DestructorCount
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const Pose3 pose1(Rot3(), Point3(0, 1, 0.5))
#define LONGS_EQUAL(expected, actual)
GenericValue< T > genericValue(const T &v)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
TestValueData(const TestValueData &other)
std::vector< float > Values
#define EXPECT_LONGS_EQUAL(expected, actual)
const Symbol key3('v', 3)
VectorValues localCoordinates(const Values &cp) const
const Symbol key2('v', 2)
const Symbol key4('v', 4)
void update(Key j, const Value &val)
TestValue retract(const Vector &, OptionalJacobian< dimension, dimension > H1=boost::none, OptionalJacobian< dimension, dimension > H2=boost::none) const
static int ConstructorCount
bool equal(const T &obj1, const T &obj2, double tol)
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
iterator upper_bound(Key j)
Filtered< Value > filter(const boost::function< bool(Key)> &filterFcn)