Made unit test local vars/functions in anonymous namespace
parent
dd84ffcc8e
commit
124a38f72d
|
@ -11,13 +11,17 @@
|
|||
using namespace gtsam;
|
||||
using namespace gtsam::symbol_shorthand;
|
||||
|
||||
const double tol=1e-5;
|
||||
const double h = 0.1;
|
||||
const double g = 9.81, l = 1.0;
|
||||
namespace {
|
||||
|
||||
const double deg2rad = M_PI/180.0;
|
||||
LieScalar origin, q1(deg2rad*30.0), q2(deg2rad*31.0);
|
||||
LieScalar v1(deg2rad*1.0/h), v2((v1-h*g/l*sin(q1)));
|
||||
const double tol=1e-5;
|
||||
const double h = 0.1;
|
||||
const double g = 9.81, l = 1.0;
|
||||
|
||||
const double deg2rad = M_PI/180.0;
|
||||
LieScalar origin, q1(deg2rad*30.0), q2(deg2rad*31.0);
|
||||
LieScalar v1(deg2rad*1.0/h), v2((v1-h*g/l*sin(q1)));
|
||||
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
TEST( testPendulumFactor1, evaluateError) {
|
||||
|
|
|
@ -5,21 +5,29 @@
|
|||
|
||||
#include <CppUnitLite/TestHarness.h>
|
||||
|
||||
#include <gtsam/nonlinear/Symbol.h>
|
||||
#include <gtsam_unstable/dynamics/VelocityConstraint3.h>
|
||||
|
||||
/* ************************************************************************* */
|
||||
using namespace gtsam;
|
||||
|
||||
const double tol=1e-5;
|
||||
const double dt = 1.0;
|
||||
namespace {
|
||||
|
||||
LieScalar origin,
|
||||
const double tol=1e-5;
|
||||
const double dt = 1.0;
|
||||
|
||||
LieScalar origin,
|
||||
x1(1.0), x2(2.0), v(1.0);
|
||||
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
TEST( testVelocityConstraint3, evaluateError) {
|
||||
|
||||
using namespace gtsam::symbol_shorthand;
|
||||
|
||||
// hard constraints don't need a noise model
|
||||
VelocityConstraint3 constraint(x1, x2, v, dt);
|
||||
VelocityConstraint3 constraint(X(1), X(2), V(1), dt);
|
||||
|
||||
// verify error function
|
||||
EXPECT(assert_equal(zero(1), constraint.evaluateError(x1, x2, v), tol));
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
using namespace std;
|
||||
using namespace gtsam;
|
||||
|
||||
namespace {
|
||||
|
||||
// Set up initial pose, odometry difference, loop closure difference, and initialization errors
|
||||
const Pose3 poseInitial;
|
||||
|
@ -431,6 +432,8 @@ void FindFactorsWithOnly(const CONTAINER& keys, const NonlinearFactorGraph& sour
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
TEST( ConcurrentBatchFilter, update_batch )
|
||||
{
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
using namespace std;
|
||||
using namespace gtsam;
|
||||
|
||||
namespace {
|
||||
|
||||
// Set up initial pose, odometry difference, loop closure difference, and initialization errors
|
||||
const Pose3 poseInitial;
|
||||
const Pose3 poseOdometry( Rot3::RzRyRx(Vector_(3, 0.05, 0.10, -0.75)), Point3(1.0, -0.25, 0.10) );
|
||||
|
@ -395,6 +397,8 @@ void FindFactorsWithOnly(const std::set<Key>& keys, const NonlinearFactorGraph&
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
TEST( ConcurrentBatchSmoother, update_batch )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue